hoeffDValues | R Documentation |
The function creates and returns Hoeffding's D statistics values from MA values.
In case sample_n
is set to a numerical value (e.g. 10000), a
random subset containing sample_n
is taken to calculate Hoeffding's D
values to speed up the calculation. In case there are less features
than sample_n
, all features are taken.
hoeffDValues(tbl, name = "raw", sample_n = NULL)
tbl |
|
name |
|
sample_n |
|
The function uses the function hoeffd
from the Hmisc
package to
calculate the values.
named list with Hoeffding's D values per sample
## create se
a <- matrix(seq_len(100), nrow = 10, ncol = 10,
dimnames = list(seq_len(10), paste("sample", seq_len(10))))
a[c(1, 5, 8), seq_len(5)] <- NA
set.seed(1)
a <- a + rnorm(100)
cD <- data.frame(name = colnames(a), type = c(rep("1", 5), rep("2", 5)))
rD <- data.frame(spectra = rownames(a))
se <- SummarizedExperiment::SummarizedExperiment(assay = a,
rowData = rD, colData = cD)
tbl <- MAvalues(se)
hoeffDValues(tbl, "raw")
## normalized values
se_n <- se
assay(se_n) <- normalizeAssay(a, "sum")
tbl_n <- MAvalues(se_n, group = "all")
hoeffDValues(tbl_n, "normalized")
## transformed values
se_t <- se
assay(se_t) <- transformAssay(a, "log")
tbl_t <- MAvalues(se_t, group = "all")
hoeffDValues(tbl_t, "transformed")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.