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
TapestriExperimentobject- alt.exp
Character,
altExpto use,NULLuses top-level/main experiment. Default "alleleFrequency".- assay
Character,
assayto 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
NULLif not using for alleleFrequency slot. DefaultNULL.- center
Logical, if
TRUE(default), variables are shifted to be zero centered. Seestats::prcomp().- scale.
Logical,if
TRUE(default), variables are scaled to have unit variance prior to PCA. Seestats::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")
