Introducing Known Mutations (From A Vcf) Into A Fasta File
3
6
Entering edit mode
12.8 years ago
Travis ★ 2.8k

Hi,

This could probably be coded easily enough but I don't want to reinvent the wheel.

Is anyone aware of software that will take a FASTA file and a corresponding VCF file and introduce the mutations from the VCF into the FASTA sequence?

Thanks in advance.

mutation vcf fasta next-gen sequencing • 11k views
ADD COMMENT
2
Entering edit mode

how do you manage the overlapping mutations and the heterozygous mutations ?

ADD REPLY
0
Entering edit mode

this would make a decent code golf challenge

ADD REPLY
0
Entering edit mode

Alternatively,maybe use FastG.

ADD REPLY
0
Entering edit mode

I don't - I was hoping someone else did :) I might pull something together myself but for initial simplicity I would ignore both cases you mention. Neither is important to the downstream testing in my application. I could envisage selecting overlapping mutations randomly. The heterozygous bit would be more complicated. As I said though - neither is important to my particular application.

ADD REPLY
7
Entering edit mode
12.8 years ago

This is a duplicate question.

You want the following, from GATK:

java -Xmx2g -jar GenomeAnalysisTK.jar \
-R MY_REFERENCE.fa \
-T FastaAlternateReferenceMaker \
-o MY_REFERENCE_WITH_SNPS_FROM_VCF.fa \
--variant MY_VCF_IN_VCF_4.0_FORMAT.vcf

See also this question and this question.

ADD COMMENT
0
Entering edit mode

Thanks David. I had actually searched for previous questions on the topic and retrieved nothing! Cheers.

ADD REPLY
3
Entering edit mode
12.8 years ago
Aaron H ▴ 170

I wrote a script that assumes no overlapping mutations, all biallelic, and tosses the heterozygous sites. Also depends on biopython but just for reading a fasta file so easy to get rid of.

https://github.com/aihardin/utils/blob/master/vcf2fasta.py

ADD COMMENT
0
Entering edit mode
11.5 years ago

There is a very well written tool for it. Its called Personnel Genome Constructor.

http://alleleseq.gersteinlab.org/tools.html

ADD COMMENT

Login before adding your answer.

Traffic: 2724 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6