Extract Top Contributing Features for Factors
Source:R/extract_top_factor_features.R
extract_top_factor_features.Rd
Identifies the most influential features for specified factors using MOFA+ or MCIA integration results. Features are selected based on either a percentile cutoff or an absolute loading threshold.
Usage
extract_top_factor_features(
expomicset,
factors = NULL,
pval_col = "p_adjust",
pval_thresh = 0.05,
method = "percentile",
percentile = 0.9,
threshold = 0.3,
action = "add"
)
Arguments
- expomicset
A
MultiAssayExperiment
object containing integration results.- factors
A character vector specifying the factors of interest.
- method
A character string specifying the feature selection method (
"percentile"
or"threshold"
). Default is"percentile"
.- percentile
A numeric value between 0 and 1 indicating the percentile threshold for feature selection when
method = "percentile"
. Default is0.9
.- threshold
A numeric value specifying the absolute loading cutoff for feature selection when
method = "threshold"
. Default is0.3
.- action
A character string indicating whether to return results (
"get"
) or add them to metadata ("add"
). Default is"add"
.
Value
If action = "add"
, returns the modified expomicset
with selected features stored in metadata.
If action = "get"
, returns a data frame containing:
- feature
The selected feature contributing to the factor.
- factor
The factor to which the feature contributes.
- loading
The factor loading value of the feature.
- exp_name
The experiment from which the feature originated.
Details
The function extracts factor loadings from metadata(expomicset)
, applies filtering based on
the selected method, and identifies top contributing features for each specified factor.
Features can be selected using:
Percentile-based filtering (
method = "percentile"
): Selects features with absolute loadings above a specified percentile.Threshold-based filtering (
method = "threshold"
): Selects features with absolute loadings exceeding a fixed value.
Examples
if (FALSE) { # \dontrun{
results <- extract_top_factor_features(
expomicset = expom,
factors = c("Factor1", "Factor2"),
method = "percentile",
percentile = 0.9,
action = "get"
)
} # }