Merge samples whose names share a common prefix by removing a suffix pattern (mergeString) and summing counts across the resulting groups. CNV and zygosity values are combined using fragment‐count weights. The result is a new qseaSet with pooled samples and updated metadata.

poolSamples(qseaSet, mergeString)

Arguments

qseaSet

qseaSet A qseaSet object containing methylation-enriched sequencing data.

mergeString

character(1) Regular expression used to remove the suffix that distinguishes samples to be merged. The remaining prefix becomes the pooled sample name. After removal, pooled names are matched using startsWith(). For example, with names like "Patient1_T" and "Patient1_N", use mergeString = "_[TN]$" to pool them into "Patient1".

Value

A qseaSet object:

  • poolSamples(): returns a new qseaSet where samples with names sharing a common prefix (after applying mergeString) are merged. Counts are summed, CNV and zygosity values are combined using weighted averages, and library statistics are aggregated.

Details

Internally, pooled counts are simple sums. CNV values and zygosity are combined by a weighted average using total_fragments from @libraries$input_file. Library statistics are aggregated (sums for counts, weighted means for rates).

Examples

if (FALSE) { # \dontrun{
data(exampleTumourNormal)
# Pool Tumour/Normal pairs by patient into a single sample per patient:
# e.g., "Colon1_T","Colon1_N" -> "Colon1"
poolSamples(exampleTumourNormal, mergeString = "_[TN]$")
} # }