I would like to have a list of regions that are in the top X% coverage in a bam file, centered at the peak of coverage for a window of size W. For example, something like:
~/find_top_X_perc -perc 10 -window 250 file.bam
That will produce a list of regions ready to be used on samtools tview:
1:1000000-1000250 2:2000250-2000300 [...]
Any suggestions?
This is neat - declarative rather than imperative programming - I need to learn the NGS packages for R
you could actually combine lines 3-9 into one line but it would be unreadable