<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>

CC BY-SA 4.0
2021-05-14T11:41:30.127Z
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.
David Enoma
CC BY-SA 4.0
2021-05-14T11:50:25.673Z
your chromosome names are different
StupidWolf
CC BY-SA 4.0
2021-05-14T12:13:13.210Z
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
David Enoma
CC BY-SA 4.0
2019-09-22T15:58:25.653Z
2019-09-22T20:11:09.713Z
2019-09-22T20:11:09.713Z
StupidWolf
<p>I need a Software or Python Program for Converting VCF(.vcf) to  FASTA(.fa) format with the help of reference (.fa)</p>

CC BY-SA 4.0
2019-09-22T18:27:11.507Z
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).
terdon
CC BY-SA 4.0
2019-09-23T01:46:22.043Z
https://bioinformatics.stackexchange.com/questions/2825/converting-a-vcf-into-a-fasta-given-a-reference-with-python-r
M__
CC BY-SA 4.0
2019-09-23T01:47:53.937Z
Also vcftools..
M__
<fasta><sequence-analysis>
How to convert VCF format file into Fasta(.fa) with the Reference data
# 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 previously. You will need to download GATK 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  

---

