Identifies differentially expressed genes between two groups of cells using DESeq2
Usage
DESeq2Test(
sub_data,
min_gene_expressed,
min_valid_cells,
contrast = unique(sub_data$compare_group),
test = "Wald",
fitType = "parametric",
sfType = "ratio",
betaPrior = FALSE,
quiet = FALSE,
modelMatrixType = "standard",
minReplicatesForReplace = 7,
useT = FALSE,
minmu = 0.5,
parallel = FALSE,
BPPARAM = bpparam()
)Arguments
- sub_data
Count data removed cell_type and selected certain two compare_group
- min_gene_expressed
Genes expressed in minimum number of cells
- min_valid_cells
Minimum number of genes detected in the cell
- contrast
String vector specifying the contrast to be tested against the log2-fold-change threshold
- test
either "Wald" or "LRT", which will then use either Wald significance tests (defined by
nbinomWaldTest), or the likelihood ratio test on the difference in deviance between a full and reduced model formula (defined bynbinomLRT)- fitType
either "parametric", "local", or "mean" for the type of fitting of dispersions to the mean intensity. See
estimateDispersionsfor description.- sfType
either "ratio", "poscounts", or "iterate" for teh type of size factor estimation. See
estimateSizeFactorsfor description.- betaPrior
whether or not to put a zero-mean normal prior on the non-intercept coefficients See
nbinomWaldTestfor description of the calculation of the beta prior. In versions>=1.16, the default is set toFALSE, and shrunken LFCs are obtained afterwards usinglfcShrink.- quiet
whether to print messages at each step
- modelMatrixType
either "standard" or "expanded", which describe how the model matrix, X of the GLM formula is formed. "standard" is as created by
model.matrixusing the design formula. "expanded" includes an indicator variable for each level of factors in addition to an intercept. for more information see the Description ofnbinomWaldTest. betaPrior must be set to TRUE in order for expanded model matrices to be fit.- minReplicatesForReplace
the minimum number of replicates required in order to use
replaceOutlierson a sample. If there are samples with so many replicates, the model will be refit after these replacing outliers, flagged by Cook's distance. Set toInfin order to never replace outliers.- useT
logical, passed to
nbinomWaldTest, default is FALSE, where Wald statistics are assumed to follow a standard Normal- minmu
lower bound on the estimated count for fitting gene-wise dispersion and for use with
nbinomWaldTestandnbinomLRT- parallel
if FALSE, no parallelization. if TRUE, parallel execution using
BiocParallel, see next argumentBPPARAM. A note on running in parallel usingBiocParallel: it may be advantageous to remove large, unneeded objects from your current R environment before callingDESeq, as it is possible that R's internal garbage collection will copy these files while running on worker nodes.- BPPARAM
an optional parameter object passed internally to
bplapplywhenparallel=TRUE. If not specified, the parameters last registered withregisterwill be used.