This is a test version of Biostars. For the public version, visit https://www.biostars.org.
create consensus sequence from bam file

I have made a subset of bam file and want to make consensus sequence from that. do you know how to convert a bam file into a fasta or fastq file with consensus sequence?

alignment

@genomax: I used that link before. but the problem is that in the vcf file I have both indels and SNPs and at some points they have overlap. in those regions program skips the indels (which is what I am interested in). do you have any solution for that

Split your VCF file by sample and then normalize it with a reference genome (bcftools norm or vt decompose+vt norm). A sample cannot have both an indel and an SNP at the same location.

Note: If you're using vt, decompose first, then split by sample and normalize at the end.

EDIT: A sample can have an indel and an SNP at the same location, given they're both heterozygous and on different chromosomes. I'm not sure how that would translate to a consensus sequence.

0 answers

No answers yet.

Log in to answer this question.