This function will return the human readable sample names if defined
in the sampleName
column of sampleData
. Otherwise it will return
the syntactically valid names defined as the rownames of sampleData
.
Usage
sampleNames(object)
sampleNames(object) <- value
# S4 method for SummarizedExperiment,character
sampleNames(object) <- value
Examples
data(RangedSummarizedExperiment, package = "AcidTest")
rse <- RangedSummarizedExperiment
## SummarizedExperiment ====
object <- rse
x <- sampleNames(object)
print(x)
#> sample01 sample02 sample03 sample04 sample05 sample06 sample07
#> "sample01" "sample02" "sample03" "sample04" "sample05" "sample06" "sample07"
#> sample08 sample09 sample10 sample11 sample12
#> "sample08" "sample09" "sample10" "sample11" "sample12"
## Assignment support.
value <- sampleNames(object)
value <- toupper(value)
print(value)
#> sample01 sample02 sample03 sample04 sample05 sample06 sample07
#> "SAMPLE01" "SAMPLE02" "SAMPLE03" "SAMPLE04" "SAMPLE05" "SAMPLE06" "SAMPLE07"
#> sample08 sample09 sample10 sample11 sample12
#> "SAMPLE08" "SAMPLE09" "SAMPLE10" "SAMPLE11" "SAMPLE12"
sampleNames(object) <- value
x <- sampleNames(object)
print(x)
#> sample01 sample02 sample03 sample04 sample05 sample06 sample07
#> "SAMPLE01" "SAMPLE02" "SAMPLE03" "SAMPLE04" "SAMPLE05" "SAMPLE06" "SAMPLE07"
#> sample08 sample09 sample10 sample11 sample12
#> "SAMPLE08" "SAMPLE09" "SAMPLE10" "SAMPLE11" "SAMPLE12"