Hi,
I'd like to know, how do postalignment filtering to get only uniquelly mapped reads.
I know that it is possible at the bbmap level, i.e. during mapping.
I've read, that for aligners like BWA there are correspondence between mapq value and uniqueness of alignment.
- Does for
bbmapsimilar correspondence exists? - If yes, what mapq threshold should be used to get only unique mappings?
- Is there any general method (no matter what aligner was used) to get only uniquelly mapped reads from
samfile, for example using flags andsamtools?
1 answer
Many threads exist that show how to extract uniquely mapped reads. Here are a couple of examples:
Counting and extracting in a new file the unique mapped reads from BWA 0.7.15-r1140 mapping
How To Filter Mapped Reads With Samtools
Implementation of mapq values is not consistent. What is consistent is multi-mappers will have 0 or low values.
If you are using ambig= option with bbmap.sh to choose a random location
random (select one top-scoring site randomly)
then you are selecting a site randomly during mapping step itself.
Log in to answer this question.