Question: Uniquely mapped PAIRS of reads
0
gravatar for abascalfederico
4.5 years ago by
abascalfederico1.1k
Spain
abascalfederico1.1k wrote:

Hi,

For a PE-reads BAM file, I would like to keep only those pairs that map to a unique location. I know I can filter reads with multiple mappings with samtools ("-bq 1"), but this doesn't take into account paired information. I mean, if mate #1 maps uniquely to locus A, and mate #2 maps both to A and B, then we should be confident that #2 maps to A. Using samtools -bq 1 removes mate #2 in this case but I would like to keep it (because of the uniqueness of mate #1). Any idea how to solve this?

Thanks! Federico

ADD COMMENTlink modified 4.5 years ago by Devon Ryan97k • written 4.5 years ago by abascalfederico1.1k
2
gravatar for Devon Ryan
4.5 years ago by
Devon Ryan97k
Freiburg, Germany
Devon Ryan97k wrote:

-bq 1 will not always remove multimappers, that they have a MAPQ of 0 is aligner dependent. As an example, a MAPQ of 1 can happen with multimappers produced by bowtie2.

Anyway, if you have a name-sorted file then you can write a little script with pysam to go through and filter things to whatever definition of "unique" you'd like to use.

ADD COMMENTlink modified 4.5 years ago • written 4.5 years ago by Devon Ryan97k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1263 users visited in the last hour