Calling haploid consensus sequence from vcf
1
0
Entering edit mode
5.0 years ago

Hi there,

I have a filtered VCF file of mtDNA genotypes for multiple individuals. The calls are haploid and therefore the genotype field in the VCF is either 0 or 1. I would like to call consensus fasta files for each individual. However, it is my understanding that tools like bcftools consensus, vcf-consensus and GATK's FastaAlternateReferenceMaker apply all ALT variants to the reference fasta to obtain the consensus.

How can I generate consensus sequencess where the the ALT allele is assigned if the GT field is 1 and the REF allele if the GT field is 0?

Thanks in advance.

vcf samtools bcftools consensus haploid • 2.0k views
ADD COMMENT
1
Entering edit mode
5.0 years ago

You may require 2 passes for each sample. First, split your VCF based on GTs of 0 (REFs) and GTs of 1 (ALTs), and then run bcftools consensus twice for each sample, making use of the following parameter:

-H, --haplotype <which>    choose which allele to use from the FORMAT/GT field, note
                           the codes are case-insensitive:
                           1: first allele from GT
                           2: second allele
                           R: REF allele in het genotypes
                           A: ALT allele
                           LR,LA: longer allele and REF/ALT if equal length
                           SR,SA: shorter allele and REF/ALT if equal length

Kevin

ADD COMMENT

Login before adding your answer.

Traffic: 3138 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