Hi all,
I have a bam file created from illumina alignments with bwa. When I try to get the number of aligned reads 2 different ways I get 2 different numbers...
When I run flagstat:
samtools flagstat myBam.bam
I get this many mapped reads
41721001 mapped (93.82%)
However when I try to get this on my own with this command:
samtools view myBam.bam | awk -F '\t' '($3 != "*")' | wc -l
I get this number
42283661
I'm sure I'm doing something wrong, but not sure what. Is it incorrect to think that all reads with a non '*' listed in the third column should be considered aligned?
thanks for the help!
I have a bam file created from illumina alignments with bwa. When I try to get the number of aligned reads 2 different ways I get 2 different numbers...
When I run flagstat:
samtools flagstat myBam.bam
I get this many mapped reads
41721001 mapped (93.82%)
However when I try to get this on my own with this command:
samtools view myBam.bam | awk -F '\t' '($3 != "*")' | wc -l
I get this number
42283661
I'm sure I'm doing something wrong, but not sure what. Is it incorrect to think that all reads with a non '*' listed in the third column should be considered aligned?
thanks for the help!
Comment