Answers.Body: <p>I used <a href="https://software.broadinstitute.org/gatk/documentation/tooldocs/3.8-0/org_broadinstitute_gatk_tools_walkers_fasta_FastaAlternateReferenceMaker.php" rel="nofollow noreferrer">FastaAlternateReferenceMaker</a> previously. You will need to download <a href="https://software.broadinstitute.org/gatk/download/" rel="nofollow noreferrer">GATK</a> first. Next you prepare your reference genome (reference.fasta) and your vcf file (input.vcf). You will call the GATK function like this:</p>
  
  <pre><code> java -jar GenomeAnalysisTK.jar \
     -T FastaAlternateReferenceMaker \
     -R reference.fasta \
     -o output.fasta \
     -V input.vcf \
  </code></pre>
  
  <p>output.fasta will contain the new fasta with snps inserted at sites specific by the vcf file</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-14T11:41:30.127Z
Answers.Text: I got this error when I used gatk on a Linux plaftorm:
  
  A USER ERROR has occurred: Input files reference and features have incompatible contigs: No overlapping contigs found.
Answers.UserDisplayName: David Enoma
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-14T11:50:25.673Z
Answers.Text: your chromosome names are different
Answers.UserDisplayName: StupidWolf
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-14T12:13:13.210Z
Answers.Text: how do I resolve this please? 
  
  Additionally, the vcf files are from somewhere external and I actually subset it to get a specific sample. my reference is https://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/annotation/GRCh38_latest/refseq_identifiers/GRCh38_latest_genomic.fna.gz
Answers.UserDisplayName: David Enoma
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-22T15:58:25.653Z
Answers.LastActivityDate: 2019-09-22T20:11:09.713Z
Answers.LastEditDate: 2019-09-22T20:11:09.713Z
Answers.UserDisplayName: StupidWolf
Body: <p>I need a Software or Python Program for Converting VCF(.vcf) to  FASTA(.fa) format with the help of reference (.fa)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-22T18:27:11.507Z
Comments.Text: Not quite a dupe since it asks for an R or python approach, but very relevant: [Converting a VCF into a FASTA given a reference with Python, R](//bioinformatics.stackexchange.com/q/2825).
Comments.UserDisplayName: terdon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-23T01:46:22.043Z
Comments.Text: https://bioinformatics.stackexchange.com/questions/2825/converting-a-vcf-into-a-fasta-given-a-reference-with-python-r
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-23T01:47:53.937Z
Comments.Text: Also vcftools..
Comments.UserDisplayName: M__
Tags: <fasta><sequence-analysis>
Title: How to convert VCF format file into Fasta(.fa) with the Reference data
ThreadText: # How to convert VCF format file into Fasta(.fa) with the Reference data
  
  (Asked by: username_0 on 2019-09-22)
  
  I need a Software or Python Program for Converting VCF(.vcf) to FASTA(.fa) format with the help of reference (.fa)
  
  **Tags:** fasta, sequence-analysis
  
  > **Comments:**
  > **username_1**: Not quite a dupe since it asks for an R or python approach, but very relevant: [Converting a VCF into a FASTA given a reference with Python, R](//bioinformatics.stackexchange.com/q/2825).  
  > **username_2**: https://bioinformatics.stackexchange.com/questions/2825/converting-a-vcf-into-a-fasta-given-a-reference-with-python-r  
  > **username_2**: Also vcftools..  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2019-09-22. Score: 2
  
  I used [FastaAlternateReferenceMaker](https://software.broadinstitute.org/gatk/documentation/tooldocs/3.8-0/org_broadinstitute_gatk_tools_walkers_fasta_FastaAlternateReferenceMaker.php) previously. You will need to download [GATK](https://software.broadinstitute.org/gatk/download/) first. Next you prepare your reference genome (reference.fasta) and your vcf file (input.vcf). You will call the GATK function like this:
  
  ```
   java -jar GenomeAnalysisTK.jar \
     -T FastaAlternateReferenceMaker \
     -R reference.fasta \
     -o output.fasta \
     -V input.vcf \
  
  ```
  
  output.fasta will contain the new fasta with snps inserted at sites specific by the vcf file
  
  > **Comments:**
  > **username_4**: I got this error when I used gatk on a Linux plaftorm:  A USER ERROR has occurred: Input files reference and features have incompatible contigs: No overlapping contigs found.  
  > **username_3**: your chromosome names are different  
  > **username_4**: how do I resolve this please?   Additionally, the vcf files are from somewhere external and I actually subset it to get a specific sample. my reference is https://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/annotation/GRCh38_latest/refseq_identifiers/GRCh38_latest_genomic.fna.gz  
  
  ---
  
  