Entering edit mode
s1437643
▴
20
@s1437643-9524
Last seen 5.4 years ago
I have an IRanges object which contains regions of interest and read counts for a given sample in the metadata column. I would like to iterate through each of the regions and get the counts for regions which are within 1,000 bp of the current region. I have tried the following but It is too slow and I wondered if there were any faster alternatives?
for (i in 1:length(regions)) { iranges <- ranges(regions) range <- iranges[i] start <- start(range) - 1000 end <- end(range) + 1000 hits <- findOverlaps(IRanges(start=start, end=end), regions) }
You can try to have a look at
or