2

I need a Software or Python Program for Converting VCF(.vcf) to FASTA(.fa) format with the help of reference (.fa)

terdon
  • 10,071
  • 5
  • 22
  • 48
Ravi
  • 21
  • 2

1 Answers1

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

StupidWolf
  • 1,688
  • 1
  • 7
  • 21
  • 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 May 14 '21 at 11:41
  • your chromosome names are different – StupidWolf May 14 '21 at 11:50
  • 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 May 14 '21 at 12:13