getFeatureCountsBig: Get counts of annotation within a defined window around each...

Description Usage Arguments Value See Also Examples

View source: R/hiAnnotator.R

Description

Given a query object and window size(s), the function finds all the rows in subject which are <= window size/2 distance away. Note that here counting is done using midpoint of the ranges in query instead of start-stop boundaries. The counts will differ slightly when compared to getFeatureCounts.

Usage

1
2
3
4
5
6
getFeatureCountsBig(
  sites.rd,
  features.rd,
  colnam = NULL,
  widths = c(1000, 10000, 1e+06)
)

Arguments

sites.rd

GRanges object to be used as the query.

features.rd

GRanges object to be used as the subject or the annotation table.

colnam

column name to be added to sites.rd for the newly calculated annotation...serves as a prefix to windows sizes!

widths

a named/numeric vector of window sizes to be used for casting a net around each position. Default: c(1000,10000,1000000)

Value

a GRanges object with new annotation columns appended at the end of sites.rd. There will be a column for each width defined in widths parameter. If widths was a named vector i.e. c("100bp"=100,"1K"=1000), then the colname parameter will be pasted together with width name else default name will be generated by the function.

See Also

makeGRanges, getNearestFeature, getSitesInFeature, getFeatureCounts.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Convert a dataframe to GRanges object
data(sites)
alldata.rd <- makeGRanges(sites, soloStart = TRUE)

data(genes)
genes.rd <- makeGRanges(genes)

geneCounts1 <- getFeatureCounts(alldata.rd, genes.rd, "NumOfGene")
## Not run: 
geneCounts2 <- getFeatureCountsBig(alldata.rd, genes.rd, "NumOfGene")
identical(geneCounts1, geneCounts2)

## End(Not run)

malnirav/hiAnnotator documentation built on July 29, 2021, 6:32 a.m.