Pairwise {grandR} | R Documentation |
Log2 fold changes and Wald tests for differential expression
Description
This function is a shortcut for first calling PairwiseDESeq2 and then LFC.
Usage
Pairwise(
data,
name.prefix = mode,
contrasts,
LFC.fun = lfc::PsiLFC,
slot = "count",
mode = "total",
normalization = mode,
genes = NULL,
verbose = FALSE
)
Arguments
data |
the grandR object |
name.prefix |
the prefix for the new analysis name; a dot and the column names of the contrast matrix are appended; can be NULL (then only the contrast matrix names are used) |
contrasts |
contrast matrix that defines all pairwise comparisons, generated using GetContrasts |
LFC.fun |
function to compute log fold changes (default: PsiLFC, other viable option: NormLFC) |
slot |
the slot of the grandR object to take the data from; should contain counts! |
mode |
compute LFCs for "total", "new", or "old" RNA |
normalization |
normalize on "total", "new", or "old" (see details) |
genes |
restrict analysis to these genes; NULL means all genes |
verbose |
print status messages? |
Details
Both PsiLFC and NormLFC) by default perform normalization by subtracting the median log2 fold change from all log2 fold changes. When computing LFCs of new RNA, it might be sensible to normalize w.r.t. to total RNA, i.e. subtract the median log2 fold change of total RNA from all the log2 fold change of new RNA. This can be accomplished by setting mode to "new", and normalization to "total"!
Normalization can also be a mode.slot! Importantly, do not specify a slot containing normalized values, but specify a slot of unnormalized values (which are used to compute the size factors for normalization!) Can also be a numeric vector of size factors with the same length as the data as columns. Then each value is divided by the corresponding size factor entry.
Value
a new grandR object including a new analysis table. The columns of the new analysis table are
"M" |
the base mean |
"S" |
the log2FoldChange divided by lfcSE |
"P" |
the Wald test P value |
"Q" |
same as P but Benjamini-Hochberg multiple testing corrected |
"LFC" |
the log2 fold change |