This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How can I isolate a particular DNA nucleotide from an SNP VCF file by specifying a GRCh37 location?

I have a VCF file that contains SNP differences compared to GRCh37. How can I extract a particular nucleotide at a specific location (or sequence such as the codon), specifying location(s)?

As an example I was thinking I could use bcftools view snp.vcf.gz 12:525-525, but since my VCF file only contains variations, if there is no variation, I often get an empty result. Maybe this requires a short script where if there is no variation, the result returned comes from the reference genome. Would that be a good way of doing this, and if so, how could I pull the data from the reference gnome? Thank you in advance

genomics

1 answer

it's not clear to me . Are you looking at something like https://gatk.broadinstitute.org/hc/en-us/articles/360037594571-FastaAlternateReferenceMaker ?

For example. Is there a tool where I can specify something like, “ command snp.vcf.gz 12:525-527” and the output could be a codon such as “ATA”

I think the FastAlternateReferenceMaker tool is exactly what I am looking for-thank you!

Log in to answer this question.