Creating consensus fasta using iupac codes

less than 1 minute read

Published:

Fasta files can be generated from vcf calls. There are two ways of doing that: (1) concatenate snips together (this can be done using either variants only or calling monomarphic (hom ref) variants as well and concatenating them too); (2) use reference genome as a backbone and incorporate variants into the reference. To incorporate information about heterozygotes, IUPAC substitution codes can be used. Here is a collection of scripts available:

Using fasta reference

  • the best and most convenient way: (allows to choose a sample from multiVCF and BED mask)
    bcftools consensus --iupac-codes --sample --mark
    
  • vcf2fasta.py - phased only
  • For GATK fans: FastaAlternateReferenceMaker.

No reference