Clean wide tables (e.g., from getDataTable()) by stripping the trailing _{normMethod} or _{normMethod}_means suffixes from sample / group-mean columns.

removeNormMethodSuffix(dataTable, normMethod)

Arguments

dataTable

data.frame or tibble. Window × sample (or group) table whose column names may include a normalisation suffix (e.g., "sampleA_beta", "Tumour_beta_means"). Default: none (must be supplied).

normMethod

character(1). Normalisation/measure tag to remove from column names (e.g., "beta", "nrpm"). Default: none (must be supplied).

Value

A data.frame like dataTable but with cleaned column names (suffixes _{normMethod} and _{normMethod}_means removed where present).

Details

Intended for post-processing tables where column names encode the measure, e.g., "sample_beta", "group_beta_means". The function drops those suffixes to yield bare sample/group names, facilitating downstream joins and plotting.

Examples

# Basic cleaning for 'beta'
data.frame(A_beta = 1:3, B_beta_means = 4:6) %>%
  removeNormMethodSuffix("beta") %>%
  names()
#> [1] "A" "B"

# Works similarly for other measures (e.g., 'nrpm')
data.frame(S1_nrpm = 1:2, Tumour_nrpm_means = 3:4) %>%
  removeNormMethodSuffix("nrpm") %>%
  names()
#> [1] "S1"     "Tumour"