Hi there,
I've been using this command to create consensus sequences for my BAM files, as suggested on the samtools sourceforge page:
It works fine and at first I was happy with the results.
Later on when I used the consensus sequence for further analysis, though, I started having problems because one read is enough for samtools to decide that a certain base or sequence is right.
What I would like to do is restrict the consensus creation to positions with a coverage of three or more reads (to start with), but there seems to be no option for that.
I tried using -l and a list of positions for which I know they have enough coverage, but got an "Use of uninitialized value in length" error. Could someone please tell me in which format my list of positions should be? I read somewhere it should be space delimited, but that doesn't seem to work. Or am I doing something else wrong?
I've been using this command to create consensus sequences for my BAM files, as suggested on the samtools sourceforge page:
Code:
samtools mpileup -uf ref.fa aln.bam | bcftools view -cg - | vcfutils.pl vcf2fq > cns.fq
Later on when I used the consensus sequence for further analysis, though, I started having problems because one read is enough for samtools to decide that a certain base or sequence is right.
What I would like to do is restrict the consensus creation to positions with a coverage of three or more reads (to start with), but there seems to be no option for that.
I tried using -l and a list of positions for which I know they have enough coverage, but got an "Use of uninitialized value in length" error. Could someone please tell me in which format my list of positions should be? I read somewhere it should be space delimited, but that doesn't seem to work. Or am I doing something else wrong?