Skip to contents

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
#>  Moving gRNA probe  to `altExp` slot "grnaCounts".
#>  Moving barcode probe  to `altExp` slot "barcodeCounts".
#>  Moving chrY probe(s) probe_231, probe_232, probe_233, probe_234, probe_235, probe_236, probe_237, probe_238, probe_239, and probe_240 to `altExp` slot "chrYCounts".
tap.object <- runPCA(tap.object, alt.exp = "alleleFrequency")