doAnnotation {hiAnnotator} | R Documentation |
This is a wrapper function which calls one of following functions depending
on annotType parameter: getFeatureCounts
,
getFeatureCountsBig
, getNearestFeature
,
get2NearestFeature
, getSitesInFeature
doAnnotation( annotType = NULL, ..., postProcessFun = NULL, postProcessFunArgs = list() )
annotType |
one of following: within, nearest, twoNearest, counts, countsBig. |
... |
Additional parameters to be passed to the respective annotation function. |
postProcessFun |
function to call on the resulting object for any post processing steps. |
postProcessFunArgs |
additional arguments for postProcessFun as a list. |
a GRanges object with new annotation columns appended at the end of sites.rd.
makeGRanges
, getFeatureCounts
,
getFeatureCountsBig
, getNearestFeature
,
get2NearestFeature
, getSitesInFeature
.
# Convert a dataframe to GRanges object data(sites) alldata.rd <- makeGRanges(sites, soloStart = TRUE) data(genes) genes.rd <- makeGRanges(genes) doAnnotation(annotType = "within", alldata.rd, genes.rd, "InGene", asBool = TRUE) ## Not run: doAnnotation(annotType = "counts", alldata.rd, genes.rd, "NumOfGene") doAnnotation(annotType = "nearest", alldata.rd, genes.rd, "NearestGene") doAnnotation(annotType = "countsBig", alldata.rd, genes.rd, "ChipSeqCounts") geneCheck <- function(x,wanted) { x$isWantedGene <- x$InGene %in% wanted; return(x) } doAnnotation(annotType = "within", alldata.rd, genes.rd, "InGene", postProcessFun = geneCheck, postProcessFunArgs = list("wanted" = c("FOXJ3", "SEPT9", "RPTOR")) ) ## End(Not run)