This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bbmap, mapq and uniquelly mapped reads filtering

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.

  1. Does for bbmap similar correspondence exists?
  2. If yes, what mapq threshold should be used to get only unique mappings?
  3. Is there any general method (no matter what aligner was used) to get only uniquelly mapped reads from sam file, for example using flags and samtools?
alignment mapq

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.