integrate_sces: Integrate a merged set of SingleCellExperiment objects using...

View source: R/integrate_sces.R

integrate_scesR Documentation

Integrate a merged set of SingleCellExperiment objects using a specified integration method. The final SCE object will contain an additional reducedDim entitled '{integration_method}_PCA'. All original SCE assays are retained. 'fastMNN' integration uses all default setting, but additional parameters can be supplied. 'harmony' integration uses existing PCs, but additional parameters can be supplied.

Description

Integrate a merged set of SingleCellExperiment objects using a specified integration method. The final SCE object will contain an additional reducedDim entitled '{integration_method}_PCA'. All original SCE assays are retained. 'fastMNN' integration uses all default setting, but additional parameters can be supplied. 'harmony' integration uses existing PCs, but additional parameters can be supplied.

Usage

integrate_sces(
  merged_sce,
  integration_method = c("fastMNN", "harmony"),
  batch_column = "sample",
  covariate_cols = c(),
  batch_lambda = 1,
  covariate_lambda = c(),
  return_corrected_expression = FALSE,
  seed = NULL,
  ...
)

Arguments

merged_sce

A merged SCE object as prepared by 'scpcaTools::merge_sce_list()'.

integration_method

The integration method to use. One of 'fastMNN' or 'harmony' (case-sensitive)

batch_column

The column in the merged SCE object indicating batches

covariate_cols

A vector of additional columns in the merged SCE to consider as covariates during integration. Currently, this is used only by 'harmony'.

batch_lambda

The ridge regression penalty to use when correcting using the 'batch_column'. This is only used by 'harmony'. Default is 1.

covariate_lambda

A vector of ridge regression penalties to use with each covariate. A lambda value must be provided for each covariate column. This is only used by 'harmony'.

return_corrected_expression

A boolean indicating whether corrected expression values determined by the given integration method should be included in the integrated SCE object. Note that 'harmony' does not calculate corrected expression, so this argument is ignored for this integration method. Default is 'FALSE'.

seed

Random seed to set for integration. This is only set if the value is not 'NULL'.

...

Any additional parameters to be passed to the given integration method

Value

An updated merged SCE object containing a new reduced dimension named '{integration_method}_PCA' containing the corrected PCs. In the case of 'fastMNN' integration, the SCE also includes a corrected expression assay ('fastMNN_corrected')


AlexsLemonade/scpcaTools documentation built on July 12, 2024, 8:34 a.m.