Entering edit mode
3.6 years ago
Damon_Wan
•
0
I'm looking for the parameter of BWA mem or samtools to filter out the mapped reads contain N% mismatched bases in or after reads mapping to the reference genome.
However, I can't figure out how to combain the scoring parameters of BWA mem, nither find the filtering parameters of samtools view to deal with it.
Dose anyone could give some advises?
Thanks a lot!
This is the first time that I heard about this feature. Extremely useful.
Looks like it was introduced in samtools version 1.12 (March 2021)
https://github.com/samtools/samtools/releases/
for those with older versions of samtools:
Thanks!
But It seemed like the [NM] just counts the number of mismatched bases. How could I calculate the percentage of mismatched bases of each reads considering their length.
I simply tried
samtools view -e '[NM]/qlen < 0.05'
but I got errors[E::sam_passes_filter] Couldn't process filter expression
How to correct the filtering expression?