Samtools can be used to select reads above certain mapping quality.
samtools view -h -b -q 30 aligned.bam -o above.mapQ30.bam
But, how to select a read below certain mapping quality - all aligned reads below mapQ 30?
I know it can be done using awk. But, the pipeline gets lengthy and time consuming when first need to convert bam to sam - separate header - use awk for mapQ below 30 - add header - sam file - convert to bam. Really, its taking a lots of time.
Thanks,
It may be possible to do this with one of the many programs from BBMap (perhaps reformat.sh). Brian Bushnell may be along later to provide that solution.