I'm currently trying to use the samtools filtering expression as follows : samtools view exemple.bam --input-fmt -filter="mapq >= 60" > tested.sam
Unfortunately, this doesn't seem to work properly as my output sam still contains alignments with mapq < 60. I think my use of this filtering option is wrong. But I thought this could work according to the following documentation : http://www.htslib.org/doc/samtools.html#FILTER_EXPRESSIONS However I couldn't find any exemple of a proper use of this method.
My ultimate goal being to achieve something like this : samtools view -h input.bam --input-fmt-option "filter=mapq >= 5 && [MM]/qlen > 0.3 && [NM]/[MM] > 0.3" > output.sam
Thanks for the help.