knitr::opts_chunk$set(comment = NA, fig.path = '02_figures_aim1_f/', fig.width = 20, fig.height = 12, results = 'markup', tidy = FALSE, message = FALSE, warning = FALSE, echo = FALSE)
alpha <- 0.05
library(devtools) library(prettydoc)
# avoid 'objects' in workspace rm(list = ls()) setwd(Sys.getenv('HOME')) if(Sys.info()[["nodename"]] == 'mbp-de-csc.csc.es'){ load_all('~/Documents/git/chmitools') } else if(Sys.info()[["nodename"]] != 'mbp-de-csc.csc.es'){ load_all('~/git/chmitools') }
fold_change
load data
section.
* chmi.phen()
load data by group and aim, plus argument fold_change
.
# load data dat_f <- chmi.phen( study_chmi = 'antibodies', aim_ab_chmi = 'aim_1', fold_change = TRUE) # list n_igg <- sort(unique(dat_f$t_igg)) l_group <- c('t_igg', 'antigen_ag', 't2_point_ag') # list of adjust l_pval <- c('raw_pval', 'adjust_pval')
mfi
vs status_ag
in fold change
load data
section.
chmi.stat.oneway_test()
obtain raw and adjusted p-values.
filter data by t_igg
, antigen_ag
and t2_point_ag
columns.
we are used p.adjust()
function to adjust p-values by Benjamini & Hochberg
method.
tab_1 filtered by t2_point_ag
D7, D11_D13 & D28.
# p_value tab_fold_change tab_1 <- chmi.stat.oneway_test( phen = dat_f, l_group = l_group, t_var_1 = 'log10_rmfi', t_var_2 = 'status_ag', padj_method = 'BH', fold_change = TRUE) ## datatable `tab_1` datatable(tab_1, class = 'cell-border stripe', filter = 'top', extensions = c('Buttons', 'FixedColumns'), options = list(dom = 'Bfrtip', buttons = c('csv', 'copy'), pageLength = 10, scrollX = TRUE, text = 'Download')) %>% formatRound(l_pval, 5) # update y_max to plot `antigen_ag ~ t_igg` tab_1 <- tab_1 %>% mutate(p_ymax = as.numeric(y_max + 1.2))
log10_rmfi
vs status_ag
by fold_change# plots bp_1 <- chmi.stat_plot.pval_boxfold( phen = dat_f, pval_phen = tab_1, l_group = l_group[1:2], l_igg = n_igg, var_y = log10_rmfi, aes_color = status_ag) # print print(bp_1)
r_data
folder# save if(Sys.info()[["nodename"]] == 'mbp-de-csc.csc.es'){ save.image(file = '~/Documents/git/chmitools/projects/01_aim1/r_data/01_aim1_f.RData') } else if(Sys.info()[["nodename"]] != 'mbp-de-csc.csc.es'){ save.image(file = '~/git/chmitools/projects/01_aim1/r_data/01_aim1_f.RData') }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.