structuralEnrichment | R Documentation |
Perform structural enrichment using over-representation analysis of explanatory m/z features from random forest.
structuralEnrichment(
x,
structural_classifications,
p_adjust_method = "bonferroni",
split = c("none", "trends"),
...
)
## S4 method for signature 'RandomForest,tbl_df'
structuralEnrichment(
x,
structural_classifications,
p_adjust_method = "bonferroni",
split = c("none", "trends"),
...
)
## S4 method for signature 'RandomForest,Construction'
structuralEnrichment(
x,
structural_classifications,
p_adjust_method = "bonferroni",
split = c("none", "trends"),
...
)
x |
an object of S4 class |
structural_classifications |
the structral classifications corresponding to the m/z features present in the object specified for argument |
p_adjust_method |
the p-value adjustment method. One of those returned from |
split |
split the explanatory features into further groups based on their trends. See details. |
... |
arguments to pass to |
Over-representation analysis is performed on the explanatory m/z features for each structural class within each experimental class comparison using the Fisher's Exact Test.
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 StructuralEnrichment
.
## Perform random forest on the example data
random_forest <- assigned_data %>%
metabolyseR::randomForest(
cls = 'class'
)
## Perform structural enrichment analysis using the example structural classifications
structuralEnrichment(
random_forest,
structural_classifications
)
## An example using split trends
## Perform random forest on the example data
random_forest <- assigned_data %>%
metabolyseR::randomForest(
cls = 'class',
binary = TRUE
)
## Perform structural enrichment analysis using the example structural classifications
structuralEnrichment(
random_forest,
structural_classifications,
split = 'trends'
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.