Entering edit mode
2.2 years ago
Ruoshui
•
0
Hi,
I have a bam file and want to filter it by CIGAR string. I want to keep the lines that have a match larger than 100. For example, the CIGAR string is 20S80M12S, then I want to discard this sequence.
How should use samtools to do this?
I'm currently using
./samtools view -h -e '$6 =~ "(^|[^0-9])([1-9][0-9]{2,}|[1-9][0-9]{3,})M[^0-9]"' -o D1.sorted.dup.filt.bam D1.sorted.dup.bam
But this doesn't work, what should I do?