Skip to contents

Draws "knee plot" of PCA proportion of variance explained to determine which principal components (PCs) to include for downstream applications e.g. clustering. Variance explained for each PC is indicated by the line. Cumulative variance explained is indicated by the bars.

Usage

PCAKneePlot(TapestriExperiment, alt.exp = "alleleFrequency", n.pcs = 10)

Arguments

TapestriExperiment

TapestriExperiment object

alt.exp

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

n.pcs

Numeric, number of PCs to plot, starting at 1. Default 10.

Value

ggplot2 object, combined line plot and bar graph

Examples

tap.object <- newTapestriExperimentExample() # example TapestriExperiment object
#>  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")
PCAKneePlot(tap.object, n.pcs = 5)