findRegions {derfinder} | R Documentation |
Find genomic regions for which a numeric vector is above (or below) predefined thresholds. In other words, this function finds the candidate Differentially Expressed Regions (candidate DERs). This is similar to regionFinder and is a helper function for calculatePvalues.
findRegions(position = NULL, fstats, chr, oneTable = TRUE, maxClusterGap = 300L, cutoff = quantile(fstats, 0.99, na.rm = TRUE), segmentIR = NULL, smooth = FALSE, weights = NULL, smoothFunction = bumphunter::locfitByCluster, ...)
position |
A logical Rle of genomic positions. This is generated in
loadCoverage. Note that it gets updated in preprocessCoverage
if |
fstats |
A numeric Rle with the F-statistics. Usually obtained using calculateStats. |
chr |
A single element character vector specifying the chromosome name. |
oneTable |
If |
maxClusterGap |
This determines the maximum gap between candidate DERs.
It should be greater than |
cutoff |
Threshold applied to the |
segmentIR |
An IRanges object with the genomic positions that are potentials DERs. This is used in calculatePvalues to speed up permutation calculations. |
smooth |
Whether to smooth the F-statistics ( |
weights |
Weights used by the smoother as described in smoother. |
smoothFunction |
A function to be used for smoothing the F-statistics.
Two functions are provided by the |
... |
Arguments passed to other methods and/or advanced arguments. Advanced arguments:
Passed to extendedMapSeqlevels and the internal function
When |
regionFinder adapted to Rle world.
Either a GRanges or a GRangesList as determined by oneTable
.
Each of them has the following metadata variables.
The mean of the values of y
for the given region.
The absolute value of the sum of the values of y
for
the given region.
The start position of the region in terms of the index
for y
.
The end position of the region in terms of the index for
y
.
The cluser ID.
The total length of the cluster.
Leonardo Collado-Torres
Rafael A. Irizarry, Martin Aryee, Hector Corrada Bravo, Kasper D. Hansen and Harris A. Jaffee. bumphunter: Bump Hunter. R package version 1.1.10.
## Preprocess the data prep <- preprocessCoverage(genomeData, cutoff=0, scalefac=32, chunksize=1e3, colsubset=NULL) ## Get the F statistics fstats <- genomeFstats ## Find the regions regs <- findRegions(prep$position, fstats, 'chr21', verbose=TRUE) regs ## Not run: ## Once you have the regions you can proceed to annotate them library('bumphunter') genes <- annotateTranscripts(TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene) annotation <- matchGenes(regs, genes) annotation ## End(Not run) # Find regions with smoothing the F-statistics by bumphunter::runmedByCluster regs_smooth <- findRegions(prep$position, fstats, 'chr21', verbose = TRUE, smoothFunction = bumphunter::runmedByCluster) ## Compare against the object regs obtained earlier regs_smooth