
Create row labels based on the settings of labelfield in the ExploratorySummarizedExperiment object and the annotation data in mcols.
Source: R/selectmatrix.R
id_to_label.RdCreate row labels based on the settings of labelfield in the
ExploratorySummarizedExperiment object and the annotation data in
mcols.
Examples
expression <- matrix(1:12, nrow = 3,
dimnames = list(c("ENSG1", "ENSG2", "ENSG3"), paste0("s", 1:4)))
coldata <- data.frame(
condition = rep(c("treated", "control"), each = 2),
row.names = paste0("s", 1:4)
)
annotation <- data.frame(
gene_id = c("ENSG1", "ENSG2", "ENSG3"),
gene_name = c("GeneA", "GeneB", "GeneC"),
row.names = c("ENSG1", "ENSG2", "ENSG3")
)
ese <- ExploratorySummarizedExperiment(
assays = list(expression = expression),
colData = coldata,
annotation = annotation,
idfield = "gene_id",
labelfield = "gene_name"
)
id_to_label(c("ENSG1", "ENSG2"), ese)
#> [1] "GeneA / ENSG1" "GeneB / ENSG2"