Hi,

I have one question, I need to get reads after filtration. Than normally I get health reads (health = reads after filtration, satisfy the conditions), but I need to get reads, which I remove.

For example I set filtration to get reads with mapQ bigger than 10, I used `samtools view -bg 10 ...` and I get reads with mapQ bigger than 10, but I want reads with mapq lower than ten.

Could you please help if it is possible. And other option, compare the raw bam file and filtrate bam file and get the difference between them.

Could you help me pls or do you know some tool to do this?
Just use awk or another scripting language, for example `samtools view foo.bam | awk '{if($5<10) print $0}'`. You can make that a bit more complicated if you want to keep the header (useful for piping back into samtools for conversion to a BAM file), but that's enough to give you the idea.

BTW, pysam is useful in general for more complicated tasks.