chuiqin / irGSEA

The integration of single cell rank-based gene set enrichment analysis
Other
112 stars 17 forks source link

Seurat 5.0.1,Error: $ operator is invalid for atomic vectors #45

Closed Pigeongeon closed 3 months ago

Pigeongeon commented 4 months ago

rm(list = ls())# 删除所有已定义对象 getwd() setwd("/mnt/data/home/tycloud")

library(Seurat) library(SeuratData) library(RcppML) library(irGSEA) library(doMC) registerDoMC(cores = 20)

Sys.setenv(RETICULATE_PYTHON = "/mnt/data/tool/miniconda3/envs/irGSEA/bin/python") reticulate::py_config()

读取gsva.py文件

gsva_path <- "/mnt/data/home/tycloud/R/library/4.3.3/irGSEA/python/gsva.py" gsva_content <- readLines(gsva_path)

定位到保存结果的部分并修改

modified_content <- gsub("acts.to_csv\('./matrix.py.result.csv'\)", "pd.DataFrame(acts[0]).to_csv('./matrix.py.result.csv')", gsva_content)

保存

writeLines(modified_content, gsva_path)

load("Scissor/HCC_endothelium.Rdata") # 加载保存的Seurat对象

【检查Seurat对象版本】【HCC_endothelium 是 Seurat 版本 5.0.1,运行失败,而我的其他Seurat对象是3.2.1,都成功运行了VISION】

check_seurat_version <- function(object_name) { object <- get(object_name) if (inherits(object, "Seurat")) { version <- object@version cat(paste0(object_name, " 是 Seurat 版本 ", version, "\n")) } else { cat(paste0(object_name, " 不是 Seurat 对象\n")) } }

检查每个对象

check_seurat_version("HCC_endothelium")

HCC_endothelium 是 Seurat 版本 5.0.1

HCC_endothelium <- irGSEA.score(object = HCC_endothelium , assay = "RNA", slot = "counts", seeds = 123, ncores = 60, min.cells = 3, min.feature = 0, custom = FALSE, geneset = NULL, msigdb = TRUE, species = "Homo sapiens", category = "H", subcategory = NULL, geneid = "symbol",

  • method = c("VISION"), aucell.MaxRank = NULL, ucell.MaxRank = NULL, kcdf = 'Gaussian')

Validating object structure Updating object slots Ensuring keys are in the proper structure Updating matrix keys for DimReduc 'umap' Updating matrix keys for DimReduc 'pca' Updating matrix keys for DimReduc 'harmony' Warning: Assay RNA changing from Assay to Assay Warning: DimReduc umap changing from DimReduc to DimReduc Warning: Adding a dimensional reduction (umap) without the associated assay being present Ensuring keys are in the proper structure Warning: Adding a dimensional reduction (umap) without the associated assay being present Ensuring feature names don't have underscores or pipes Warning: Adding a dimensional reduction (umap) without the associated assay being present Updating slots in RNA Updating slots in RNA_nn Setting default assay of RNA_nn to RNA Updating slots in RNA_snn Setting default assay of RNA_snn to RNA Updating slots in umap Setting umap DimReduc to global Warning: Adding a dimensional reduction (umap) without the associated assay being present Updating slots in pca Updating slots in harmony No assay information could be found for FindIntegrationAnchors Setting assay used for NormalizeData.RNA to RNA Setting assay used for FindVariableFeatures.RNA to RNA Setting assay used for ScaleData.RNA to RNA Setting assay used for RunPCA.RNA to RNA Setting assay used for Seurat..ProjectDim.RNA.harmony to RNA Setting assay used for FindNeighbors.RNA.pca to RNA Validating object structure for Assay 'RNA' Validating object structure for Graph 'RNA_nn' Validating object structure for Graph 'RNA_snn' Validating object structure for DimReduc 'umap' Validating object structure for DimReduc 'pca' Validating object structure for DimReduc 'harmony' Object representation is consistent with the most current Seurat version Calculate VISION scores Importing counts from obj[["RNA"]]@counts ... Normalizing to counts per 10,000... Importing Meta Data from obj@meta.data ... Importing latent space from Embeddings(obj, "pca") using first 50 components

Using 17514/66590 genes detected in 0.10% of cells for signature analysis. See the sig_gene_threshold input to change this behavior.

Dropping 'CellName' from meta data as it is of type 'character' and has more than 20 unique values. If you want to include this meta data variable, convert it to a factor before providing the data frame to Vision Dropping 'PatientID' from meta data as it is of type 'character' and has more than 20 unique values. If you want to include this meta data variable, convert it to a factor before providing the data frame to Vision Dropping 'Sub_Cluster' from meta data as it is of type 'character' and has more than 20 unique values. If you want to include this meta data variable, convert it to a factor before providing the data frame to Vision Adding Visualization: Seurat_umap Adding Visualization: Seurat_pca Adding Visualization: Seurat_harmony Beginning Analysis

Clustering cells... Using latent space to cluster cells... completed

Projecting data into 2 dimensions...

Evaluating signature scores on cells...

|=========================================================================================================================| 100%, Elapsed 00:01 Evaluating signature-gene importance...

|=========================================================================================================================| 100%, Elapsed 00:31 Creating 5 background signature groups with the following parameters: sigSize sigBalance 1 37 1 2 92 1 3 144 1 4 175 1 5 192 1 signatures per group: 3000 Computing KNN Cell Graph in the Latent Space...

Evaluating local consistency of signatures in latent space...

|=========================================================================================================================| 100%, Elapsed 00:02 |=========================================================================================================================| 100%, Elapsed 05:36 |=========================================================================================================================| 100%, Elapsed 06:04 |=============================================================================================================== | 89%, ETA 00:01 Error: $ operator is invalid for atomic vectors

chuiqin commented 4 months ago

在Seurat 5.0版本的条件下,我测试了VISION,发现可以正常运行:

> library(irGSEA)
> library(tidyverse)
> library(SeuratData)
> data("pbmc3k.final")
> pbmc3k.final3 <- irGSEA.score(object = pbmc3k.final, assay = "RNA",
+                               slot = "data",ncores = 4,
+                               msigdb = T, species = "Homo sapiens", category = "H", geneid = "symbol",
+                               method = c("VISION"), kcdf = 'Gaussian')
Validating object structure
Updating object slots
Ensuring keys are in the proper structure
Updating matrix keys for DimReduc ‘pca’
Updating matrix keys for DimReduc ‘umap’
Warning: Assay RNA changing from Assay to Assay
Warning: Graph RNA_nn changing from Graph to Graph
Warning: Graph RNA_snn changing from Graph to Graph
Warning: DimReduc pca changing from DimReduc to DimReduc
Warning: DimReduc umap changing from DimReduc to DimReduc
Ensuring keys are in the proper structure
Ensuring feature names don't have underscores or pipes
Updating slots in RNA
Updating slots in RNA_nn
Setting default assay of RNA_nn to RNA
Updating slots in RNA_snn
Setting default assay of RNA_snn to RNA
Updating slots in pca
Updating slots in umap
Setting umap DimReduc to global
Setting assay used for NormalizeData.RNA to RNA
Setting assay used for FindVariableFeatures.RNA to RNA
Setting assay used for ScaleData.RNA to RNA
Setting assay used for RunPCA.RNA to RNA
Setting assay used for JackStraw.RNA.pca to RNA
No assay information could be found for ScoreJackStraw
Setting assay used for FindNeighbors.RNA.pca to RNA
No assay information could be found for FindClusters
Setting assay used for RunUMAP.RNA.pca to RNA
Validating object structure for Assay ‘RNA’
Validating object structure for Graph ‘RNA_nn’
Validating object structure for Graph ‘RNA_snn’
Validating object structure for DimReduc ‘pca’
Validating object structure for DimReduc ‘umap’
Object representation is consistent with the most current Seurat version
Error in irGSEA.score(object = pbmc3k.final, assay = "RNA", slot = "data",  : 
  VISION only support slot (counts).
> pbmc3k.final3 <- irGSEA.score(object = pbmc3k.final, assay = "RNA",
+                               slot = "counts",ncores = 4,
+                               msigdb = T, species = "Homo sapiens", category = "H", geneid = "symbol",
+                               method = c("VISION"), kcdf = 'Gaussian')
Validating object structure
Updating object slots
Ensuring keys are in the proper structure
Updating matrix keys for DimReduc ‘pca’
Updating matrix keys for DimReduc ‘umap’
Warning: Assay RNA changing from Assay to Assay
Warning: Graph RNA_nn changing from Graph to Graph
Warning: Graph RNA_snn changing from Graph to Graph
Warning: DimReduc pca changing from DimReduc to DimReduc
Warning: DimReduc umap changing from DimReduc to DimReduc
Ensuring keys are in the proper structure
Ensuring feature names don't have underscores or pipes
Updating slots in RNA
Updating slots in RNA_nn
Setting default assay of RNA_nn to RNA
Updating slots in RNA_snn
Setting default assay of RNA_snn to RNA
Updating slots in pca
Updating slots in umap
Setting umap DimReduc to global
Setting assay used for NormalizeData.RNA to RNA
Setting assay used for FindVariableFeatures.RNA to RNA
Setting assay used for ScaleData.RNA to RNA
Setting assay used for RunPCA.RNA to RNA
Setting assay used for JackStraw.RNA.pca to RNA
No assay information could be found for ScoreJackStraw
Setting assay used for FindNeighbors.RNA.pca to RNA
No assay information could be found for FindClusters
Setting assay used for RunUMAP.RNA.pca to RNA
Validating object structure for Assay ‘RNA’
Validating object structure for Graph ‘RNA_nn’
Validating object structure for Graph ‘RNA_snn’
Validating object structure for DimReduc ‘pca’
Validating object structure for DimReduc ‘umap’
Object representation is consistent with the most current Seurat version
Calculate VISION scores
Importing counts from obj[["RNA"]]@counts ...
Normalizing to counts per 10,000...
Importing Meta Data from obj@meta.data ...
Importing latent space from Embeddings(obj, "pca") using first 50 components

Using 13656/13714 genes detected in 0.10% of cells for signature analysis.
See the `sig_gene_threshold` input to change this behavior.

Adding Visualization: Seurat_pca
Adding Visualization: Seurat_umap
Beginning Analysis

Clustering cells...
Using latent space to cluster cells...
completed

Projecting data into 2 dimensions...

Evaluating signature scores on cells...

  |===============================================================| 100%, Elapsed 00:00
Evaluating signature-gene importance...

  |===============================================================| 100%, Elapsed 00:00
Creating 5 background signature groups with the following parameters:
  sigSize sigBalance
1      21          1
2      59          1
3      88          1
4     129          1
5     170          1
  signatures per group: 3000
Computing KNN Cell Graph in the Latent Space...

Evaluating local consistency of signatures in latent space...

  |===============================================================| 100%, Elapsed 00:00
  |===============================================================| 100%, Elapsed 00:07
  |===============================================================| 100%, Elapsed 00:05
  |===============================================================| 100%, Elapsed 00:00
Clustering signatures...

fitting ...
  |==============================================================================| 100%
Computing differential signature tests...

  |===============================================================| 100%, Elapsed 00:00
  |===============================================================| 100%, Elapsed 00:01
Computing correlations between signatures and latent space components...

  |===============================================================| 100%, Elapsed 00:01
Analysis Complete!

Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-')
Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-')
Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-')
Finish calculate VISION scores
> packageVersion(pkg = "Seurat")
[1] ‘5.0.3’
> packageVersion(pkg = "VISION")
[1] ‘3.0.1’
> packageVersion(pkg = "irGSEA")
[1] ‘3.2.5’

你是否可以运行这段代码,判断一下是否正确安装了VISION以及irGSEA

library(Seurat)
library(irGSEA)
library(tidyverse)
library(Seurat)
library(SeuratData)
data("pbmc3k.final")

pbmc3k.final3 <- irGSEA.score(object = pbmc3k.final, assay = "RNA",
                              slot = "counts",ncores = 4,
                              msigdb = T, species = "Homo sapiens", category = "H", geneid = "symbol",
                              method = c("VISION"), kcdf = 'Gaussian')
Pigeongeon commented 4 months ago

library(Seurat) library(irGSEA) library(tidyverse) library(Seurat) library(SeuratData)

InstallData("pbmc3k") # 数据集的安装 Using cached data manifest, last updated at 2024-07-08 15:40:31.54 Error: No access to remote SeuratData repository, unable to install new datasets 【网络原因,我就下载到本地手动安装】

getwd() [1] "/mnt/data/home/tycloud" install.packages("/mnt/data/home/tycloud/pbmc3k.SeuratData_3.1.4.tar.gz", repos = NULL, type = "source") Installing package into '/mnt/data/home/tycloud/R/library/4.3.3' (as 'lib' is unspecified)

  • installing source package ‘pbmc3k.SeuratData’ ... using staged installation R data moving datasets to lazyload DB inst byte-compile and prepare package for lazy loading help installing help indices building package indices testing if installed package can be loaded from temporary location testing if installed package can be loaded from final location testing if installed package keeps a record of temporary installation path
  • DONE (pbmc3k.SeuratData)

library(pbmc3k.SeuratData)

data("pbmc3k.final") # 加载数据集

View(pbmc3k.final3) pbmc3k.final@version # 【哎?怎么是3.1.4?】 [1] '3.1.4' class(pbmc3k.final) [1] "Seurat"

packageVersion("Seurat") # 【我的Seurat包的版本是5.0.3】 [1] '5.0.3'

pbmc3k.final3 <- irGSEA.score(object = pbmc3k.final, assay = "RNA",

  • slot = "counts",ncores = 4,
  • msigdb = T, species = "Homo sapiens", category = "H", geneid = "symbol",
  • method = c("VISION"), kcdf = 'Gaussian') Validating object structure Updating object slots Ensuring keys are in the proper structure Updating matrix keys for DimReduc 'pca' Updating matrix keys for DimReduc 'umap' Warning: Assay RNA changing from Assay to Assay Warning: Graph RNA_nn changing from Graph to Graph Warning: Graph RNA_snn changing from Graph to Graph Warning: DimReduc pca changing from DimReduc to DimReduc Warning: DimReduc umap changing from DimReduc to DimReduc Ensuring keys are in the proper structure Ensuring feature names don't have underscores or pipes Updating slots in RNA Updating slots in RNA_nn Setting default assay of RNA_nn to RNA Updating slots in RNA_snn Setting default assay of RNA_snn to RNA Updating slots in pca Updating slots in umap Setting umap DimReduc to global Setting assay used for NormalizeData.RNA to RNA Setting assay used for FindVariableFeatures.RNA to RNA Setting assay used for ScaleData.RNA to RNA Setting assay used for RunPCA.RNA to RNA Setting assay used for JackStraw.RNA.pca to RNA No assay information could be found for ScoreJackStraw Setting assay used for FindNeighbors.RNA.pca to RNA No assay information could be found for FindClusters Setting assay used for RunUMAP.RNA.pca to RNA Validating object structure for Assay 'RNA' Validating object structure for Graph 'RNA_nn' Validating object structure for Graph 'RNA_snn' Validating object structure for DimReduc 'pca' Validating object structure for DimReduc 'umap' Object representation is consistent with the most current Seurat version Calculate VISION scores Importing counts from obj[["RNA"]]@counts ... Normalizing to counts per 10,000... Importing Meta Data from obj@meta.data ... Importing latent space from Embeddings(obj, "pca") using first 50 components

Using 13656/13714 genes detected in 0.10% of cells for signature analysis. See the sig_gene_threshold input to change this behavior.

Adding Visualization: Seurat_pca Adding Visualization: Seurat_umap Beginning Analysis

Clustering cells... Using latent space to cluster cells... completed

Projecting data into 2 dimensions...

Evaluating signature scores on cells...

|=================================================================================================================================================================================================================| 100%, Elapsed 00:00 Evaluating signature-gene importance...

|=================================================================================================================================================================================================================| 100%, Elapsed 00:02 Creating 5 background signature groups with the following parameters: sigSize sigBalance 1 19 1 2 42 1 3 72 1 4 112 1 5 164 1 signatures per group: 3000 Computing KNN Cell Graph in the Latent Space...

Evaluating local consistency of signatures in latent space...

|=================================================================================================================================================================================================================| 100%, Elapsed 00:00 |=================================================================================================================================================================================================================| 100%, Elapsed 00:14 |=================================================================================================================================================================================================================| 100%, Elapsed 00:12 |=================================================================================================================================================================================================================| 100%, Elapsed 00:01 Clustering signatures...

fitting ... |================================================================================================================================================================================================================================| 100% Computing differential signature tests...

|=================================================================================================================================================================================================================| 100%, Elapsed 00:00 |=================================================================================================================================================================================================================| 100%, Elapsed 00:02 Computing correlations between signatures and latent space components...

|=================================================================================================================================================================================================================| 100%, Elapsed 00:02 Analysis Complete!

Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-') Finish calculate VISION scores

Pigeongeon commented 4 months ago

【提问Claude-3.5-Sonnet-200k】: pbmc3k.final@version 这个version代表什么?

【Claude-3.5-Sonnet-200k回复】: pbmc3k.final@version 中的 version 代表的是 Seurat 对象的版本,而不是 Seurat 包的版本。这个版本号反映了 Seurat 对象的内部结构和格式。具体来说:

  1. Seurat 对象版本:

    • 这个版本号表示 Seurat 对象的内部结构和数据组织方式。
    • Seurat 团队在更新 Seurat 包时,有时会更改对象的结构,以支持新功能或提高效率。
    • 对象版本号帮助 Seurat 包知道如何正确处理和解释不同版本的对象。
  2. 版本号的意义:

    • 3:表示 Seurat v3 格式的对象
    • 4:表示 Seurat v4 格式的对象
    • 5:表示 Seurat v5 格式的对象(最新)
  3. 重要性:

    • 知道对象版本很重要,因为某些函数可能只适用于特定版本的对象。
    • 如果您使用的是旧版本的对象,可能需要更新对象以使用新版本 Seurat 包的所有功能。
  4. 更新对象:

    • 如果需要,可以使用 UpdateSeuratObject() 函数将旧版本的对象更新到新版本。
  5. 与包版本的区别:

    • 对象版本不一定与您安装的 Seurat 包版本完全对应。
    • 例如,您可能使用 Seurat 4.3.0 包,但处理的是版本 3 的对象。

总之,pbmc3k.final@version 告诉我们这个特定 Seurat 对象的内部结构版本,这对于确保兼容性和正确的数据处理非常重要。如果您在使用某些函数时遇到问题,检查对象版本可能会有所帮助。

Pigeongeon commented 4 months ago

【提问Claude-3.5-Sonnet-200k】: 可以将新版本的对象降级为旧版本的对象吗?

【Claude-3.5-Sonnet-200k回复】: 将新版本的 Seurat 对象降级到旧版本是一个复杂的问题,通常不建议这样做,原因如下: 不支持直接降级: Seurat 包不提供内置的降级功能。 对象版本的更新通常涉及数据结构的改变和新功能的添加,简单地回退这些更改可能会导致数据丢失或不一致。 潜在的数据丢失: 新版本可能包含旧版本不支持的新数据类型或结构。降级可能会导致这些信息的丢失。 功能兼容性问题: 较新版本的对象可能利用了旧版本 Seurat 不支持的功能,降级可能会导致某些分析无法进行。 稳定性和可靠性: 降级过程可能引入错误或不一致,影响后续分析的可靠性。 然而,如果您确实需要使用旧版本的 Seurat 对象(例如,为了与使用旧版本 Seurat 的合作者共享数据),有几种可能的方法: 重新创建对象: 使用原始数据重新创建 Seurat 对象,使用与目标版本兼容的 Seurat 包版本。 这是最安全和可靠的方法,但可能需要重新进行一些预处理步骤。 导出关键数据: 从新版本对象中提取关键数据(如表达矩阵、元数据等)。 使用这些数据在旧版本的 Seurat 中重新构建对象。 使用中间格式: 将数据导出为通用格式(如 AnnData 或 loom 文件)。 然后使用旧版本的 Seurat 重新导入这些数据。 自定义脚本: 为特定的降级需求编写自定义 R 脚本,手动重构对象结构。 这需要深入了解 Seurat 对象的内部结构和版本间的差异。 需要注意的是,这些方法都可能导致一些信息丢失,尤其是新版本特有的功能或数据。 总的来说,虽然技术上可以尝试将新版本对象转换为旧版本,但这个过程复杂且有风险。通常推荐使用最新版本的 Seurat,或者如果必须使用旧版本,考虑从原始数据重新开始分析。

chuiqin commented 4 months ago

首先,请运行这段代码,我已经测试过可以正常运行。这段代码构建了一个Seurat V4对象。

library(irGSEA)
library(Seurat)
library(SeuratData)
library(RcppML)

data("pbmc3k.final")
pbmc3k.final <- SeuratObject::UpdateSeuratObject(pbmc3k.final)
pbmc3k.final2 <- CreateSeuratObject(counts = CreateAssay5Object(GetAssayData(pbmc3k.final, assay = "RNA", slot = "counts")),
                                    meta.data = pbmc3k.final[[]])
pbmc3k.final2 <- NormalizeData(pbmc3k.final2)
DefaultAssay(pbmc3k.final2) <- "RNA"
methods::is(pbmc3k.final2)
class(pbmc3k.final2[["RNA"]])
pbmc3k.final3 <- irGSEA.score(object = pbmc3k.final, assay = "RNA",
                              slot = "counts",ncores = 4,
                              msigdb = T, species = "Homo sapiens", category = "H", geneid = "symbol",
                              method = c("VISION"), kcdf = 'Gaussian')

如果你可以正常运行上面这段代码,请打印你的对象,让我看一下可能出错的环节

methods::is(HCC_endothelium)
class(HCC_endothelium[["RNA"]])
Pigeongeon commented 4 months ago

library(irGSEA) library(Seurat) library(SeuratData) library(RcppML)

data("pbmc3k.final") pbmc3k.final <- SeuratObject::UpdateSeuratObject(pbmc3k.final) Validating object structure Updating object slots Ensuring keys are in the proper structure Updating matrix keys for DimReduc 'pca' Updating matrix keys for DimReduc 'umap' Warning: Assay RNA changing from Assay to Assay Warning: Graph RNA_nn changing from Graph to Graph Warning: Graph RNA_snn changing from Graph to Graph Warning: DimReduc pca changing from DimReduc to DimReduc Warning: DimReduc umap changing from DimReduc to DimReduc Ensuring keys are in the proper structure Ensuring feature names don't have underscores or pipes Updating slots in RNA Updating slots in RNA_nn Setting default assay of RNA_nn to RNA Updating slots in RNA_snn Setting default assay of RNA_snn to RNA Updating slots in pca Updating slots in umap Setting umap DimReduc to global Setting assay used for NormalizeData.RNA to RNA Setting assay used for FindVariableFeatures.RNA to RNA Setting assay used for ScaleData.RNA to RNA Setting assay used for RunPCA.RNA to RNA Setting assay used for JackStraw.RNA.pca to RNA No assay information could be found for ScoreJackStraw Setting assay used for FindNeighbors.RNA.pca to RNA No assay information could be found for FindClusters Setting assay used for RunUMAP.RNA.pca to RNA Validating object structure for Assay 'RNA' Validating object structure for Graph 'RNA_nn' Validating object structure for Graph 'RNA_snn' Validating object structure for DimReduc 'pca' Validating object structure for DimReduc 'umap' Object representation is consistent with the most current Seurat version Warning messages: 1: Adding a command log without an assay associated with it 2: Adding a command log without an assay associated with it pbmc3k.final2 <- CreateSeuratObject(counts = CreateAssay5Object(GetAssayData(pbmc3k.final, assay = "RNA", slot = "counts")),

  • meta.data = pbmc3k.final[[]]) Warning message: The slot argument of GetAssayData() is deprecated as of SeuratObject 5.0.0. ℹ Please use the layer argument instead. This warning is displayed once every 8 hours. Call lifecycle::last_lifecycle_warnings() to see where this warning was generated. pbmc3k.final2 <- NormalizeData(pbmc3k.final2) Normalizing layer: counts Performing log-normalization 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| **| DefaultAssay(pbmc3k.final2) <- "RNA" methods::is(pbmc3k.final2) [1] "Seurat" class(pbmc3k.final2[["RNA"]]) [1] "Assay5" attr(,"package") [1] "SeuratObject" pbmc3k.final3 <- irGSEA.score(object = pbmc3k.final, assay = "RNA",
  • slot = "counts",ncores = 4,
  • msigdb = T, species = "Homo sapiens", category = "H", geneid = "symbol",
  • method = c("VISION"), kcdf = 'Gaussian') Validating object structure Updating object slots Ensuring keys are in the proper structure Updating matrix keys for DimReduc 'pca' Updating matrix keys for DimReduc 'umap' Ensuring keys are in the proper structure Ensuring feature names don't have underscores or pipes Updating slots in RNA Updating slots in RNA_nn Setting default assay of RNA_nn to RNA Updating slots in RNA_snn Setting default assay of RNA_snn to RNA Updating slots in pca Updating slots in umap Setting umap DimReduc to global Setting assay used for NormalizeData.RNA to RNA Setting assay used for FindVariableFeatures.RNA to RNA Setting assay used for ScaleData.RNA to RNA Setting assay used for RunPCA.RNA to RNA Setting assay used for JackStraw.RNA.pca to RNA No assay information could be found for ScoreJackStraw Setting assay used for FindNeighbors.RNA.pca to RNA No assay information could be found for FindClusters Setting assay used for RunUMAP.RNA.pca to RNA Validating object structure for Assay 'RNA' Validating object structure for Graph 'RNA_nn' Validating object structure for Graph 'RNA_snn' Validating object structure for DimReduc 'pca' Validating object structure for DimReduc 'umap' Object representation is consistent with the most current Seurat version Calculate VISION scores Importing counts from obj[["RNA"]]@counts ... Normalizing to counts per 10,000... Importing Meta Data from obj@meta.data ... Importing latent space from Embeddings(obj, "pca") using first 50 components

Using 13656/13714 genes detected in 0.10% of cells for signature analysis. See the sig_gene_threshold input to change this behavior.

Adding Visualization: Seurat_pca Adding Visualization: Seurat_umap Beginning Analysis

Clustering cells... Using latent space to cluster cells... completed

Projecting data into 2 dimensions...

Evaluating signature scores on cells...

|=================================================================================================================================================================================================================| 100%, Elapsed 00:00 Evaluating signature-gene importance...

|=================================================================================================================================================================================================================| 100%, Elapsed 00:01 Creating 5 background signature groups with the following parameters: sigSize sigBalance 1 19 1 2 42 1 3 72 1 4 112 1 5 164 1 signatures per group: 3000 Computing KNN Cell Graph in the Latent Space...

Evaluating local consistency of signatures in latent space...

|=================================================================================================================================================================================================================| 100%, Elapsed 00:00 |=================================================================================================================================================================================================================| 100%, Elapsed 00:19 |=================================================================================================================================================================================================================| 100%, Elapsed 00:11 |=================================================================================================================================================================================================================| 100%, Elapsed 00:01 Clustering signatures...

fitting ... |================================================================================================================================================================================================================================| 100% Computing differential signature tests...

|=================================================================================================================================================================================================================| 100%, Elapsed 00:00 |=================================================================================================================================================================================================================| 100%, Elapsed 00:03 Computing correlations between signatures and latent space components...

|=================================================================================================================================================================================================================| 100%, Elapsed 00:02 Analysis Complete!

Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-') Finish calculate VISION scores

load("Scissor/HCC_endothelium.Rdata") # 加载保存的Seurat对象 methods::is(HCC_endothelium) [1] "Seurat" class(HCC_endothelium[["RNA"]]) [1] "Assay" attr(,"package") [1] "Seurat"

Pigeongeon commented 4 months ago

str(HCC_endothelium) Formal class 'Seurat' [package "SeuratObject"] with 13 slots ..@ assays :List of 1 .. ..$ RNA:Formal class 'Assay' [package "Seurat"] with 8 slots .. .. .. ..@ counts :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots .. .. .. .. .. ..@ i : int [1:19741022] 29 117 197 221 222 240 251 261 285 297 ... .. .. .. .. .. ..@ p : int [1:18044] 0 705 1591 2313 2713 3918 4487 8799 8974 9411 ... .. .. .. .. .. ..@ Dim : int [1:2] 66590 18043 .. .. .. .. .. ..@ Dimnames:List of 2 .. .. .. .. .. .. ..$ : chr [1:66590] "FO538757.2" "AP006222.2" "LINC00115" "FAM41C" ... .. .. .. .. .. .. ..$ : chr [1:18043] "HCC_AGCTTGACAAACTGTC-1" "HCC_ATTGGTGCACCGATAT-1" "HCC_CAACCAAAGAGTCGGT-1" "HCC_CAGAGAGAGCACAGGT-1" ... .. .. .. .. .. ..@ x : num [1:19741022] 2.37 3.02 2.37 2.37 2.37 ... .. .. .. .. .. ..@ factors : list() .. .. .. ..@ data :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots .. .. .. .. .. ..@ i : int [1:19741022] 29 117 197 221 222 240 251 261 285 297 ... .. .. .. .. .. ..@ p : int [1:18044] 0 705 1591 2313 2713 3918 4487 8799 8974 9411 ... .. .. .. .. .. ..@ Dim : int [1:2] 66590 18043 .. .. .. .. .. ..@ Dimnames:List of 2 .. .. .. .. .. .. ..$ : chr [1:66590] "FO538757.2" "AP006222.2" "LINC00115" "FAM41C" ... .. .. .. .. .. .. ..$ : chr [1:18043] "HCC_AGCTTGACAAACTGTC-1" "HCC_ATTGGTGCACCGATAT-1" "HCC_CAACCAAAGAGTCGGT-1" "HCC_CAGAGAGAGCACAGGT-1" ... .. .. .. .. .. ..@ x : num [1:19741022] 2.67 2.9 2.67 2.67 2.67 ... .. .. .. .. .. ..@ factors : list() .. .. .. ..@ scale.data : num [1:2000, 1:18043] -0.2855 -0.3474 -0.4165 -0.196 -0.0874 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:2000] "HES4" "TNFRSF4" "VWA1" "GABRD" ... .. .. .. .. .. ..$ : chr [1:18043] "HCC_AGCTTGACAAACTGTC-1" "HCC_ATTGGTGCACCGATAT-1" "HCC_CAACCAAAGAGTCGGT-1" "HCCCAGAGAGAGCACAGGT-1" ... .. .. .. ..@ assay.orig : NULL .. .. .. ..@ var.features : chr [1:2000] "KCNIP4" "CCL21" "NRG3" "HBB" ... .. .. .. ..@ meta.features:'data.frame': 66590 obs. of 5 variables: .. .. .. .. ..$ vst.mean : num [1:66590] 0.09231 0.07392 0.01677 0.00761 0.0036 ... .. .. .. .. ..$ vst.variance : num [1:66590] 0.18134 0.12495 0.03023 0.01279 0.00726 ... .. .. .. .. ..$ vst.variance.expected : num [1:66590] 0.18224 0.14208 0.03002 0.01317 0.00579 ... .. .. .. .. ..$ vst.variance.standardized: num [1:66590] 0.995 0.879 1.007 0.971 1.253 ... .. .. .. .. ..$ vst.variable : logi [1:66590] FALSE FALSE FALSE FALSE FALSE FALSE ... .. .. .. ..@ misc : NULL .. .. .. ..@ key : Named chr "rna" .. .. .. .. ..- attr(, "names")= chr "" ..@ meta.data :'data.frame': 18043 obs. of 16 variables: .. ..$ orig.ident : chr [1:18043] "HCC_Ankur" "HCC_Ankur" "HCC_Ankur" "HCC_Ankur" ... .. ..$ CellName : chr [1:18043] "HCC_AGCTTGACAAACTGTC-1" "HCC_ATTGGTGCACCGATAT-1" "HCC_CAACCAAAGAGTCGGT-1" "HCC_CAGAGAGAGCACAGGT-1" ... .. ..$ PatientID : chr [1:18043] "P1" "P1" "P1" "P1" ... .. ..$ Tissue : chr [1:18043] "Adj Normal" "Adj Normal" "Adj Normal" "Adj Normal" ... .. ..$ Global_Cluster : chr [1:18043] "Endothelium" "Endothelium" "Endothelium" "Endothelium" ... .. ..$ Sub_Cluster : chr [1:18043] "CD9+ EC" "CD9+ EC" "CD9+ EC" "CD9+ EC" ... .. ..$ Virus : chr [1:18043] "HBV/HCV" "HBV/HCV" "HBV/HCV" "HBV/HCV" ... .. ..$ nCount_RNA : num [1:18043] 1756 2042 1791 1211 2434 ... .. ..$ nFeature_RNA : int [1:18043] 705 886 722 400 1205 569 4312 175 437 960 ... .. ..$ Stage : chr [1:18043] NA NA NA NA ... .. ..$ Relapse : chr [1:18043] NA NA NA NA ... .. ..$ seurat_clusters: Factor w/ 11 levels "0","1","2","3",..: 3 4 9 7 7 9 4 1 3 7 ... .. ..$ UMAP_1 : num [1:18043] -5.12 -4.44 -2.21 -5.55 -6.3 ... .. ..$ UMAP_2 : num [1:18043] -0.453 7.616 5.51 2.428 3.064 ... .. ..$ Release_Cluster: Factor w/ 11 levels "E1","E2","E3",..: 7 1 4 3 3 4 1 8 7 3 ... .. ..$ scissor : num [1:18043] 0 0 0 0 0 0 0 0 0 0 ... ..@ active.assay: chr "RNA" ..@ active.ident: Factor w/ 11 levels "0","1","2","3",..: 3 4 9 7 7 9 4 1 3 7 ... .. ..- attr(, "names")= chr [1:18043] "HCC_AGCTTGACAAACTGTC-1" "HCC_ATTGGTGCACCGATAT-1" "HCC_CAACCAAAGAGTCGGT-1" "HCC_CAGAGAGAGCACAGGT-1" ... ..@ graphs :List of 2 .. ..$ RNA_nn :Formal class 'Graph' [package "SeuratObject"] with 7 slots .. .. .. ..@ assay.used: chr "RNA" .. .. .. ..@ i : int [1:360860] 0 1389 1474 2739 9453 9566 10568 1 10 137 ... .. .. .. ..@ p : int [1:18044] 0 7 21 25 50 69 73 85 97 114 ... .. .. .. ..@ Dim : int [1:2] 18043 18043 .. .. .. ..@ Dimnames :List of 2 .. .. .. .. ..$ : chr [1:18043] "HCC_AGCTTGACAAACTGTC-1" "HCC_ATTGGTGCACCGATAT-1" "HCC_CAACCAAAGAGTCGGT-1" "HCC_CAGAGAGAGCACAGGT-1" ... .. .. .. .. ..$ : chr [1:18043] "HCC_AGCTTGACAAACTGTC-1" "HCC_ATTGGTGCACCGATAT-1" "HCC_CAACCAAAGAGTCGGT-1" "HCC_CAGAGAGAGCACAGGT-1" ... .. .. .. ..@ x : num [1:360860] 1 1 1 1 1 1 1 1 1 1 ... .. .. .. ..@ factors : list() .. ..$ RNA_snn:Formal class 'Graph' [package "SeuratObject"] with 7 slots .. .. .. ..@ assay.used: chr "RNA" .. .. .. ..@ i : int [1:1165257] 0 21 31 139 299 1389 1474 2657 2697 2703 ... .. .. .. ..@ p : int [1:18044] 0 55 118 181 235 286 314 347 395 429 ... .. .. .. ..@ Dim : int [1:2] 18043 18043 .. .. .. ..@ Dimnames :List of 2 .. .. .. .. ..$ : chr [1:18043] "HCC_AGCTTGACAAACTGTC-1" "HCC_ATTGGTGCACCGATAT-1" "HCC_CAACCAAAGAGTCGGT-1" "HCC_CAGAGAGAGCACAGGT-1" ... .. .. .. .. ..$ : chr [1:18043] "HCC_AGCTTGACAAACTGTC-1" "HCC_ATTGGTGCACCGATAT-1" "HCC_CAACCAAAGAGTCGGT-1" "HCC_CAGAGAGAGCACAGGT-1" ... .. .. .. ..@ x : num [1:1165257] 1 0.1111 0.1429 0.0811 0.0811 ... .. .. .. ..@ factors : list() ..@ neighbors : list() ..@ reductions :List of 3 .. ..$ umap :Formal class 'DimReduc' [package "Seurat"] with 9 slots .. .. .. ..@ cell.embeddings : num [1:18043, 1:2] -5.12 -4.44 -2.21 -5.55 -6.3 ... .. .. .. .. ..- attr(, "scaled:center")= num [1:2] -0.0332 -0.2737 .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:18043] "HCC_AGCTTGACAAACTGTC-1" "HCC_ATTGGTGCACCGATAT-1" "HCC_CAACCAAAGAGTCGGT-1" "HCC_CAGAGAGAGCACAGGT-1" ... .. .. .. .. .. ..$ : chr [1:2] "UMAP_1" "UMAP2" .. .. .. ..@ feature.loadings : num[0 , 0 ] .. .. .. ..@ feature.loadings.projected: num[0 , 0 ] .. .. .. ..@ assay.used : chr "integrated" .. .. .. ..@ global : logi TRUE .. .. .. ..@ stdev : num(0) .. .. .. ..@ jackstraw :Formal class 'JackStrawData' [package "Seurat"] with 4 slots .. .. .. .. .. ..@ empirical.p.values : num[0 , 0 ] .. .. .. .. .. ..@ fake.reduction.scores : num[0 , 0 ] .. .. .. .. .. ..@ empirical.p.values.full: num[0 , 0 ] .. .. .. .. .. ..@ overall.p.values : num[0 , 0 ] .. .. .. ..@ misc : list() .. .. .. ..@ key : chr "UMAP" .. ..$ pca :Formal class 'DimReduc' [package "SeuratObject"] with 9 slots .. .. .. ..@ cell.embeddings : num [1:18043, 1:50] 3.46 3.63 3.88 4.51 4.33 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:18043] "HCC_AGCTTGACAAACTGTC-1" "HCC_ATTGGTGCACCGATAT-1" "HCC_CAACCAAAGAGTCGGT-1" "HCC_CAGAGAGAGCACAGGT-1" ... .. .. .. .. .. ..$ : chr [1:50] "PC_1" "PC_2" "PC_3" "PC_4" ... .. .. .. ..@ feature.loadings : num [1:2000, 1:50] -0.04126 0.00117 -0.04894 0.00783 -0.01213 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:2000] "KCNIP4" "CCL21" "NRG3" "HBB" ... .. .. .. .. .. ..$ : chr [1:50] "PC_1" "PC_2" "PC_3" "PC4" ... .. .. .. ..@ feature.loadings.projected: num[0 , 0 ] .. .. .. ..@ assay.used : chr "RNA" .. .. .. ..@ global : logi FALSE .. .. .. ..@ stdev : num [1:50] 10.06 7.03 5.11 4.21 3.36 ... .. .. .. ..@ jackstraw :Formal class 'JackStrawData' [package "SeuratObject"] with 4 slots .. .. .. .. .. ..@ empirical.p.values : num[0 , 0 ] .. .. .. .. .. ..@ fake.reduction.scores : num[0 , 0 ] .. .. .. .. .. ..@ empirical.p.values.full: num[0 , 0 ] .. .. .. .. .. ..@ overall.p.values : num[0 , 0 ] .. .. .. ..@ misc :List of 1 .. .. .. .. ..$ total.variance: num 1040 .. .. .. ..@ key : chr "PC" .. ..$ harmony:Formal class 'DimReduc' [package "SeuratObject"] with 9 slots .. .. .. ..@ cell.embeddings : num [1:18043, 1:50] 3.33 1.11 3.7 4.37 4.25 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:18043] "HCC_AGCTTGACAAACTGTC-1" "HCC_ATTGGTGCACCGATAT-1" "HCC_CAACCAAAGAGTCGGT-1" "HCC_CAGAGAGAGCACAGGT-1" ... .. .. .. .. .. ..$ : chr [1:50] "harmony_1" "harmony_2" "harmony_3" "harmony_4" ... .. .. .. ..@ feature.loadings : num [1:2000, 1:50] 103 4563 -8217 -359 1658 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:2000] "HES4" "TNFRSF4" "VWA1" "GABRD" ... .. .. .. .. .. ..$ : chr [1:50] "harmony_1" "harmony_2" "harmony_3" "harmony_4" ... .. .. .. ..@ feature.loadings.projected: num [1:2000, 1:50] 103 4563 -8217 -359 1658 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:2000] "HES4" "TNFRSF4" "VWA1" "GABRD" ... .. .. .. .. .. ..$ : chr [1:50] "harmony_1" "harmony_2" "harmony_3" "harmony4" ... .. .. .. ..@ assay.used : chr "RNA" .. .. .. ..@ global : logi FALSE .. .. .. ..@ stdev : num [1:50] 8.34 5.44 4.49 3.64 3.17 ... .. .. .. ..@ jackstraw :Formal class 'JackStrawData' [package "SeuratObject"] with 4 slots .. .. .. .. .. ..@ empirical.p.values : num[0 , 0 ] .. .. .. .. .. ..@ fake.reduction.scores : num[0 , 0 ] .. .. .. .. .. ..@ empirical.p.values.full: num[0 , 0 ] .. .. .. .. .. ..@ overall.p.values : num[0 , 0 ] .. .. .. ..@ misc : list() .. .. .. ..@ key : chr "harmony" ..@ images : list() ..@ project.name: chr "SeuratProject" ..@ misc :List of 3 .. ..$ infos6.1 :List of 4 .. .. ..$ para :List of 3 .. .. .. ..$ alpha : num 0.05 .. .. .. ..$ lambda: num 0.00466 .. .. .. ..$ family: chr "binomial" .. .. ..$ Coefs : num [1:18043] 0 0 0 0 0 0 0 0 0 0 ... .. .. ..$ Scissor_pos: chr [1:2541] "HCC_ATTGGTGAGCGTTGCC-2" "HCC_GACGCGTCAGCTGCTG-2" "HCC_GAGCAGAAGGAGTCTG-2" "HCC_GAGTCCGGTCAAACTC-2" ... .. .. ..$ Scissor_neg: chr [1:737] "HCC_TTAGGACCACGCGAAA-8" "HCC_GACCTGGGTTACGTCA-9" "HCC_ACGCAGCTCTTAGAGC-10" "HCC_GCGCAGTTCCTCATTA-16" ... .. ..$ reliability_test_result_endotheliumcell:List of 4 .. .. ..$ statistic : num 0.843 .. .. ..$ p : num 0 .. .. ..$ AUC_test_real: num [1:10] 0.813 0.792 0.734 0.892 0.877 ... .. .. ..$ AUC_test_back:List of 10 .. .. .. ..$ : num [1:10, 1] 0.576 0.406 0.591 0.59 0.453 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:10] "Testing_1" "Testing_2" "Testing_3" "Testing_4" ... .. .. .. .. .. ..$ : chr "AUC" .. .. .. ..$ : num [1:10, 1] 0.579 0.468 0.514 0.66 0.526 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:10] "Testing_1" "Testing_2" "Testing_3" "Testing_4" ... .. .. .. .. .. ..$ : chr "AUC" .. .. .. ..$ : num [1:10, 1] 0.415 0.573 0.421 0.534 0.436 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:10] "Testing_1" "Testing_2" "Testing_3" "Testing_4" ... .. .. .. .. .. ..$ : chr "AUC" .. .. .. ..$ : num [1:10, 1] 0.485 0.591 0.461 0.546 0.497 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:10] "Testing_1" "Testing_2" "Testing_3" "Testing_4" ... .. .. .. .. .. ..$ : chr "AUC" .. .. .. ..$ : num [1:10, 1] 0.573 0.289 0.495 0.457 0.512 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:10] "Testing_1" "Testing_2" "Testing_3" "Testing_4" ... .. .. .. .. .. ..$ : chr "AUC" .. .. .. ..$ : num [1:10, 1] 0.623 0.605 0.455 0.37 0.503 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:10] "Testing_1" "Testing_2" "Testing_3" "Testing_4" ... .. .. .. .. .. ..$ : chr "AUC" .. .. .. ..$ : num [1:10, 1] 0.374 0.667 0.31 0.688 0.462 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:10] "Testing_1" "Testing_2" "Testing_3" "Testing_4" ... .. .. .. .. .. ..$ : chr "AUC" .. .. .. ..$ : num [1:10, 1] 0.558 0.596 0.607 0.491 0.488 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:10] "Testing_1" "Testing_2" "Testing_3" "Testing_4" ... .. .. .. .. .. ..$ : chr "AUC" .. .. .. ..$ : num [1:10, 1] 0.477 0.31 0.755 0.497 0.503 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:10] "Testing_1" "Testing_2" "Testing_3" "Testing_4" ... .. .. .. .. .. ..$ : chr "AUC" .. .. .. ..$ : num [1:10, 1] 0.433 0.775 0.591 0.472 0.617 ... .. .. .. .. ..- attr(, "dimnames")=List of 2 .. .. .. .. .. ..$ : chr [1:10] "Testing_1" "Testing_2" "Testing_3" "Testing_4" ... .. .. .. .. .. ..$ : chr "AUC" .. ..$ evaluate_summary_endotheliumcell :'data.frame': 3278 obs. of 11 variables: .. .. ..$ Mean correlation : num [1:3278] 0.0556 0.0521 0.0548 0.0539 0.1436 ... .. .. ..$ Correlation > 0 : chr [1:3278] "100%" "100%" "100%" "100%" ... .. .. ..$ Correlation < 0 : chr [1:3278] "0%" "0%" "0%" "0%" ... .. .. ..$ Significant Correlation: chr [1:3278] "100%" "100%" "100%" "100%" ... .. .. ..$ Coefficient : num [1:3278] 0.0135 0.017 0.0142 0.0287 0.066 ... .. .. ..$ Beta 0% : num [1:3278] 0.000494 0.000114 0.000459 0.002964 0.017448 ... .. .. ..$ Beta 25% : num [1:3278] 0.00802 0.01068 0.01076 0.01818 0.05563 ... .. .. ..$ Beta 50% : num [1:3278] 0.0138 0.0221 0.0181 0.0272 0.067 ... .. .. ..$ Beta 75% : num [1:3278] 0.0194 0.0335 0.0342 0.0421 0.0778 ... .. .. ..$ Beta 100% : num [1:3278] 0.0316 0.0647 0.0593 0.0844 0.0994 ... .. .. ..$ Probability of zero : num [1:3278] 0.08 0.16 0.2 0.05 0 0.06 0.48 0.35 0.2 0 ... ..@ version :Classes 'package_version', 'numeric_version' hidden list of 1 .. ..$ : int [1:3] 3 2 1 ..@ commands :List of 7 .. ..$ FindIntegrationAnchors :Formal class 'SeuratCommand' [package "Seurat"] with 5 slots .. .. .. ..@ name : chr "FindIntegrationAnchors" .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2022-11-24 08:36:01" .. .. .. ..@ assay.used : Named chr [1:4] "RNA" "RNA" "RNA" "RNA" .. .. .. .. ..- attr(, "names")= chr [1:4] "HCC_Ankur" "HCC_Lu" "HCC_Ma" "HCC_Filliol" .. .. .. ..@ call.string: chr [1:2] "FindIntegrationAnchors(object.list = HCC_atlas_endothelium.list, " " anchor.features = features)" .. .. .. ..@ params :List of 14 .. .. .. .. ..$ assay : Named chr [1:4] "RNA" "RNA" "RNA" "RNA" .. .. .. .. .. ..- attr(, "names")= chr [1:4] "HCC_Ankur" "HCC_Lu" "HCC_Ma" "HCC_Filliol" .. .. .. .. ..$ anchor.features : chr [1:2000] "LYPD2" "HBA1" "APOD" "HSPA6" ... .. .. .. .. ..$ scale : logi TRUE .. .. .. .. ..$ normalization.method: chr "LogNormalize" .. .. .. .. ..$ reduction : chr "cca" .. .. .. .. ..$ l2.norm : logi TRUE .. .. .. .. ..$ dims : int [1:30] 1 2 3 4 5 6 7 8 9 10 ... .. .. .. .. ..$ k.anchor : num 5 .. .. .. .. ..$ k.filter : num 200 .. .. .. .. ..$ k.score : num 30 .. .. .. .. ..$ max.features : num 200 .. .. .. .. ..$ nn.method : chr "rann" .. .. .. .. ..$ eps : num 0 .. .. .. .. ..$ verbose : logi TRUE .. ..$ NormalizeData.RNA :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots .. .. .. ..@ name : chr "NormalizeData.RNA" .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2024-06-28 10:19:31" .. .. .. ..@ assay.used : chr "RNA" .. .. .. ..@ call.string: chr "NormalizeData(scRNA_harmony)" .. .. .. ..@ params :List of 5 .. .. .. .. ..$ assay : chr "RNA" .. .. .. .. ..$ normalization.method: chr "LogNormalize" .. .. .. .. ..$ scale.factor : num 10000 .. .. .. .. ..$ margin : num 1 .. .. .. .. ..$ verbose : logi TRUE .. ..$ FindVariableFeatures.RNA :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots .. .. .. ..@ name : chr "FindVariableFeatures.RNA" .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2024-06-28 10:19:34" .. .. .. ..@ assay.used : chr "RNA" .. .. .. ..@ call.string: chr "FindVariableFeatures(.)" .. .. .. ..@ params :List of 12 .. .. .. .. ..$ assay : chr "RNA" .. .. .. .. ..$ selection.method : chr "vst" .. .. .. .. ..$ loess.span : num 0.3 .. .. .. .. ..$ clip.max : chr "auto" .. .. .. .. ..$ mean.function :function (mat, display_progress)
.. .. .. .. ..$ dispersion.function:function (mat, display_progress)
.. .. .. .. ..$ num.bin : num 20 .. .. .. .. ..$ binning.method : chr "equalwidth" .. .. .. .. ..$ nfeatures : num 2000 .. .. .. .. ..$ mean.cutoff : num [1:2] 0.1 8 .. .. .. .. ..$ dispersion.cutoff : num [1:2] 1 Inf .. .. .. .. ..$ verbose : logi TRUE .. ..$ ScaleData.RNA :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots .. .. .. ..@ name : chr "ScaleData.RNA" .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2024-06-28 10:19:35" .. .. .. ..@ assay.used : chr "RNA" .. .. .. ..@ call.string: chr "ScaleData(.)" .. .. .. ..@ params :List of 10 .. .. .. .. ..$ features : chr [1:2000] "KCNIP4" "CCL21" "NRG3" "HBB" ... .. .. .. .. ..$ assay : chr "RNA" .. .. .. .. ..$ model.use : chr "linear" .. .. .. .. ..$ use.umi : logi FALSE .. .. .. .. ..$ do.scale : logi TRUE .. .. .. .. ..$ do.center : logi TRUE .. .. .. .. ..$ scale.max : num 10 .. .. .. .. ..$ block.size : num 1000 .. .. .. .. ..$ min.cells.to.block: num 3000 .. .. .. .. ..$ verbose : logi TRUE .. ..$ RunPCA.RNA :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots .. .. .. ..@ name : chr "RunPCA.RNA" .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2024-06-28 10:19:48" .. .. .. ..@ assay.used : chr "RNA" .. .. .. ..@ call.string: chr "RunPCA(., verbose = FALSE)" .. .. .. ..@ params :List of 10 .. .. .. .. ..$ assay : chr "RNA" .. .. .. .. ..$ npcs : num 50 .. .. .. .. ..$ rev.pca : logi FALSE .. .. .. .. ..$ weight.by.var : logi TRUE .. .. .. .. ..$ verbose : logi FALSE .. .. .. .. ..$ ndims.print : int [1:5] 1 2 3 4 5 .. .. .. .. ..$ nfeatures.print: num 30 .. .. .. .. ..$ reduction.name : chr "pca" .. .. .. .. ..$ reduction.key : chr "PC" .. .. .. .. ..$ seed.use : num 42 .. ..$ Seurat..ProjectDim.RNA.harmony:Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots .. .. .. ..@ name : chr "Seurat::ProjectDim.RNA.harmony" .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2024-06-28 10:20:02" .. .. .. ..@ assay.used : chr "RNA" .. .. .. ..@ call.string: chr [1:2] "Seurat::ProjectDim(object, reduction = reduction.save, overwrite = TRUE, " " verbose = FALSE)" .. .. .. ..@ params :List of 7 .. .. .. .. ..$ reduction : chr "harmony" .. .. .. .. ..$ assay : chr "RNA" .. .. .. .. ..$ dims.print : int [1:5] 1 2 3 4 5 .. .. .. .. ..$ nfeatures.print: num 20 .. .. .. .. ..$ overwrite : logi TRUE .. .. .. .. ..$ do.center : logi FALSE .. .. .. .. ..$ verbose : logi FALSE .. ..$ FindNeighbors.RNA.pca :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots .. .. .. ..@ name : chr "FindNeighbors.RNA.pca" .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2024-06-28 10:21:02" .. .. .. ..@ assay.used : chr "RNA" .. .. .. ..@ call.string: chr "FindNeighbors(scRNA_harmony, dims = 1:11)" .. .. .. ..@ params :List of 16 .. .. .. .. ..$ reduction : chr "pca" .. .. .. .. ..$ dims : int [1:11] 1 2 3 4 5 6 7 8 9 10 ... .. .. .. .. ..$ assay : chr "RNA" .. .. .. .. ..$ k.param : num 20 .. .. .. .. ..$ return.neighbor: logi FALSE .. .. .. .. ..$ compute.SNN : logi TRUE .. .. .. .. ..$ prune.SNN : num 0.0667 .. .. .. .. ..$ nn.method : chr "annoy" .. .. .. .. ..$ n.trees : num 50 .. .. .. .. ..$ annoy.metric : chr "euclidean" .. .. .. .. ..$ nn.eps : num 0 .. .. .. .. ..$ verbose : logi TRUE .. .. .. .. ..$ do.plot : logi FALSE .. .. .. .. ..$ graph.name : chr [1:2] "RNA_nn" "RNA_snn" .. .. .. .. ..$ l2.norm : logi FALSE .. .. .. .. ..$ cache.index : logi FALSE ..@ tools :List of 1 .. ..$ Integration:Formal class 'IntegrationData' [package "Seurat"] with 7 slots .. .. .. ..@ neighbors : NULL .. .. .. ..@ weights : NULL .. .. .. ..@ integration.matrix: NULL .. .. .. ..@ anchors :'data.frame': 48042 obs. of 5 variables: .. .. .. .. ..$ cell1 : num [1:48042] 2 2 2 3 3 6 6 7 7 7 ... .. .. .. .. ..$ cell2 : num [1:48042] 3056 2993 3048 2262 2791 ... .. .. .. .. ..$ score : num [1:48042] 0.704 0.815 0.519 0.185 0.222 ... .. .. .. .. ..$ dataset1: int [1:48042] 1 1 1 1 1 1 1 1 1 1 ... .. .. .. .. ..$ dataset2: int [1:48042] 2 2 2 2 2 2 2 2 2 2 ... .. .. .. ..@ offsets : NULL .. .. .. ..@ objects.ncell : NULL .. .. .. ..@ sample.tree : num [1:3, 1:2] -1 1 2 -4 -2 -3

chuiqin commented 4 months ago

一个合理的猜测是细胞数过多或者ncore过大,请尝试subset 2000个细胞来测试一下

HCC_endothelium2 <- irGSEA.score(object = HCC_endothelium[,1:2000], assay = "RNA",
                              slot = "counts",ncores = 4,
                              msigdb = T, species = "Homo sapiens", category = "H", geneid = "symbol",
                              method = c("VISION"), kcdf = 'Gaussian')
Pigeongeon commented 4 months ago

HCC_endothelium2 <- irGSEA.score(object = HCC_endothelium[,1:2000], assay = "RNA",

  • slot = "counts",ncores = 4,
  • msigdb = T, species = "Homo sapiens", category = "H", geneid = "symbol",
  • method = c("VISION"), kcdf = 'Gaussian') Validating object structure Updating object slots Ensuring keys are in the proper structure Updating matrix keys for DimReduc 'umap' Updating matrix keys for DimReduc 'pca' Updating matrix keys for DimReduc 'harmony' Warning: Assay RNA changing from Assay to Assay Warning: DimReduc umap changing from DimReduc to DimReduc Warning: Adding a dimensional reduction (umap) without the associated assay being present Ensuring keys are in the proper structure Warning: Adding a dimensional reduction (umap) without the associated assay being present Ensuring feature names don't have underscores or pipes Warning: Adding a dimensional reduction (umap) without the associated assay being present Updating slots in RNA Updating slots in RNA_nn Setting default assay of RNA_nn to RNA Updating slots in RNA_snn Setting default assay of RNA_snn to RNA Updating slots in umap Setting umap DimReduc to global Warning: Adding a dimensional reduction (umap) without the associated assay being present Updating slots in pca Updating slots in harmony No assay information could be found for FindIntegrationAnchors Setting assay used for NormalizeData.RNA to RNA Setting assay used for FindVariableFeatures.RNA to RNA Setting assay used for ScaleData.RNA to RNA Setting assay used for RunPCA.RNA to RNA Setting assay used for Seurat..ProjectDim.RNA.harmony to RNA Setting assay used for FindNeighbors.RNA.pca to RNA Validating object structure for Assay 'RNA' Validating object structure for Graph 'RNA_nn' Validating object structure for Graph 'RNA_snn' Validating object structure for DimReduc 'umap' Validating object structure for DimReduc 'pca' Validating object structure for DimReduc 'harmony' Object representation is consistent with the most current Seurat version Calculate VISION scores Importing counts from obj[["RNA"]]@counts ... Normalizing to counts per 10,000... Importing Meta Data from obj@meta.data ... Importing latent space from Embeddings(obj, "pca") using first 50 components

Using 14317/66590 genes detected in 0.10% of cells for signature analysis. See the sig_gene_threshold input to change this behavior.

Dropping 'CellName' from meta data as it is of type 'character' and has more than 20 unique values. If you want to include this meta data variable, convert it to a factor before providing the data frame to Vision Adding Visualization: Seurat_umap Adding Visualization: Seurat_pca Adding Visualization: Seurat_harmony Beginning Analysis

Clustering cells... Using latent space to cluster cells... completed

Projecting data into 2 dimensions...

Evaluating signature scores on cells...

|==================================================================================================================================================================================| 100%, Elapsed 00:01 Evaluating signature-gene importance...

|==================================================================================================================================================================================| 100%, Elapsed 00:02 Creating 5 background signature groups with the following parameters: sigSize sigBalance 1 13 1 2 39 1 3 88 1 4 153 1 5 181 1 signatures per group: 3000 Computing KNN Cell Graph in the Latent Space...

Evaluating local consistency of signatures in latent space...

|==================================================================================================================================================================================| 100%, Elapsed 00:00 |==================================================================================================================================================================================| 100%, Elapsed 00:35 |==================================================================================================================================================================================| 100%, Elapsed 00:18 |==================================================================================================================================== | 73%, ETA 00:01 Error: $ operator is invalid for atomic vectors

加载保存的Seurat对象:

load("HCC_Hepatocyte.Rdata") load("HCC_Bcell.Rdata") load("HCC_endothelium.Rdata") load("HCC_fibroblast.Rdata") load("HCC_TNK.Rdata") load("HCC_Myeloid.Rdata")

检查Seurat对象版本:

check_seurat_version <- function(object_name) { object <- get(object_name) if (inherits(object, "Seurat")) { version <- object@version cat(paste0(object_name, " 是 Seurat 版本 ", version, "\n")) } else { cat(paste0(object_name, " 不是 Seurat 对象\n")) } }

检查每个对象是什么版本:

check_seurat_version("HCC_Hepatocyte") # 73203个细胞

HCC_Hepatocyte 是 Seurat 版本 3.2.1

check_seurat_version("HCC_Bcell") # 7742个细胞

HCC_Bcell 是 Seurat 版本 3.2.1

check_seurat_version("HCC_endothelium") # 18043个细胞

HCC_endothelium 是 Seurat 版本 5.0.1 #【运行VISION失败!】

check_seurat_version("HCC_fibroblast") # 6163个细胞

HCC_fibroblast 是 Seurat 版本 5.0.1 #【运行VISION失败!】

check_seurat_version("HCC_TNK") # 112241个细胞

HCC_TNK 是 Seurat 版本 3.2.1

check_seurat_version("HCC_Myeloid") # 34369个细胞

HCC_Myeloid 是 Seurat 版本 3.2.1

Seurat 版本 3.2.1的四个对象都运行VISION成功了,包括十万级细胞量的HCC_TNK

而Seurat 版本 5.0.1的HCC_endothelium和HCC_fibroblast都运行VISION失败

Pigeongeon commented 4 months ago

irGSEA涉及到的所有r包名的向量

irGSEA_need_packages <- c("aplot", "BiocManager", "circlize", "cowplot", "data.table",

  • "devtools", "doParallel", "doRNG", "dplyr", "ggfun", "gghalves",
  • "ggplot2", "ggplotify", "ggridges", "ggsci", "irlba", "magrittr",
  • "Matrix", "msigdbr", "pagoda2", "plyr", "pointr", "purrr", "RcppML",
  • "readr", "reshape2", "reticulate", "rlang", "RMTstat",
  • "RobustRankAggreg", "roxygen2", "Seurat", "SeuratObject", "stringr",
  • "tibble", "tidyr", "tidyselect", "tidytree", "VAM",
  • "AUCell", "BiocParallel", "ComplexHeatmap", "decoupleR", "fgsea",
  • "ggtree", "GSEABase", "GSVA", "Nebulosa", "scde", "singscore",
  • "SummarizedExperiment", "UCell", "viper", "sparseMatrixStats",
  • "irGSEA", "VISION", "ranger", "gficf", "SeuratDisk", "sargent")

检查每个包的版本

for (pkg in irGSEA_need_packages) {

  • if (requireNamespace(pkg, quietly = TRUE)) {
  • cat(pkg, ": ", as.character(packageVersion(pkg)), "\n")
  • } else {
  • cat(pkg, ": Not installed\n")
  • }
  • }

aplot : 0.2.2 BiocManager : 1.30.22 circlize : 0.4.16 cowplot : 1.1.3 data.table : 1.15.4 devtools : 2.4.5 doParallel : 1.0.17 doRNG : 1.8.6 dplyr : 1.1.4 ggfun : 0.1.4 gghalves : 0.1.4 ggplot2 : 3.5.1 ggplotify : 0.1.2 ggridges : 0.5.6 ggsci : 3.0.3 irlba : 2.3.5.1 magrittr : 2.0.3 Matrix : 1.6.5 msigdbr : 7.5.1 pagoda2 : 1.0.12 plyr : 1.8.9 pointr : 0.2.0 purrr : 1.0.2 RcppML : 0.5.6 readr : 2.1.5 reshape2 : 1.4.4 reticulate : 1.36.1 rlang : 1.1.3 RMTstat : 0.3.1 RobustRankAggreg : 1.2 roxygen2 : 7.3.1 Seurat : 5.0.3 SeuratObject : 5.0.1 stringr : 1.5.1 tibble : 3.2.1 tidyr : 1.3.1 tidyselect : 1.2.1 tidytree : 0.4.6 VAM : 1.1.0 AUCell : 1.24.0 BiocParallel : 1.36.0 ComplexHeatmap : 2.18.0 decoupleR : 2.9.7 fgsea : 1.28.0 ggtree : 3.10.1 GSEABase : 1.64.0 GSVA : 1.50.5 Nebulosa : 1.0.1 scde : 2.30.0 singscore : 1.22.0 SummarizedExperiment : 1.32.0 UCell : 2.9.0 viper : 1.36.0 sparseMatrixStats : 1.14.0 irGSEA : 3.3.0 VISION : 3.0.1 ranger : 0.16.0 gficf : 2.0.0 SeuratDisk : 0.0.0.9021 sargent : 1.0.1

library(reticulate) use_condaenv("irGSEA")

irGSEA涉及到的所有python包名的向量

irGSEA_need_python_packages <- c("anndata", "scanpy", "argparse", "gseapy", "decoupler") for (pkg in irGSEA_need_python_packages) {

  • version <- py_eval(sprintf("import('%s').version", pkg))
  • cat(pkg, ": ", version, "\n")
  • }

anndata : 0.10.8 scanpy : 1.10.2 argparse : 1.1 gseapy : 1.1.3 decoupler : 1.7.0

chuiqin commented 4 months ago

有意思的事,我创建了pbmc3k.final2,它是Seurat V5版本,却可以运行成功。 你是否方便加我微信fcq065837,分享给我HCC_endothelium前2000个细胞的rds文件让我测试一下。

#### Seurat V5对象 ####
library(irGSEA)
library(Seurat)
library(SeuratData)
library(RcppML)

data("pbmc3k.final")
pbmc3k.final <- SeuratObject::UpdateSeuratObject(pbmc3k.final)
pbmc3k.final2 <- CreateSeuratObject(counts = CreateAssay5Object(GetAssayData(pbmc3k.final, assay = "RNA", slot = "counts")),
                                    meta.data = pbmc3k.final[[]])
pbmc3k.final2 <- NormalizeData(pbmc3k.final2)
DefaultAssay(pbmc3k.final2) <- "RNA"

methods::is(pbmc3k.final2)
class(pbmc3k.final2[["RNA"]])

check_seurat_version <- function(object_name) {
  object <- get(object_name)
  if (inherits(object, "Seurat")) {
    version <- object@version
    cat(paste0(object_name, " 是 Seurat 版本 ", version, "\n"))
  } else {
    cat(paste0(object_name, " 不是 Seurat 对象\n"))
  }
}

check_seurat_version("pbmc3k.final2") # pbmc3k.final2 是 Seurat 版本 5.0.1
> pbmc3k.final3 <- irGSEA.score(object = pbmc3k.final2, assay = "RNA",
+                               slot = "counts",ncores = 4,
+                               msigdb = T, species = "Homo sapiens", category = "H", geneid = "symbol",
+                               method = c("VISION"), kcdf = 'Gaussian')
Validating object structure
Updating object slots
Ensuring keys are in the proper structure
Ensuring keys are in the proper structure
Ensuring feature names don't have underscores or pipes
Updating slots in RNA
Setting assay used for NormalizeData.RNA to RNA
Validating object structure for Assay5 ‘RNA’
Object representation is consistent with the most current Seurat version
Warning: No layers found matching search pattern provided
Warning: No layers found matching search pattern provided
Warning: Assay RNA changing from Assay5 to Assay
Calculate VISION scores
Performing log-normalization
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Centering and scaling data matrix
  |==============================================================================| 100%
Importing counts from obj[["RNA"]]@counts ...
Normalizing to counts per 10,000...
Importing Meta Data from obj@meta.data ...
Importing latent space from Embeddings(obj, "pca") using first 50 components

Using 13656/13714 genes detected in 0.10% of cells for signature analysis.
See the `sig_gene_threshold` input to change this behavior.

Adding Visualization: Seurat_pca
Beginning Analysis

Clustering cells...
Using latent space to cluster cells...
completed

Projecting data into 2 dimensions...

Evaluating signature scores on cells...

  |===============================================================| 100%, Elapsed 00:00
Evaluating signature-gene importance...

  |===============================================================| 100%, Elapsed 00:01
Creating 5 background signature groups with the following parameters:
  sigSize sigBalance
1      21          1
2      59          1
3      88          1
4     129          1
5     170          1
  signatures per group: 3000
Computing KNN Cell Graph in the Latent Space...

Evaluating local consistency of signatures in latent space...

  |===============================================================| 100%, Elapsed 00:00
  |===============================================================| 100%, Elapsed 00:07
  |===============================================================| 100%, Elapsed 00:04
  |===============================================================| 100%, Elapsed 00:01
Clustering signatures...

fitting ...
  |==============================================================================| 100%
Computing differential signature tests...

  |===============================================================| 100%, Elapsed 00:00
  |===============================================================| 100%, Elapsed 00:01
Computing correlations between signatures and latent space components...

  |===============================================================| 100%, Elapsed 00:01
Analysis Complete!

Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-')
Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-')
Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-')
Finish calculate VISION scores
Warning: Assay RNA changing from Assay to Assay5
Warning: Assay VISION changing from Assay to Assay5
chuiqin commented 3 months ago

错误的发生是Seurat对象的meta.data里面的一些列存在NA值,这个NA值会导致VISION的analysis函数报错 只需要简单修改就可以运行VISON,不需要修改Seurat对象的版本

> # 查找包含NA值的列
> meta.data_na_cols <- HCC_endothelium@meta.data %>% dplyr::select(where(~ any(is.na(.))))
> # 查找不包含NA值的列
> meta.data_non_na_cols <- HCC_endothelium@meta.data %>% dplyr::select(where(~ !any(is.na(.))))
> # 将原来的meta.data存起来
> meta.data_orgin <- HCC_endothelium@meta.data
> HCC_endothelium@meta.data <- meta.data_non_na_cols
> HCC_endothelium <- irGSEA.score(object = HCC_endothelium, assay = "RNA",
+                      slot = "counts",ncores = 4,
+                      msigdb = T, species = "Homo sapiens", category = "H", geneid = "symbol",
+                      method = c("VISION"), kcdf = 'Gaussian')
Validating object structure
Updating object slots
Ensuring keys are in the proper structure
Updating matrix keys for DimReduc 'umap'
Updating matrix keys for DimReduc 'pca'
Updating matrix keys for DimReduc 'harmony'
Warning: Assay RNA changing from Assay to Assay
Warning: DimReduc umap changing from DimReduc to DimReduc
Warning: Adding a dimensional reduction (umap) without the associated assay being present
Ensuring keys are in the proper structure
Warning: Adding a dimensional reduction (umap) without the associated assay being present
Ensuring feature names don't have underscores or pipes
Warning: Adding a dimensional reduction (umap) without the associated assay being present
Updating slots in RNA
Updating slots in RNA_nn
Setting default assay of RNA_nn to RNA
Updating slots in RNA_snn
Setting default assay of RNA_snn to RNA
Updating slots in umap
Setting umap DimReduc to global
Warning: Adding a dimensional reduction (umap) without the associated assay being present
Updating slots in pca
Updating slots in harmony
No assay information could be found for FindIntegrationAnchors
Setting assay used for NormalizeData.RNA to RNA
Setting assay used for FindVariableFeatures.RNA to RNA
Setting assay used for ScaleData.RNA to RNA
Setting assay used for RunPCA.RNA to RNA
Setting assay used for Seurat..ProjectDim.RNA.harmony to RNA
Setting assay used for FindNeighbors.RNA.pca to RNA
Validating object structure for Assay 'RNA'
Validating object structure for Graph 'RNA_nn'
Validating object structure for Graph 'RNA_snn'
Validating object structure for DimReduc 'umap'
Validating object structure for DimReduc 'pca'
Validating object structure for DimReduc 'harmony'
Object representation is consistent with the most current Seurat version
Calculate VISION scores
Importing counts from obj[["RNA"]]@counts ...
Normalizing to counts per 10,000...
Importing Meta Data from obj@meta.data ...
Importing latent space from Embeddings(obj, "pca") using first 50 components

Using 17514/66590 genes detected in 0.10% of cells for signature analysis.
See the `sig_gene_threshold` input to change this behavior.

Dropping 'CellName' from meta data as it is of type 'character' and has more than 20 unique values.  If you want to include this meta data variable, convert it to a factor before providing the data frame to Vision
Dropping 'PatientID' from meta data as it is of type 'character' and has more than 20 unique values.  If you want to include this meta data variable, convert it to a factor before providing the data frame to Vision
Adding Visualization: Seurat_umap
Adding Visualization: Seurat_pca
Adding Visualization: Seurat_harmony
Beginning Analysis

Clustering cells...
Using latent space to cluster cells...
completed

Projecting data into 2 dimensions...

Evaluating signature scores on cells...

  |===============================================================| 100%, Elapsed 00:01
Evaluating signature-gene importance...

  |===============================================================| 100%, Elapsed 00:02
Creating 5 background signature groups with the following parameters:
  sigSize sigBalance
1      37          1
2      92          1
3     144          1
4     175          1
5     192          1
  signatures per group: 3000
Computing KNN Cell Graph in the Latent Space...

Evaluating local consistency of signatures in latent space...

  |===============================================================| 100%, Elapsed 00:01
  |===============================================================| 100%, Elapsed 02:51
  |===============================================================| 100%, Elapsed 02:44
  |===============================================================| 100%, Elapsed 00:02
Clustering signatures...

fitting ...
  |==============================================================================| 100%
Computing differential signature tests...

  |===============================================================| 100%, Elapsed 00:02
  |===============================================================| 100%, Elapsed 00:14
Computing correlations between signatures and latent space components...

  |===============================================================| 100%, Elapsed 00:04
Analysis Complete!

Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-')
Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-')
Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-')
Finish calculate VISION scores
> # 恢复原来的meta.data
> HCC_endothelium@meta.data <- meta.data_orgin
chuiqin commented 3 months ago

为了规避类似的错误发生,我在irGSEA.score代码中有关于VISION的部分打了补丁,并将irGSEA更新到3.3.1版本。更新新版本后,使用irGSEA进行VISION打分将不会出现类似问题。