Replace sample names with values from a user-supplied column in the sampleTable of a qseaSet, updating all dependent slots consistently.

renameSamples(qseaSet, newNameColumn)

Arguments

qseaSet

qseaSet A qseaSet object containing methylation-enriched sequencing data.

newNameColumn

character(1) The name of a column in the sampleTable containing new sample names. Values must be unique and contain no NAs. (Unquoted column names are supported via tidy evaluation.)

Value

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.

Examples

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