biod / sambamba

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

Feature request: absolute value operator in filter statements #415

Closed tzuni closed 3 years ago

tzuni commented 4 years ago

I'm trying to separate reads by the observed template size (for ATACseq data). Since the template size is given a sign depending on the orientation of each read, it makes it hard to use a simple one step comparison to the desired length. It would be great to be able to use something like this as a filter:

sambamba view -F "abs(template_size) > 100" ex.bam

Just putting it out there in case it's an easy add for anyone.

Thanks for the great tool!

pjotrp commented 4 years ago

Hi @tzuni, feel free to send a patch.