runPCA {karyotapR}R Documentation

Cluster assay data by Principal Components Analysis

Description

Analyzes assay data by Principal Components Analysis (PCA) and saves results to reducedDims slot of TapestriObject.

Usage

runPCA(
  TapestriExperiment,
  alt.exp = "alleleFrequency",
  assay = NULL,
  sd.min.threshold = NULL,
  center = TRUE,
  scale. = TRUE
)

Arguments

TapestriExperiment

TapestriExperiment object

alt.exp

Character, altExp to use, NULL uses top-level/main experiment. Default "alleleFrequency".

assay

Character, assay to use. NULL (default) uses first-indexed assay.

sd.min.threshold

Numeric, minimum threshold for allelefreq.sd. Increase to run PCA on fewer, more variable dimensions. Set to NULL if not using for alleleFrequency slot. Default NULL.

center

Logical, if TRUE (default), variables are shifted to be zero centered. See stats::prcomp().

scale.

Logical,if TRUE (default), variables are scaled to have unit variance prior to PCA. See stats::prcomp().

Value

TapestriExperiment with PCA results saved to reducedDims slot of altExp, and proportion of variance explained by each PC saved to metadata slot of altExp.

See Also

stats::prcomp() for PCA method details.

Examples

tap.object <- newTapestriExperimentExample() # example TapestriExperiment
tap.object <- runPCA(tap.object, alt.exp = "alleleFrequency")

[Package karyotapR version 1.0.1 Index]