View source: R/Visualizations_SDA.R
screen_components_by_metadata | R Documentation |
This function systematically analyzes all components in a score matrix, testing their differences across a specified metadata feature. Components are ranked by statistical significance.
screen_components_by_metadata(
scores_matrix,
meta_df,
meta_feature,
top_n = 5,
method = "auto"
)
scores_matrix |
A numeric matrix where rows are samples and columns are components. |
meta_df |
A data frame with rownames matching 'scores_matrix', containing metadata. |
meta_feature |
Character. The metadata column to group by (e.g., '"seqrun"'). |
top_n |
Integer. Number of top components to visualize (default: 5). |
method |
Character. Statistical test to use ('"anova"' for normal data, '"kruskal"' for non-parametric, default: '"auto"'). |
A list with:
ranked_results |
A dataframe ranking components by significance (p-values & effect sizes). |
plots |
A list of ggplot objects for top components. |
## Not run:
screen_results <- screen_components_by_metadata(scores_matrix = results$scores,
meta_df = MetaDF,
meta_feature = "seqrun")
print(screen_results$ranked_results) # Ranked table of components
screen_results$plots[[1]] # View first plot
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.