Keep only reads where both map using BBTools
2
0
Entering edit mode
5.1 years ago

I have checked and can't seem to find a definitive answer on this. Is there way to generate a file containing only reads in which both pairs were mapped to the reference? According to the docs pairs are always kept together so if one maps but the other does not, both are placed in the mapped read file. Can this behavior be changed to only keep pairs that map together?

Thanks!

bbtools bbmap • 1.1k views
ADD COMMENT
2
Entering edit mode
5.1 years ago
GenoMax 141k

Since you asked about BBTools following should work.

reformat.sh in=your.bam out=new.bam pairedonly=t    

pairedonly=f            Toss reads that are not mapped as proper pairs. (default)

Additional option to note.

primaryonly=f           Toss secondary alignments.  Set this to true for sam to fastq conversion.
ADD COMMENT
1
Entering edit mode
5.1 years ago

Hi Dylan,

I wrote a tool, Matlock, for filtering read-pairs. It applies a set of filters to read-pairs rather than just on read at a time. It assumes the SAM/BAM/CRAM is read-pair sorted and no secondary or alternative alignments.

https://github.com/phasegenomics/matlock

ADD COMMENT

Login before adding your answer.

Traffic: 2555 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6