Description Usage Arguments Value Author(s) Examples
Obtain normalization factors for sparse, undersampled count data that often arise with metagenomic count data.
1 2 
mat 
count matrix; rows are features and columns are samples 
condition 
a vector with group information on the samples 
etype 
weighting strategy with the following options:

ebcf 
TRUE if empirical bayes regularization of ratios needs to be performed. Default recommended. 
z.adj 
TRUE if the featurewise ratios need to be adjusted by hurdle probabilities (arises when taking marginal expectation). Default recommended. 
phi.adj 
TRUE if estimates need to be adjusted for variance terms (arises when considering positivepart expectations). Default recommended. 
detrend 
FALSE if any linear dependence between sampledepth and compositional factors needs to be removed. (setting this to TRUE reduces variation in compositional factors and can improve accuracy, but requires an extra assumption that no linear dependence between compositional factors and sample depth is present in samples). 
... 
other parameters 
a list
with components:
nf
, normalization factors for samples passed.
Samples with zero total counts are removed from output.
ccf
, compositional correction factors.
Samples with zero total counts are removed from output.
others
, a list
with results from intermediate computations.
qref
, reference chosen.
design
, design matrix used for computation of positivepart parameters.
s2
, featurewise variances of logged count data.
r
, (regularized) ratios of featurewise proportions.
radj
, adjustments made to the regularized ratios based
on z.adj and phi.adj settings.
M. Senthil Kumar
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29  #Obtain counts matrix and some group information
require(metagenomeSeq)
data(mouseData)
cntsMatrix < MRcounts(mouseData)
group < pData(mouseData)$diet
#Running wrench with defaults
W < wrench( cntsMatrix, condition=group )
compositionalFactors < W$ccf
normalizationFactors < W$nf
#Introducing the above normalization factors for the most
# commonly used tools is shown below.
#If using metagenomeSeq
normalizedObject < mouseData
normFactors(normalizedObject) < normalizationFactors
#If using edgeR, we must pass in the compositional factors
require(edgeR)
edgerobj < DGEList( counts=cntsMatrix,
group = as.matrix(group),
norm.factors=compositionalFactors )
#If using DESeq/DESeq2
require(DESeq2)
deseq.obj < DESeqDataSetFromMatrix(countData = cntsMatrix,
DataFrame(group),
~ group )
DESeq2::sizeFactors(deseq.obj) < normalizationFactors

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.