Ill add that samtools flagstat also only counts alignments and not reads. If you want to count the number of reads in the output you can do so like this:

samtools view (bamfile) | cut -f1 | sort | uniq | wc -l

On Jul 7, 2014 8:08 AM, "Bob Harris" <rsharris@bx.psu.edu> wrote:
How do you explain the aligner BWASW can generate new reads?

The aligner reports alignments. So your second and third sentences should be "The number of alignments reported by BWASW is higher than the number of reads in the original BAM. On average there are 1.12 alignments for each read."

I'm not that familiar with bwa sw and what it reports for reads that have many suitable alignments.  It could be that it is reporting chimeric alignments (for reads that align to the reference in pieces), or it could be reporting several alignments for a read when it can't choose which is optimal.  These cases should be indicated by bits in the flag field (see SAM spec).

Bob H

On Jul 7, 2014, at 10:33 AM, LE BECHEC Antony wrote (in part):
The number of reads from BWASW aligned BAM (81635) is higher than the number of reads from the NOT aligned BAM (72578). So, the percentage of aligned reads is 112%!!!
The number of reads from BWAMEM aligned BAM (72059) is “logically” lower than for NOT aligned BAM (72578, again), 99%.
How do you explain the aligner BWASW can generate new reads?

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Bio-bwa-help mailing list
Bio-bwa-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bio-bwa-help