Entering edit mode
2.1 years ago
Paulina
•
0
I am looping over a GRangesList but it takes ages to process. Can anyone help me optimize the code please?
groupMat <- lapply(1:length(subCvgList), function(f) {
grCluster = subCvgList[f]
lapply(1:length(regionTiles), function(x) {
idx <- findOverlaps(allRegionTilesGR[x], grCluster)
sum(grCluster$score[subjectHits(idx)])
})
}) %>% do.call(cbind, .)
Please describe what you're doing. Add example data.