
Wilcoxon Test for Differential Expression Analysis
gly_wilcox.RdPerform Wilcoxon rank-sum or signed-rank tests for glycomics or
glycoproteomics data.
P-values are adjusted for multiple testing using the method specified by p_adj_method.
Usage
gly_wilcox(
exp,
group_col = "group",
p_adj_method = "BH",
ref_group = NULL,
add_info = TRUE,
...,
subject_col = NULL,
log_transform = TRUE
)Arguments
- exp
A
glyexp::GlycomicSE()orglyexp::GlycoproteomicSE()object, or anotherSummarizedExperimentcontaining an expression matrix and sample information.- group_col
A character string specifying the column name of the grouping variable in the sample information. Default is
"group".- 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.- ref_group
A character string specifying the reference group. If NULL (default), the first level of the group factor is used as the reference.
- add_info
A logical value. If TRUE (default), variable information from the experiment will be added to the result tibble. If FALSE, only the statistical results are returned.
- ...
Additional arguments passed to
stats::wilcox.test().- subject_col
An optional character string naming the subject identifier column in sample information. When supplied, samples are matched by subject and a paired Wilcoxon signed-rank test is performed.
- log_transform
A single non-missing logical value. If
TRUE(default), transform expression values usinglog2(x + 1e-6)before analysis. IfFALSE, use the supplied values unchanged, for example for already log-transformed data.
Value
A list with three elements:
tidy_result: A tibble with Wilcoxon test results containing the following columns:variable: Variable namestatistic: Wilcoxon test statisticp_val: Raw p-value from Wilcoxon testeffect_size: Rank-biserial correlation, using matched pairs in paired analysesmethod: Statistical method usedalternative: Alternative hypothesisp_adj: Adjusted p-value (if p_adj_method is not NULL)log2fc: Log2 fold change (log2(group2_mean / group1_mean)) Additional columns from experiment metadata may be included if add_info = TRUE.
raw_result: A list ofwilcox.testmodel objectsmeta_data: A list containing metadata from the input experiment The list has classesglystats_wilcox_resandglystats_res.
Details
Tests and effect sizes use the selected analysis scale. Reported fold changes continue to use ratios of group means from the original supplied values.
By default, expression data are transformed using log2(x + 1e-6) before
statistical testing. Set log_transform = FALSE to skip this transformation.
Exactly 2 groups are required in the grouping variable.
In paired analyses, only subjects observed in both groups are used and
effect_size is the matched-pairs rank-biserial correlation.