Hi All,
I try to get consensus sequence of a given region from bam file. here is the command I tried
samtools view -bh 1744.4.1589.sorted.bam chromosome_1:1,000,000-1,010,000 | samtools mpileup -uf ref.fa - | bcftools view -cg - | vcfutils.pl vcf2fq > xcns.fq
However, this command gives me all the sequences from chromosome starting site to 1,010,000 and outputs 'N' for sites < 1,000,000. Anybody know how to get only consensus sequence from a given region?
Thanks,
I try to get consensus sequence of a given region from bam file. here is the command I tried
samtools view -bh 1744.4.1589.sorted.bam chromosome_1:1,000,000-1,010,000 | samtools mpileup -uf ref.fa - | bcftools view -cg - | vcfutils.pl vcf2fq > xcns.fq
However, this command gives me all the sequences from chromosome starting site to 1,010,000 and outputs 'N' for sites < 1,000,000. Anybody know how to get only consensus sequence from a given region?
Thanks,