View source: R/featureEnrich.R
featureEnrich | R Documentation |
Tests the enrichment of genomic features in supplied peaks. See details.
featureEnrich( object, annotype = c("primary", "full"), annotations = NULL, downsample = 10000, quiet = FALSE )
object |
An RLRanges object. |
annotype |
The type of annotations to use. Can be one of "primary" or "full". Default: "primary". See RLHub::annotations for greater detail. |
annotations |
A custom annotation list of the same structure described in RLHub::annotations. |
downsample |
If a numeric, data will be down sampled to the requested number of peaks. This improves the speed of genomic shuffling and helps prevent p-value inflation. If FALSE, then downsampling will not be performed. Default: 10000. |
quiet |
If TRUE, messages will be suppressed. Default: FALSE |
Annotations relevant to R-loops were curated as part of the RLBase-data workflow and are provided via RLHub::annotations.
In featureEnrich
, each annotation "type" (e.g., "Exons", "Introns", etc)
is compared to the supplied RLRanges, yielding enrichment statistics with
the following procedure:
For each annotation type, the peaks are overlapped with the annotations.
Then, valr::bed_reldist is used to find the relative distance distribution between the peaks and the annotations for both the supplied RLRanges and shuffled RLRanges (via valr::bed_shuffle). Significance of the relative distance is calculated via stats::ks.test.
Then, Fisher’s exact test is implemented via valr::bed_fisher to obtain the significance of the overlap and the odds ratio.
An RLRanges object containing the results of the enrichment test
accessed via rlresult(object, "featureEnrichment")
. The results
are in tbl
format. For a full description of all columns in the output
table see RLHub::feat_enrich_samples.
# Example RLRanges dataset rlr <- readRDS(system.file("extdata", "rlrsmall.rds", package = "RLSeq")) # RL Region Test featureEnrich(rlr) # With custom annotations small_anno <- list( "Centromeres" = readr::read_csv( system.file("extdata", "Centromeres.csv.gz", package = "RLSeq"), show_col_types = FALSE ) ) featureEnrich(rlr, annotations = small_anno)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.