Closed HenrikBengtsson closed 6 years ago
Add a countsByRegion(data, region, margin) for TopDomData object that extracts the count data matrix for a given region plus a given margin. There region can be a TD row.
countsByRegion(data, region, margin)
region
Coceptually, it should look something like:
countsByRegion.TopDomData <- function(data, region, margin = 0) { bins <- with(data$bins, which(chr == region$chr & from.coord >= region$from.coord - margin & to.coord <= region$to.coord + margin)) data$counts[bins, bins, drop = FALSE] }
Add a
countsByRegion(data, region, margin)
for TopDomData object that extracts the count data matrix for a given region plus a given margin. Thereregion
can be a TD row.Coceptually, it should look something like: