Entering edit mode
5.4 years ago
elb
▴
260
Hi guys, I know it could be an answer 1000 times redundant but I looked around without find a quick solution. I have 5 .bam files and a .gtf file that looks like this:
1 134202951 134202953 1 134202954 134203590 1 134199215 134203590
where 1 indicates chromosome 1 and the other two columns respectively start and end position of the chromosome region. I simply would like, for each start-end to have the number of counts. I tried using
overlap.counts1 <- countOverlaps(bedfile,bamfile1)
for a single file but it outputs the total number of counts not region per region. Can anyone help me please?
thank you in advance
There are several similar threads, maybe one of them has a suitable solution.
Counting Number Of Bam Reads Directly Within Set Of Intervals With Bedtools
How To Calculate The Coverage Of A Specific Interval Based On Data From A Bam File
how to get the coverage for the entire interval
Read depth interval comparison
Also see this function: calculateBamCoverageByInterval().