
Filter Significant Variables
filter_sig_vars.RdFiltering the experiment to keep only significant variables is a common task.
This function provides a convenient way to do this.
It supports results from all glystats DEA functions including
gly_anova(), gly_kruskal(), gly_ttest(), gly_wilcox(), and gly_limma().
Usage
filter_sig_vars(
exp,
res,
p_adj_cutoff = 0.05,
p_val_cutoff = NULL,
fc_cutoff = NULL,
...
)
# S3 method for class 'glystats_anova_res'
filter_sig_vars(
exp,
res,
p_adj_cutoff = 0.05,
p_val_cutoff = NULL,
fc_cutoff = NULL,
on = "main_test",
comparison = NULL,
...
)
# S3 method for class 'glystats_kruskal_res'
filter_sig_vars(
exp,
res,
p_adj_cutoff = 0.05,
p_val_cutoff = NULL,
fc_cutoff = NULL,
on = "main_test",
comparison = NULL,
...
)
# S3 method for class 'glystats_ttest_res'
filter_sig_vars(
exp,
res,
p_adj_cutoff = 0.05,
p_val_cutoff = NULL,
fc_cutoff = NULL,
...
)
# S3 method for class 'glystats_wilcox_res'
filter_sig_vars(
exp,
res,
p_adj_cutoff = 0.05,
p_val_cutoff = NULL,
fc_cutoff = NULL,
...
)
# S3 method for class 'glystats_limma_res'
filter_sig_vars(
exp,
res,
p_adj_cutoff = 0.05,
p_val_cutoff = NULL,
fc_cutoff = NULL,
comparison = NULL,
...
)Arguments
- exp
- res
A glystats result object from a glystats DEA function.
- p_adj_cutoff
The threshold for p-adjusted values. Default is 0.05.
- p_val_cutoff
The threshold for p-values. We don't recommend using this. Default is NULL. If you insist to use it, please set
p_adj_cutoffto NULL.- fc_cutoff
The threshold for fold changes. Default is NULL. Only positive value is needed. For example,
2means fold change > 2 or < 1/2.- ...
Additional arguments passed to methods. See the method-specific documentation for details.
- on
(For
gly_anova()andgly_kruskal()results only) "main_test" or "post_hoc_test". Should the filter be applied on the main test results or the post-hoc test results? Default is "main_test". If "post_hoc_test", please set acomparisonvalue.- comparison
(For
gly_anova(),gly_kruskal(), andgly_limma()results only) Specifies which comparison to filter on. A string with the format "group1_vs_group2". Forgly_anova()andgly_kruskal()results,comparisonis only used whenonis "post_hoc_test".
Value
An new glyexp::experiment() object.
Examples
library(glyexp)
library(glyclean)
#>
#> Attaching package: ‘glyclean’
#> The following object is masked from ‘package:stats’:
#>
#> aggregate
exp <- auto_clean(real_experiment) |>
glyexp::slice_head_var(n = 10)
#> ℹ Normalizing data (Median)
#> ✔ Normalizing data (Median) [235ms]
#>
#> ℹ Removing variables with >50% missing values
#> ✔ Removing variables with >50% missing values [81ms]
#>
#> ℹ Imputing missing values
#> ℹ Sample size <= 30, using sample minimum imputation
#> ℹ Imputing missing values
#> ✔ Imputing missing values [25ms]
#>
#> ℹ Aggregating data
#> ✔ Aggregating data [951ms]
#>
#> ℹ Normalizing data again
#> ✔ Normalizing data again [21ms]
#>
res <- gly_anova(exp)
#> ℹ Number of groups: 4
#> ℹ Groups: "H", "M", "Y", and "C"
#> ℹ Pairwise comparisons will be performed, with levels coming first as reference groups.
sig_exp <- filter_sig_vars(exp, res)