functionalEnrichment | R Documentation |
Perform functional enrichment analyses of explanatory features using the FELLA R package.
functionalEnrichment(
x,
organism,
methods = availableMethods(),
split = c("none", "trends"),
organism_data = organismData(organism),
adduct_rules_table = adduct_rules(),
...
)
## S4 method for signature 'RandomForest'
functionalEnrichment(
x,
organism,
methods = availableMethods(),
split = c("none", "trends"),
organism_data = organismData(organism),
adduct_rules_table = adduct_rules(),
...
)
x |
object of S4 class |
organism |
the KEGG code for the organism of interest |
methods |
the enrichment techniques to build. Any returned by |
split |
split the explanatory features into further groups based on their trends. See details. |
organism_data |
an object of S4 class |
adduct_rules_table |
the adduct ionisation rules for matching m/z features to KEGG compounds.
Format should be as returned from |
... |
arguments to pass to |
For argument split = 'trends'
, the explanatory features can be split into further groups
based on their trends. This is not supported for unsupervised random forest.
For random forest classification, this is for binary comparisons only. Functional enrichment
is performed seperately on the up and down regulated explanatory features for each comparison. The
up regulated
and down regulated
groups are based on the trends of log2 ratios between
the comparison classes. up regulated
explanatory features have a higher median intensity
in the right-hand class compared to the left-hand class of the comparison. The opposite is true
for the down regulated
explanatory features.
For random forest regression, the explanatory features are split based on their Spearman's
correlation coefficient with the response variable prior to functional enrichment analysis
giving positively correlated
and negatively correlated
subgroups.
An object of S4 class FunctionalEnrichment
.
## Perform random forest on the example data
random_forest <- assigned_data %>%
metabolyseR::randomForest(
cls = 'class'
)
## Perform functional enrichment analysis
functionalEnrichment(
random_forest,
'bdi',
methods = 'hypergeom',
organism_data = organismData(
'bdi',
database_directory = system.file(
'bdi',
package = 'riches'),
internal_directory = FALSE
)
)
## An example using split trends
## Perform binary random forest classification on the example data
random_forest <- assigned_data %>%
metabolyseR::randomForest(
cls = 'class',
binary = TRUE
)
## Perform functional enrichment analysis
functionalEnrichment(
random_forest,
'bdi',
methods = 'hypergeom',
split = 'trends',
organism_data = organismData(
'bdi',
database_directory = system.file(
'bdi',
package = 'riches'),
internal_directory = FALSE
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.