
Step: Correlation Analysis
step_correlation.RdPerform pairwise correlation analysis using glystats::gly_cor() and
visualize the correlation matrix using glyvis::plot_corrplot().
This step calculates correlation coefficients and p-values for all pairs
of variables or samples.
Arguments
- on
Name of the experiment to run correlation analysis on. Can be "exp", "sig_exp", "trait_exp", "sig_trait_exp", "motif_exp", "sig_motif_exp".
- on_cor
A character string specifying what to correlate. Either "variable" (default) to correlate variables/features, or "sample" to correlate samples.
- method
A character string indicating which correlation coefficient is to be computed. One of "pearson" (default) or "spearman".
- p_adj_method
A character string specifying the method to adjust p-values. See
p.adjust.methodsfor available methods. Default is "BH". If NULL, no adjustment is performed.- plot_width
Width of the plot in inches. Default is 7.
- plot_height
Height of the plot in inches. Default is 7.
- ...
Additional arguments passed to
glystats::gly_cor().
Details
Data required:
exp(ifon = "exp"): The experiment to run correlation analysis ontrait_exp(ifon = "trait_exp"): The trait experiment to run correlation analysis onmotif_exp(ifon = "motif_exp"): The motif experiment to run correlation analysis on
Tables generated (with suffixes):
correlation: A table containing pairwise correlation results with columns:variable1,variable2(orsample1,sample2ifon = "sample")cor: Correlation coefficientp_val: P-value from correlation testp_adj: Adjusted p-value (if p_adj_method is not NULL)
Plots generated (with suffixes):
correlation: A correlation matrix heatmap
AI Prompt
This section is for AI in inquire_blueprint() only.
Include this step to explore relationships between variables or samples.
Be careful to use when sample size or variable number is large (> 50). Before using this step for large data, ask the user if they want to proceed.
Examples
step_correlation()
#> <step "step_correlation()"> Correlation analysis
step_correlation(on = "sig_exp")
#> <step "step_correlation(on = \"sig_exp\")"> Correlation analysis of significant
#> variables
step_correlation(on_cor = "sample", method = "spearman")
#> <step "step_correlation(on_cor = \"sample\", method = \"spearman\")">
#> Correlation analysis