VCF tab to FASTA Alignment Script

I’m not sure if anyone will find this useful, but I’m making available a tiny script I wrote to convert VCF tab files (output from VCFtoolsvcf-to-tab utility) to FASTA alignments. Essentially it just concatenates your SNPs. I found this useful as a quick sanity check when working with massive SNP datasets: I converted my VCF files to VCF tabular files, then used this script to make a quick FASTA alignment so I could generate a fast neighbor joining tree. The script is available on Google Code here:

VCF-tab-to-FASTA

Let me know if you ever use it!

  1. Hi! Nice script!

    Is there a way you clould also import a fasta file of the variants instead of the IUPAC notation for the allele?

    • Thanks, Norman! I’m not sure I’m following what you’re asking. The input would be SNPs in FASTA format, and what would the output be?

  2. Nice script!
    I noticed it generates a *.tab_clean file which deleted all the indels before convert to fasta. Is there a way to also include indels in the final output?
    Many thanks!

    Chuan

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>