NormalizeBaseline | R Documentation |
Normalizes data in a grandR object to a baseline and puts the normalized data into a new slot
NormalizeBaseline(
data,
baseline = FindReferences(data, reference = Condition == levels(Condition)[1]),
name = "baseline",
slot = DefaultSlot(data),
set.to.default = FALSE,
LFC.fun = lfc::PsiLFC,
...
)
data |
the grandR object |
baseline |
matrix defining the corresponding baseline (row) for each column (sample or cell; see details) |
name |
the name of the new slot for the normalized data |
slot |
the name of the slot for the data to normalize |
set.to.default |
set the new slot as the default slot |
LFC.fun |
either NormLFC or PsiLFC from the lfc package |
... |
forwarded to LFC.fun |
Baseline normalization computes the log2 fold change for a column (i.e. sample or cell) to a baseline columns (or several baseline columns). This is by default done using the
PsiLFC
function from the lfc package, which, by default, also normalizes log2 fold changes by adding a constant
such that the median is zero.
Baselines are defined by a square logical matrix, defining for each sample or cell of the grandR object, represented by the column of the matrix,
which samples or cells are indeed the baseline (represented by the rows). Such matrices can conveniently be obtained by FindReferences
.
a new grandR object with an additional slot
Normalize
,FindReferences
sars <- ReadGRAND(system.file("extdata", "sars.tsv.gz", package = "grandR"),
design=c("Cell",Design$dur.4sU,Design$Replicate))
blmat <- FindReferences(sars,reference = duration.4sU==0, group = "Cell")
# the Mock.no4sU or SARS.no4sU sample are the baselines for each sample
sars <- NormalizeBaseline(sars,baseline=blmat)
head(GetTable(sars,type="baseline"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.