Ran RunCCA/AlignSubspace, then when execute FindVariableGenes, @genes.hvg results in Error: no slot of name "genes.hvg" for this object of class "seurat"
Hi Gervaise, the Seurat object doesn't have a slot called genes.hvg; as seen in the docs, FindVariableGenes stores the variable genes in the var.genes slot, with the means and dispersion values stored in the hvg.info slot.
I'm sorry, I named it incorrectly, I meant var.genes.
When I just do FindVariableGenes, it populates @var.genes.
If I do FindVariableGenes after RunCCA/AlignSubspace, FindVariableGenes does NOT populate @var.genes. If I want to get the var.genes, I have to filter the @hvg.info myself.
I can't replicate that:
> data("pbmc_small")
> pbmc1 <- SubsetData(object = pbmc_small, cells.use = [email protected][1:40])
> pbmc2 <- SubsetData(object = pbmc_small, cells.use = [email protected][41:80])
> [email protected]$group <- "group1"
> [email protected]$group <- "group2"
> pbmc_cca <- RunCCA(object = pbmc1, object2 = pbmc2)
Running CCA
Merging objects
Performing log-normalization
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Scaling data matrix
|=============================================================| 100%
> pbmc_cca <- AlignSubspace(object = pbmc_cca, reduction.type = "cca", grouping.var = "group", dims.align = 1:2)
Rescaling group 1
Scaling data matrix
|=============================================================| 100%
Rescaling group 2
Scaling data matrix
|=============================================================| 100%
Aligning dimension 1
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 00s
Aligning dimension 2
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 00s
> [email protected]
[1] "LTB" "EAF2" "PIK3IP1" "KHDRBS1" "SRSF7"
[6] "S1PR4" "LYAR" "SATB1" "IL17RA" "POP7"
[11] "ZNF330" "COPS6" "PPBP" "HIST1H2AC" "TALDO1"
[16] "ACRBP" "VDAC3" "GNLY" "PTGDR" "ARHGDIA"
[21] "PCMT1"
> pbmc_cca <- FindVariableGenes(object = pbmc_cca, do.plot = FALSE)
Calculating gene means
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variance to mean ratios
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
> [email protected]
[1] "LTB" "EAF2" "CD19" "KIAA0125" "CYB561A3"
[6] "IGLL5" "PIK3IP1" "KHDRBS1" "CCR7" "ACSM3"
[11] "SRSF7" "S1PR4" "LYAR" "SATB1" "IL17RA"
[16] "POP7" "ZNF330" "COPS6" "PPBP" "PF4"
[21] "HIST1H2AC" "TALDO1" "CA2" "ACRBP" "TSC22D1"
[26] "VDAC3" "GNLY" "PTGDR" "ARHGDIA" "PCMT1"
[31] "S100B"
The var.genes slot is different, and therefore populated by FindVariableGenes after running RunCCA/AlignSubspace.
Donno what to tell you, it's not populating for me. It's OK, I just pulled the genes by slicing the @hvg.info with my cutoffs.
Thanks,
Gervaise
Ran RunCCA/AlignSubspace, then when execute FindVariableGenes, @genes.hvg results in Error: no slot of name "genes.hvg" for this object of class "seurat"
In Seurat3 it's stored at
Object@assays[email protected]

Most helpful comment
In Seurat3 it's stored at
Object@assays[email protected]