driftPlot | R Documentation |
The function driftPlot
aggregates the (count/intensity) values from
the assay()
slot of a SummarizedExperiment
by the median
or sum
of the (count/intensity) values. driftPlot
then
visualizes these aggregated values and adds a trend line (using either
LOESS or a linear model) from (a subset of) the aggregated values. The
subset is specified by the arguments category
and level
.
driftPlot(
se,
aggregation = c("median", "sum"),
category = colnames(colData(se)),
orderCategory = colnames(colData(se)),
level = c("all", unique(colData(se)[, category])),
method = c("loess", "lm")
)
se |
|
aggregation |
|
category |
|
orderCategory |
|
level |
|
method |
|
The x-values are sorted according to the orderCategory
argument: The
levels of the corresponding column in colData(se)
are pasted with the
sample names (in the column name
) and factorized.
Internal usage in shinyQC
.
gg
object from ggplot2
#' ## create se
set.seed(1)
a <- matrix(rnorm(1000), nrow = 10, ncol = 100,
dimnames = list(seq_len(10), paste("sample", seq_len(100))))
a[c(1, 5, 8), seq_len(5)] <- NA
cD <- data.frame(name = colnames(a), type = c(rep("1", 50), rep("2", 50)))
rD <- data.frame(spectra = rownames(a))
se <- SummarizedExperiment::SummarizedExperiment(assay = a,
rowData = rD, colData = cD)
driftPlot(se, aggregation = "sum", category = "type",
orderCategory = "type", level = "1", method = "loess")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.