This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to get a consensus sequence for each sample in a vcf file using a reference sequence?

Good morning everyone.

I have a vcf file containing variants call for 1142 individuals. I also have a reference sequence downloaded from a data base. I wish to get the sequence corresponding to each individuals in one fasta file ( to be able to do a multilpe alignment), those sequence should include the alternative variant at each positions for each individuals.

So far, I tried using bcftools consensus and loop over all the sample name, but I get "Applied 0 variants" and no file written

code used

data=" aa1 aa2 aa3 aa4 aa5"

for sample in $data
do
        cat Anopheles_gambiae_ACE1_sequence.fa | bcftools consensus Aceee.recode.vcf.gz -s $sample > '$sample.fa'
done

Can you please help me troubleshoot it?

Thanks

vcf fasta sequence

0 answers

No answers yet.

Log in to answer this question.