Entering edit mode
4.8 years ago
Sara
▴
260
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?
Follow the guide here: Generating consensus sequence from bam file
@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
orvt 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.