
Last chance! 50% off unlimited learning
Sale ends in
Runs a canonical correlation analysis using a diagonal implementation of CCA.
For details about stored CCA calculation parameters, see
PrintCCAParams
.
RunCCA(object, object2, group1, group2, group.by, num.cc = 20, genes.use,
scale.data = TRUE, rescale.groups = FALSE, ...)
Seurat object
Optional second object. If object2 is passed, object1 will be considered as group1 and object2 as group2.
First set of cells (or IDs) for CCA
Second set of cells (or IDs) for CCA
Factor to group by (column vector stored in object@meta.data)
Number of canonical vectors to calculate
Set of genes to use in CCA. Default is object@var.genes. If two objects are given, the default is the union of both variable gene sets that are also present in both objects.
Use the scaled data from the object
Rescale each set of cells independently
Extra parameters to MergeSeurat
Returns Seurat object with the CCA stored in the @dr$cca slot. If one object is passed, the same object is returned. If two are passed, a combined object is returned.
MergeSeurat
# NOT RUN {
pbmc_small
# As CCA requires two datasets, we will split our test object into two just for this example
pbmc1 <- SubsetData(pbmc_small,cells.use = pbmc_small@cell.names[1:40])
pbmc2 <- SubsetData(pbmc_small,cells.use = pbmc_small@cell.names[41:80])
pbmc1@meta.data$group <- "group1"
pbmc2@meta.data$group <- "group2"
pbmc_cca <- RunCCA(pbmc1,pbmc2)
# Print results
PrintDim(pbmc_cca,reduction.type = 'cca')
# }
Run the code above in your browser using DataLab