This has been bugging me for awhile now. I know there are multiple mapping reads in my alignments, but bowtie2 does not assign the 256 flag for any of my reads. Bowtie2 says in the manual that is should be doing this:

> Each reported read or pair alignment beyond the first has the SAM
> ‘secondary’ bit (which equals 256) set in its FLAGS field.

But when I check for any secondary alignments: 

    $ samtools view -f 256 my_file.bam | wc -l
    0

There are apparently no secondary alignments.

**How do I know there actually are multiple mapping reads?** Well bowtie2 also uses the `XS:i:` field

> XS:i:<N> Alignment score for the best-scoring alignment found other
> than the alignment reported. Can be negative. Can be greater than 0 in
> --local mode (but not in --end-to-end mode). Only present if the SAM record is for an aligned read and more than one alignment was found
> for the read. Note that, when the read is part of a
> concordantly-aligned pair, this score could be greater than AS:i.

So, since `XS:i` is ***only*** present if more than one alignment was found for the read, let's check that:

    $ samtools view my_file.bam | grep "XS:i:" | wc -l
    42821156


Am I missing something here? There are clearly multiple alignments for a LOT of my reads, so why is there not a single alignment with 256 flag set?

Oops... I know what is happening now. Bowtie2, by default, only reports the best alignment. This is why I have zero secondary alignments in my bam file, despite having many "multi-mappers".

This information was in the **Reporting** section of the [bowtie2 manual][1]. I think the manual could be more clear... But I admit it's my fault for missing this before. In case anyone cares, you can use the `-k` option to report a given number of secondary alignments, or the `-a` option to report all alignments.


  [1]: http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml#reporting