Learn R Programming

Seurat (version 2.1.0)

AlignSubspace: Align subspaces using dynamic time warping (DTW)

Description

Aligns subspaces so that they line up across grouping variable (only implemented for case with 2 categories in grouping.var)

Usage

AlignSubspace(object, reduction.type, grouping.var, dims.align,
  num.genes = 30, show.plots = FALSE)

Arguments

object

Seurat object

reduction.type

reduction to align scores for

grouping.var

Name of the grouping variable for which to align the scores

dims.align

Dims to align, default is all

num.genes

Number of genes to use in construction of "metagene"

show.plots

show debugging plots

Value

Returns Seurat object with the dims aligned, stored in object@dr$reduction.type.aligned

Examples

Run this code
# NOT RUN {
pbmc_small
# Requires CCA to have previously been run
# 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)
pbmc_cca <- AlignSubspace(pbmc_cca,reduction.type = "cca", grouping.var = "group", dims.align = 1:2)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab