Deal all,
How do I get a regional consensus sequence, say ch01: 77295611-77295961, from a BAM file by Samtools?
I extracted bam file for this region: ch01: 77295611-77295961 (region.bam) from all_aln.bam and used the recommanded command:
samtools mpileup -uf ref.fa region.bam | bcftools view -cg - | vcfutils.pl vcf2fq > cns.fq
However, the cns.fq seems contain sequence for the whole reference (took longer time), not just the region ch01: 77295611-77295961.
How to fix this?
Thanks.
Jeff
How do I get a regional consensus sequence, say ch01: 77295611-77295961, from a BAM file by Samtools?
I extracted bam file for this region: ch01: 77295611-77295961 (region.bam) from all_aln.bam and used the recommanded command:
samtools mpileup -uf ref.fa region.bam | bcftools view -cg - | vcfutils.pl vcf2fq > cns.fq
However, the cns.fq seems contain sequence for the whole reference (took longer time), not just the region ch01: 77295611-77295961.
How to fix this?
Thanks.
Jeff
Comment