Merge a list of qseaSet objects (or .rds files containing them) into a single qseaSet. Useful when cohorts were processed separately (e.g., tumour/normal, multiple runs) and need to be combined into one container.

combineQsetsList(
  qseaSets,
  firstQset = NULL,
  dropDuplicates = TRUE,
  checkParams = TRUE,
  regionsToKeep = NULL
)

Arguments

qseaSets

list List of qseaSet objects, or character() paths to .rds files containing qseaSet objects. Default: none (must be supplied).

firstQset

qseaSet or character(1) Optional initial qseaSet to merge into. If a character(1) ending in .rds, it is loaded via readr::read_rds(). Default: NULL.

dropDuplicates

logical(1) If TRUE, drop samples with duplicated names across inputs. If FALSE, duplicates are renamed by appending "_Dup". Default: TRUE.

checkParams

logical(1) Verify that global parameters are identical across inputs. Default: TRUE.

regionsToKeep

GRanges or coercible If supplied, restrict each qseaSet to these genomic regions before combining (saves memory). Accepts GRanges or a data frame with seqnames, start, end. Default: NULL (keep all regions).

Value

A qseaSet object:

  • Combined samples from all inputs (or from firstQset plus inputs).

  • Duplicates handled according to dropDuplicates.

  • Regions optionally prefiltered by regionsToKeep prior to merge.

See also

combineQsets() for pairwise merging.

Examples

data(exampleTumourNormal, package = "mesa")

# Split a cohort into Tumour and Normal, create a list, then combine back
tumours <- exampleTumourNormal %>% filter(tumour == "Tumour")
normals <- exampleTumourNormal %>% filter(tumour == "Normal")
qsetList <- list(tumours, normals)
combineQsetsList(qsetList)
#> No initial qseaSet given, using first element as initial qseaSet
#> Joining with `by = join_by(seqnames, start, end, width, strand, CpG_density)`
#> qseaSet
#> =======================================
#> 10 Samples: 
#> Colon1_T, Colon2_T, Lung1_T, Lung2_T, Lung3_T, Colon1_N, Colon2_N, Lung1_N, Lung2_N, Lung3_N
#> 819 Regions in 22 chromosomes of BSgenome.Hsapiens.NCBI.GRCh38