There may already be a recipe for this, so asking first before reinventing the wheel:
I would like to create a bed file where the score is the average mapQ from the reads of the input.bam
file. I think bedtools
or bedops
are the way to go:
http://bedtools.readthedocs.org/en/latest/content/tools/bamtobed.html
http://bedops.readthedocs.org/en/latest/content/reference/file-management/conversion/bam2bed.html
But I would like to be able to define a sliding window size and step for the windows, of say, size=1000 and step=200.
I also would like to generate the bam2bed information only from a list of regions in regions.bed
. E.g., something like:
mapq_sliding_windows --bam input.bam --wsize 1000 -wstep 200 --regions regions.bed > mapq_sliding_windows.bed
Anyone?