mod_env: Function to calculate module eigen vectors and correlate...

Description Usage Arguments Details Value Author(s) References Examples

Description

This function calculates module eigen vectors and then allows for correlation against environmental variables.

Usage

1
2
mod_env(omicsData, modData, envVars, pca.method = "svd",
  cor.method = "spearman", use = "pairwise", padjust = "BH")

Arguments

omicsData

An object of the class 'seqData' usually created by as.seqData. omicsData$f_data must contain environmental variables to compare against.

modData

An object of class 'modData', created by detect_modules, if want to colour by modules.

envVars

A character vector with the names of the environmental variables to compare against. Must all be column names in omicsData$f_data. If NULL, will not run correlation with environmental variables, but will still calculate pca for modules.

pca.method

A string specifying the pca method to use. Default is 'svd'. Other options include 'nipals', 'rnipals', 'bpca', 'ppca', 'svdImpute', 'robusePca', 'nlpca', 'llsImpute', and 'llsImputeAll'.

cor.method

A string specifying the correlation method to use. Default is 'spearman', which is nonparametric and doesn't make any assumptions about the data. Other options include 'kendall' and 'pearson'. 'Pearson' assumes normality - check assumptions and make any necessary transformations before using.

use

A string specifying either 'pairwise' or 'complete'. 'pairwise' does pairwise deletion of cases and 'complete' selects just the complete cases. Default is 'pairwise'.

padjust

A string specifying which adjustment for multiple test should be used. Default is 'BH'. Options are 'holm', 'hochberg', 'hommel', 'bonferroni', 'BH', 'BY', 'fdr', and 'none'.

Details

A network graph is created for the network(s) that were generated.

Value

A list (or list of lists, if running in groups) containing pca - the pca values for every module and corr - the correlation values for every pca/module against environmental variables.

Author(s)

Allison Thompson

References

corr.test from psych: Revelle, W. (2017) psych: Procedures for Personality and Psychological Research, Northwestern University, Evanston, Illinois, USA, https://CRAN.R-project.org/package=psych Version = 1.7.8. ; pca from pcaMethods: Stacklies, W., Redestig, H., Scholz, M., Walther, D. and Selbig, J. pcaMethods – a Bioconductor package providing PCA methods for incomplete data. Bioinformatics, 2007, 23, 1164-1167

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
library(mintJansson)
data(rRNA_data)
mynetwork <- network_calc(omicsData = rRNA_data)
mygraph <- pmartRseq_igraph(netData = mynetwork, coeff=0.6, pval=NULL, qval=0.05)
mymods <- detect_modules(netGraph = mygraph)
myeigen <- mod_eigen(omicsData = rRNA_data, modData=mymods, envVars=c("MBC","MBN","SOC"), method="spearman", use="pairwise", padjust="BH")
myeigen

## End(Not run)

pmartR/pmartRseq documentation built on May 25, 2019, 9:20 a.m.