Dear all,
Previously I thought when the -g/--max-multihits
option in tophat was set to 1, then I acquired the unique mapped reads. However, after careful thinking, I am probably wrong.
Now my idea is: when doing mapping, set the -g/--max-multihits
option to 2 or above 2, and then write a script to eliminate those reads occurring twice or more times. Am I right? Are there any tools or simple approach to obtain unique mapped reads? I appreciate any of your comments and answers. THANKS A LOT!
Using BBMap, you can set the flag "ambig=toss" which will ensure all mapped reads have unique mappings. Reads that multimap will instead be marked as unmapped (and discarded, if you use "outm" instead of "out").
You can fgrep all the reads with tag NH:i:1, which filter outs only unique mapped reads.
sam/bam | fgrep -w NH:i:1