biod / sambamba

Tools for working with SAM/BAM data
http://thebird.nl/blog/D_Dragon.html
GNU General Public License v2.0
563 stars 105 forks source link

Filtering out reads with not and 2 conditions #444

Closed paulstretenowich closed 3 years ago

paulstretenowich commented 4 years ago

Hi,

I'm trying to filter out from a bam file all the reads aligned to human and with a mapping quality above 30. To do so I wrote: sambamba view -f bam -F "not (ref_name =~ /chr*/ and mapping_quality >= 30)" file.bam. The not key word seems to apply to both ref_name AND mapping quality separately and not to the combination of both because when I try not (ref_name =~ /chr*/ and mapping_quality >= 0 I end up with no reads. Is there a way to have the not applied to the 2 conditions in the same time as I want to remove the reads mapped to chr* with a mapping quality greater than a threshold?

Thanks, Paul

pjotrp commented 3 years ago

No activity