| batch_diagnostics | R Documentation |
Checks whether the study design, the quality-control metrics and the main axes of variation follow technical batches such as cartridges and run dates.
batch_diagnostics(x, group = NULL, batch = c("CartridgeID", "Date"))
x |
A |
group |
A column of |
batch |
Columns of |
Start with design: when a batch level holds a single group, batch and
biology cannot be told apart, and no normalisation can fix it.
A list:
design: NULL without group; otherwise, for each batch variable,
its number of levels, Cramér's V with group, the number of levels that
hold a single group, and confounded, TRUE when at least one does.
A level counts as holding a single group only when it has two or more
samples with a group, so a cartridge with one sample never makes the
design confounded.
Cramér's V uses only the samples that have both a group and a batch, and
is NA when the batch or group has fewer than two levels among them.
crosstabs: NULL without group; otherwise the table of group
against each batch variable.
metrics: Kruskal-Wallis tests of each quality-control metric against
each batch variable.
pc_batch: the share of each principal component's variance explained
by each batch variable.
metrics and pc_batch are data frames with these columns, and have no
rows when there is nothing to report.
A batch variable with one level gives NA in statistic, p_value and
r_squared, and a constant metric gives NA in statistic and p_value.
A batch variable whose levels each hold one sample with a value also gives
NA in r_squared.
For PlexSet data, BD and FoV are tested once per lane.
data(GSE74821)
batch_diagnostics(GSE74821)$pc_batch
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.