Description Usage Arguments Value Author(s) See Also Examples
View source: R/addDimReduction.R
Add a prcomp pca calculation to a SingleCellExperiment object containing bulk or single-cell data
1 |
object |
the |
prcomp |
a prcomp output which will be added to the |
name |
String name for the reduction slot.
Normally, this will be "pca", but you can hold any number of PCA calculations so long as a unique |
key |
String, like "PC", which sets the default axes-label prefix when this reduction is used for making a |
Outputs an SingleCellExperiment
object with an added or replaced pca reduction slot.
Daniel Bunis
addDimReduction
for adding other types of dimensionality reductions
importDittoBulk
for initial import of bulk RNAseq data into dittoSeq as a SingleCellExperiment
.
dittoDimPlot
for visualizing how samples group within added dimensionality reduction spaces
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | example("importDittoBulk", echo = FALSE)
# Calculate PCA with prcomp
# NOTE: This is typically not done with all genes in a dataset.
# The inclusion of this example code is not an endorsement of a particular
# method of PCA. Consult yourself, a bioinformatician, or literature for
# tips on proper techniques.
calc <- prcomp(t(logcounts(myRNA)), center = TRUE, scale = TRUE)
myRNA <- addPrcomp(
object = myRNA,
prcomp = calc)
# Now we can visualize conditions metadata on a PCA plot
dittoDimPlot(myRNA, "conditions", reduction.use = "pca", size = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.