mergeSEs: mergeSEs

View source: R/mergeSEs.R

mergeSEsR Documentation

mergeSEs

Description

Merges a list of SummarizedExperiment-class, either by row.names or through specified rowData fields. In cases of many-to-many (or one-to-many) mappings, 'aggFun' determines whether the records are aggregated by linking ID (if an aggregation method is given) or all combinations are returned (if 'aggFun=NULL' - default).

Usage

mergeSEs(
  ll,
  use.assays = NULL,
  do.scale = TRUE,
  commonOnly = TRUE,
  colColumns = NULL,
  mergeBy = NULL,
  aggFun = NULL,
  addDatasetPrefix = TRUE,
  defValues = list(),
  keepRowData = TRUE,
  BPPARAM = SerialParam()
)

Arguments

ll

A (named) list of SummarizedExperiment-class

use.assays

Names (or indexes) of the assays to use. By default, all common assays are used.

do.scale

A logical vector indicating (globally or for each assay) whether to perform row unit-variance scaling on each dataset before merging (default TRUE).

commonOnly

Logical; whether to restrict to rows present in all datasets (default TRUE).

colColumns

A character vector specifying 'colData' columns to include (if available in at least one of the datasets). If NULL, everything is kept.

mergeBy

The 'rowData' column to merge with. If NULL, row.names are used.

aggFun

The aggregation function to use when multiple rows have the same 'mergeBy' value. If merging multiple assays, a different function per assay can be passed as a named list (see aggSE). If NULL (default), entries will be reused to have each combination.

addDatasetPrefix

Logical; whether the name of the dataset should be appended to the sample names (default TRUE).

defValues

An optional named list of default 'colData' values when some columns are missing from some SEs.

keepRowData

Logical, whether to keep the rowData (default TRUE).

BPPARAM

For multithreading the aggregation step.

Value

An object of class SummarizedExperiment-class

Examples

data("SE", package="SEtools")
mergeSEs( list( se1=SE[,1:10], se2=SE[,11:20] ) )


plger/SEtools documentation built on Dec. 2, 2022, 3:58 p.m.