I'm currently trying to get truly unique aligning paired-end reads in bowtie2, setting
-k 1 doesn't help in this case as it just reports the first alignment for each read - but I don't want reads that align more than one time.
It looks like SAM's
NH:1:X-flag is for this, where X is the number of times the read aligns - however, bowtie2 does not seem to set that flag (and I can't find a setting to convince bowtie2 to do so).
My current "solution" is to iterate through the sam/bam-file and discard all IDs that are listed more than two times (once for each element of the pair), however, that's a bit slow as I have to go through the file twice and I have bam-files in the order of several hundred gigabytes.
Is there a better solution?