Modifying A Gene Sequence With Personal Snps?
1
0
Entering edit mode
8.5 years ago

Given exome sequencing of a patient, along with a gene name, we'd like to create a fasta file of that gene's sequence, with the sequence modified to include their unique SNPs.

I could probably hack something together from variant calls and the reference fasta, but I feel like someone must have had to do this before. Haplotyping is obviously an issue here too, but I'd settle for something that used IUPAC bases (Y = C/T) and condensed it down to a haploid representation.

Anyone know of a tool that will let us do this easily?

fasta gene sequence snp reference • 2.3k views
2
Entering edit mode
0
Entering edit mode

I'd also like to have this ability, with both haplotypes reported (although i guess that's impossible without the VCF being phased) Some kind of tool that takes VCF + annotation and makes fasta?

2
Entering edit mode
8.5 years ago

As always, it turns out that there is more than one way to do this.

This question, pointed to by Pierre above, has a solution using the GATK FastaAlternateReferenceMaker that seems like it would work: Introducing known mutations (from a VCF) into a FASTA file

We ended up doing something more like this, where we create a bed file with the exons we're interested in, and pipe it through a few tools to create the needed output:

samtools mpileup -u -l exome.bed -f reference.fa aligment.bam | bcftools view -cg - | vcfutils vcf2fq > vhl_cds_consensus.fq


Thanks, all!