How can I extract the regions with a mapping quality below 30 from a bam file to a bed file ?
I am not looking to extract the reads themselves but I just would like to know the regions in the bam with low average (below 30) mapping quality.
edit: I know that bam2Bed can export all the reads from a bam file to a bed file and that it also outputs the mapping quality as the bed score record. What I don't is how to go from there to a bed file with all the areas that have an average mapping quality below 30 ( for every position in that regoin). Or how to get there from another starting point.
So I am looking to compute the average mapping quality per covered position (nucleotide in the reference ) and then find all the regions that have an average mapping quality lower than 30.