View source: R/mutate_p_value.R
mutate_p_value | R Documentation |
Calculate p values for variables.
mutate_p_value( object, control_sample_id, case_sample_id, method = c("t.test", "wilcox.test"), p_adjust_methods = c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none"), return_mass_dataset = TRUE, ... )
object |
tidymass-class object. |
control_sample_id |
A character vector. |
case_sample_id |
A character vector |
method |
t test or wilcox test. |
p_adjust_methods |
see ?p.adjust |
return_mass_dataset |
logical default TRUE |
... |
other parameters |
object with fold change in variable_info.
Xiaotao Shen shenxt1990@outlook.com
library(massdataset) library(magrittr) library(dplyr) data("liver_aging_pos") liver_aging_pos w_78 = liver_aging_pos %>% activate_mass_dataset(what = "sample_info") %>% dplyr::filter(group == "78W") %>% dplyr::pull(sample_id) w_24 = liver_aging_pos %>% activate_mass_dataset(what = "sample_info") %>% dplyr::filter(group == "24W") %>% dplyr::pull(sample_id) control_sample_id = w_24 case_sample_id = w_78 liver_aging_pos = mutate_p_value( object = liver_aging_pos, control_sample_id = control_sample_id, case_sample_id = case_sample_id, method = "t.test", p_adjust_methods = "BH" ) head(extract_variable_info(liver_aging_pos)) liver_aging_pos = mutate_p_value( object = liver_aging_pos, control_sample_id = control_sample_id, case_sample_id = case_sample_id, method = "wilcox.test", p_adjust_methods = "BH" ) head(extract_variable_info(liver_aging_pos)) extract_variable_info(liver_aging_pos) %>% ggplot(aes(-log(p_value_adjust, 10), -log(p_value_adjust.1, 10))) + geom_point()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.