Replace sample names with values from a user-supplied column in the
sampleTable of a qseaSet, updating all dependent slots consistently.
renameSamples(qseaSet, newNameColumn)A qseaSet object:
renameSamples(): returns the input qseaSet with sample names replaced
by values from newNameColumn. All associated slots are updated to reflect
the new naming.
data(exampleTumourNormal, package = "mesa")
exampleTumourNormal %>%
dplyr::mutate(
newName = paste0(
"Sample",
seq_len(nrow(qsea::getSampleTable(.)))
)
) %>%
renameSamples(newNameColumn = "newName")
#> qseaSet
#> =======================================
#> 10 Samples:
#> Sample1, Sample2, Sample3, Sample4, Sample5, Sample6, Sample7, Sample8, Sample9, Sample10
#> 819 Regions in 22 chromosomes of BSgenome.Hsapiens.NCBI.GRCh38