I am looking for an efficient/simple way for extracting genome coverage for each strand(+/- ) in a given range (for example 25-34) of read length. My input is sorted BAM file (Ribo-Seq data) and as a measure of coverage I would like to get 5' positions of each read.
I found bedtools genomecov
solves half of problem
bedtools genomecov -d -5 -ibam my_sorted.bam -strand + -g genome.fa > output_plus.txt
but I didn't found an option to do it on a base of read length. Is there some simple solution what can be apply on command line?
Hi Tom,
Splitting BAM file was one possible way to go. I had to change it a bit to get output in compressed BAM. Here is an example what worked for me to generate 27 nt bam.
I was wondering is there any options to do the same without creating additional intermediate files.