ECDF | R Documentation |
The function ECDF
creates a plot of the empirical cumulative
distribution function of a specified sample and an outgroup (reference).
The reference is specified by the group
argument. The row-wise
(feature) mean values of the reference are calculated after excluding
the specified sample
.
ECDF(se, sample = colnames(se), group = c("all", colnames(colData(se))))
se |
|
sample |
|
group |
|
Internal use in shinyQC
.
The function ECDF
uses the ks.test
function from stats
to perform a two-sample Kolmogorov-Smirnov test. The Kolmogorov-Smirnov
test is run with the alternative "two.sided"
(null hypothesis is that the true distribution function of the
sample
is equal to the hypothesized distribution function of the
group
).
The exact
argument in ks.test
is set to NULL
, meaning
that an exact p-value is computed if the product of the sample sizes is
less than 10000 of sample
and group
. Otherwise, asymptotic
distributions are used whose approximations might be inaccurate in low
sample sizes.
gg
object from ggplot2
## create se
set.seed(1)
a <- matrix(rnorm(1000), nrow = 100, ncol = 10,
dimnames = list(seq_len(100), paste("sample", seq_len(10))))
a[c(1, 5, 8), seq_len(5)] <- NA
cD <- data.frame(name = colnames(a), type = c(rep("1", 5), rep("2", 5)))
rD <- data.frame(spectra = rownames(a))
se <- SummarizedExperiment(assay = a, rowData = rD, colData = cD)
ECDF(se, sample = "sample 1", group = "all")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.