AnalyzeOrthoMCL {MAGNAMWAR} | R Documentation |
Main OrthoMCL Analysis
Description
Main function for analyzing the statistical association of OG (orthologous group) presence with phenotype data
Usage
AnalyzeOrthoMCL(mcl_data, pheno_data, model, species_name, resp = NULL,
fix2 = NULL, rndm1 = NULL, rndm2 = NULL, multi = 1, time = NULL,
event = NULL, time2 = NULL, startnum = 1, stopnum = "end",
output_dir = NULL, sig_digits = NULL, princ_coord = 0)
Arguments
mcl_data |
output of FormatAfterOrtho; a list of matrices; (1) a presence/absence matrix of taxa per OG, (2) a list of the specific protein ids within each OG |
pheno_data |
a data frame of phenotypic data with specific column names used to specify response variable as well as other fixed and random effects |
model |
linear model with gene presence as fixed effect (lm), linear mixed mffect models with gene presence as fixed effect and additional variables specified as: one random effect (lmeR1); two independent random effects (lmeR2ind); two random effects with rndm2 nested in rndm1 (lmeR2nest); or two independent random effects with one additional fixed effect (lmeF2), Wilcox Test with gene presence as fixed effect (wx), Survival Tests with support for multi core design: with two random effects (survmulti), and with two times as well as an additional fixed variable (survmulticensor) |
species_name |
Column name in pheno_data containing 4-letter species designations |
resp |
Column name in pheno_data containing response variable |
fix2 |
Column name in pheno_data containing second fixed effect |
rndm1 |
Column name in pheno_data containing first random variable |
rndm2 |
Column name in pheno_data containing second random variable |
multi |
(can only be used with survival tests) Number of cores |
time |
(can only be used with survival tests) Column name in pheno_data containing first time |
event |
(can only be used with survival tests) Column name in pheno_data containing event |
time2 |
(can only be used with survival tests) Column name in pheno_data containing second time |
startnum |
number of test to start on |
stopnum |
number of test to stop on |
output_dir |
(if using survival tests) directory where small output files will be placed before using SurvAppendMatrix. Must specify a directory if choosing to output small files, else only written as a matrix |
sig_digits |
amount of digits to display for p-values and means of data; default to NULL (no rounding) |
princ_coord |
the number of principle coordinates to be included in model as fixed effects (1, 2, or 3), if a decimal is specified, as many principal coordinates as are needed to account for that percentage of the variance will be included in the analysis |
Value
A matrix with the following columns: OG, p-values, Bonferroni corrected p-values, mean phenotype of OG-containing taxa, mean pheotype of OG-lacking taxa, taxa included in OG, taxa not included in OG
Examples
#Linear Model
## Not run:
mcl_mtrx <- AnalyzeOrthoMCL(after_ortho_format, pheno_data, 'lm',
'Treatment', resp='RespVar')
## End(Not run)
# the rest of the examples are not run for time's sake
#Linear Mixed Effect with one random effect
## Not run:
mcl_mtrx <- AnalyzeOrthoMCL(after_ortho_format, pheno_data, 'lmeR1',
'Treatment', resp='RespVar', rndm1='Experiment')
## End(Not run)
#Linear Mixed Effect with two independent random effects
## Not run:
mcl_mtrx <- AnalyzeOrthoMCL(after_ortho_format, pheno_data, 'lmeR2ind',
'Treatment', resp='RespVar', rndm1='Experiment', rndm2='Vial')
## End(Not run)
#Linear Mixed Effect with rndm2 nested in rndm1
## Not run:
mcl_mtrx <- AnalyzeOrthoMCL(after_ortho_format, pheno_data, 'lmeR2nest',
'Treatment', resp='RespVar', rndm1='Experiment', rndm2='Vial')
## End(Not run)
#Linear Mixed Effect with two independent random effects and one additional fixed effect
## Not run:
mcl_mtrx3 <- AnalyzeOrthoMCL(after_ortho_format, pheno_data, 'lmeF2',
'Treatment', resp='RespVar', fix2='Treatment', rndm1='Experiment', rndm2='Vial', princ_coord = 4)
## End(Not run)
#Wilcoxon Test
## Not run:
mcl_mtrx <- AnalyzeOrthoMCL(after_ortho_format, pheno_data, 'wx',
'Treatment', resp='RespVar')
## End(Not run)
# ~ 5 minutes
#Survival with two independent random effects, run on multiple cores
## Not run:
mcl_mtrx <- AnalyzeOrthoMCL(after_ortho_format, starv_pheno_data, 'TRT', model='survmulti',
time='t2', event='event', rndm1='EXP', rndm2='VIAL', multi=1)
## End(Not run)
# ~ 5 minutes
#Survival with two independent random effects and one additional fixed effect,
#including drops on multi cores
## Not run:
mcl_mtrx <- AnalyzeOrthoMCL(after_ortho_format, starv_pheno_data, 'TRT', model='survmulticensor',
time='t1', time2='t2', event='event', rndm1='EXP', rndm2='VIAL', fix2='BACLO', multi=1)
## End(Not run)
#to be appended with SurvAppendMatrix