Takes a pre-computed dimensional reduction (typically calculated on a subset of genes) and projects this onto the entire dataset (all genes). Note that the cell loadings will remain unchanged, but now there are gene loadings for all genes.

ProjectDim(
  object,
  reduction = "pca",
  assay = NULL,
  dims.print = 1:5,
  nfeatures.print = 20,
  overwrite = FALSE,
  do.center = FALSE,
  verbose = TRUE
)

Arguments

object

Seurat object

reduction

Reduction to use

assay

Assay to use

dims.print

Number of dims to print features for

nfeatures.print

Number of features with highest/lowest loadings to print for each dimension

overwrite

Replace the existing data in feature.loadings

do.center

Center the dataset prior to projection (should be set to TRUE)

verbose

Print top genes associated with the projected dimensions

Value

Returns Seurat object with the projected values

Examples

data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
pbmc_small <- ProjectDim(object = pbmc_small, reduction = "pca")
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 1 
#> Positive:  SDPR, PF4, PPBP, TUBB1, CA2, TREML1, MYL9, PGRMC1, RUFY1, PARVB 
#> Negative:  HLA-DPB1, HLA-DQA1, S100A9, S100A8, GNLY, RP11-290F20.3, CD1C, AKR1C3, IGLL5, VDAC3 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 2 
#> Positive:  HLA-DPB1, HLA-DQA1, S100A8, S100A9, CD1C, RP11-290F20.3, PARVB, IGLL5, MYL9, SDPR 
#> Negative:  GNLY, AKR1C3, VDAC3, PGRMC1, TUBB1, PF4, TREML1, RUFY1, CA2, PPBP 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 3 
#> Positive:  S100A9, S100A8, RP11-290F20.3, AKR1C3, PARVB, GNLY, PPBP, PGRMC1, MYL9, TUBB1 
#> Negative:  HLA-DQA1, CD1C, IGLL5, HLA-DPB1, RUFY1, PF4, VDAC3, SDPR, TREML1, CA2 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 4 
#> Positive:  IGLL5, RP11-290F20.3, VDAC3, PPBP, TUBB1, TREML1, PF4, CA2, PARVB, MYL9 
#> Negative:  CD1C, AKR1C3, S100A8, GNLY, HLA-DPB1, HLA-DQA1, S100A9, PGRMC1, RUFY1, SDPR 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 5 
#> Positive:  MYL9, PARVB, IGLL5, TREML1, AKR1C3, PGRMC1, HLA-DPB1, S100A9, TUBB1, PF4 
#> Negative:  VDAC3, RP11-290F20.3, RUFY1, CD1C, HLA-DQA1, CA2, S100A8, PPBP, GNLY, SDPR 
# Vizualize top projected genes in heatmap
DimHeatmap(object = pbmc_small, reduction = "pca", dims = 1, balanced = TRUE)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.