I need a Software or Python Program for Converting VCF(.vcf) to FASTA(.fa) format with the help of reference (.fa)
-
$\begingroup$ 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. $\endgroup$– terdon ♦Sep 22, 2019 at 18:27
-
$\begingroup$ bioinformatics.stackexchange.com/questions/2825/… $\endgroup$– M__ ♦Sep 23, 2019 at 1:46
-
$\begingroup$ Also vcftools.. $\endgroup$– M__ ♦Sep 23, 2019 at 1:47
1 Answer
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
-
$\begingroup$ 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. $\endgroup$ May 14, 2021 at 11:41
-
-
$\begingroup$ 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 ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/annotation/GRCh38_latest/… $\endgroup$ May 14, 2021 at 12:13