explore_batch_effect: Explore batch effect.

View source: R/batch-effect-explore.R

explore_batch_effectR Documentation

Explore batch effect.

Description

Investigate if batch effect exists.

Usage

explore_batch_effect(
  trainer,
  batch_name = "Batch",
  classification_name = "Classification",
  top_n_rle = 20000,
  rle_downsample = 100,
  top_n_pca = 20000,
  k = 50,
  threshold = 0.9
)

Arguments

trainer

A S3 object of YamatClassifierTrainer class.

batch_name

column name of batch in the targets attribute of YamatClassifierTrainer object.

classification_name

column name of classification in the targets attribute of YamatClassifierTrainer object.

top_n_rle

an integer of the most variable N loci for relative log expression (RLE) analysis.

rle_downsample

if there are many samples, down-sample it to a number while keep the proportion of each group.

top_n_pca

an integer of the most variable N loci for PCA.

k

Number of eigenvalues requested.

threshold

A numeric scalar between 0 to 1 of the threshold of the fraction of variance to choose PC number. Default to 0.9.

Details

  1. Center and scale.

  2. Compute the correlation/covariance matrix.

  3. Calculate the eigenvectors and eigenvalues.

  4. Choose the PC number. I use Capper's method and fraction of variance to calculate PC numbers and choose the bigger one from the two methods. See details at find_pc_number.capper and find_pc_number.var_frac.

  5. Project the scaled input matrix onto the new basis.


markgene/yamatClassifier documentation built on Oct. 14, 2024, 2:36 a.m.