Merge two qseaSet objects (or .rds files containing them) into a single qseaSet. This is the pairwise worker used internally by combineQsetsList().

combineQsets(
  qseaSet1,
  qseaSet2,
  checkParams = FALSE,
  regionsToKeep = NULL,
  dropDuplicates = FALSE
)

Arguments

qseaSet1

qseaSet or character(1) Either a qseaSet object, or path to an .rds file containing one.

qseaSet2

qseaSet or character(1) Either a qseaSet object, or path to an .rds file containing one.

checkParams

logical(1) If TRUE, enforce identical global parameters across inputs. Default: FALSE.

regionsToKeep

GRanges or coercible If supplied, restrict both qseaSet1 and qseaSet2 to these genomic regions before combining. Accepts a GRanges or a data frame with seqnames, start, end. Default: NULL.

dropDuplicates

logical(1) If TRUE, drop duplicate sample names. If FALSE, duplicates are retained but renamed with suffix "_Dup". Default: FALSE.

Value

A qseaSet object containing:

  • Samples from both inputs.

  • Regions restricted by regionsToKeep if supplied.

  • Duplicates handled according to dropDuplicates.

  • Global parameters optionally checked for consistency.

See also

combineQsetsList() for merging more than two inputs.

Examples

data(exampleTumourNormal, package = "mesa")

# Split a cohort into Tumour and Normal, then combine back
tumours <- exampleTumourNormal %>% filter(tumour == "Tumour")
normals <- exampleTumourNormal %>% filter(tumour == "Normal")
combineQsets(tumours, normals)
#> 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