Hello, I am trying to filter a pairend bam file to get only forward reads in Galaxy. A bam filter from bamtools does not seem do exactly what I mean, in fact it seems that it filters both read 1 and read 2 but I would like to only have read 1 filtered in order to obtain only fragments mapped to forward strand. Could you please suggest a correct way to do this?
Try the tool NGS: BamTools > Filter BAM datasets on a variety of attributes. There is an option to filter on "isReverseStrand" that can be used as a negative, to then leave only forward stranded reads if "isMapped" is also set.
You can filter in more advanced ways: properly paired reads, first or second read in the pair, and strand - all in one query. This tutorial covers how: https://galaxyproject.org/tutorials/ngs/#flag-field
Thanks, Jen, Galaxy team