I have a standard bam file produced by bowtie using -m 50. I'd like to have a report of the number of possible alignments for every read in the bam file - for example if the read maps to 5 locations or 20. I have specified that one mismatch is allowed, so this should be a discrete number. Googling this problem leads me to so many posts about just counting the number of reads in a bam file that I cannot figure out how to effectively google this problem. Any suggestions would be welcome.
I would say it comes down to counting the number of read names. In this below example I made a dummy alignment where one read gets aligned to three different chromosomes:
As bowtie only does ungapped alignments I think this very simple approach would be fine, there is no need to handle split reads etc because these (in my understanding) all are not supported by bowtie and the read would go unmapped.
Thank you, that worked!