sulab-wmu / scPagwas

Obtain trait-relevant cell subpopulations by incorporating pathway activity transformed scRNA-seq data with GWAS data
Other
33 stars 9 forks source link

Linux系統scPagwas_main報錯 #17

Open jfckkiu opened 10 months ago

jfckkiu commented 10 months ago

作者您好,非常令人深刻的工作,目前我在重复示例相关工作时,通过Linux系统首先通过Conda建环境,包括用conda安装GenomicRanges和IRanges,在JupyterLab下面运行示例代码:

system.time(
 #1.start to run the wrapper functions for example.
 Pagwas_data<-scPagwas_main(Pagwas = NULL,
                     gwas_data =system.file("extdata", "GWAS_summ_example.txt", package = "scPagwas"), # The GWAS Summary statistics files 
                     Single_data =system.file("extdata", "scRNAexample.rds", package = "scPagwas"),# scRNA-seq data in seruat format with "RNA" assays and normalized.
                     output.prefix="test", # the prefix name for output files
                     output.dirs="scPagwastest_output",# the directory file's name for output
                     block_annotation = block_annotation_hg37,# gene position in chromosome is provided by package. default is hg38, block_annotation_hg37 is hg37.
                     assay="RNA", # the assays for scRNA-seq data to use.
                     Pathway_list=Genes_by_pathway_kegg,# pathway list is provided by package, including gene symbols.
                     n.cores=1,
                     iters_singlecell = 10,
                     chrom_ld = chrom_ld,# The LD data is provided by package.
                     singlecell=T, # Whether to run the singlecell process.
                     celltype=T# Whether to run the celltype process.
)
)

JupyterLab报错如下:

##------ Wed Nov 15 19:14:32 2023 ------## ******* 1st: Single_data_input function start! ********

** Start to read the single cell data!

** Start to filter single cell data!

Input single cell data!

10 cell types are remain, after filter!

done!

##------ Wed Nov 15 19:14:36 2023 ------## ******* 2nd: Pathway_pcascore_run function start!! ********

* Start to get Pathway SVD socre!

  |                                                                      |   0%
Error in names(x) <- value: 'names' attribute [88] must be the same length as the vector [0]
Traceback:

1. system.time(Pagwas_data <- scPagwas_main(Pagwas = NULL, gwas_data = system.file("extdata", 
 .     "GWAS_summ_example.txt", package = "scPagwas"), Single_data = system.file("extdata", 
 .     "scRNAexample.rds", package = "scPagwas"), output.prefix = "test", 
 .     output.dirs = "scPagwastest_output", block_annotation = block_annotation_hg37, 
 .     assay = "RNA", Pathway_list = Genes_by_pathway_kegg, n.cores = 1, 
 .     iters_singlecell = 10, chrom_ld = chrom_ld, singlecell = T, 
 .     celltype = T))
2. scPagwas_main(Pagwas = NULL, gwas_data = system.file("extdata", 
 .     "GWAS_summ_example.txt", package = "scPagwas"), Single_data = system.file("extdata", 
 .     "scRNAexample.rds", package = "scPagwas"), output.prefix = "test", 
 .     output.dirs = "scPagwastest_output", block_annotation = block_annotation_hg37, 
 .     assay = "RNA", Pathway_list = Genes_by_pathway_kegg, n.cores = 1, 
 .     iters_singlecell = 10, chrom_ld = chrom_ld, singlecell = T, 
 .     celltype = T)
3. Pathway_pcascore_run(Pagwas = Pagwas, Pathway_list = Pathway_list, 
 .     min.pathway.size = min.pathway.size, max.pathway.size = max.pathway.size)
4. lapply(celltypes, function(celltype) {
 .     scCounts <- Pagwas$data_mat[, Pagwas$Celltype_anno$cellnames[Pagwas$Celltype_anno$annotation == 
 .         celltype]]
 .     if (!inherits(scCounts, "matrix")) {
 .         scCounts <- as_matrix(scCounts)
 .     }
 .     scPCAscore <- PathwayPCAtest(Pathway_list = Pagwas$Pathway_list, 
 .         scCounts = scCounts)
 .     setTxtProgressBar(pb, which(celltypes == celltype)/length(celltypes))
 .     print(celltype)
 .     return(scPCAscore)
 . })
5. FUN(X[[i]], ...)
6. PathwayPCAtest(Pathway_list = Pagwas$Pathway_list, scCounts = scCounts)
7. `colnames<-`(`*tmp*`, value = rownames(scCounts))
Timing stopped at: 6.304 0.093 7.31

我在多个LINUX系统中安装,测试时候都出现类似问题,请问该怎么解决,您所做的工作对我们非常重要,期待您的答复,谢谢!

dengchunyu commented 10 months ago

你的问题我没有遇到过,我在我的linux环境中删除包又重新安装仍然没有遇见你的问题,下面说说我的建议: 1.conda 新建环境scPagwas 2.安装R和一些必要的包: source activate scPagwas conda install r-base #conda现在默认安装4.3版本 conda install r-Seurat conda install r-ggpubr conda install r-devtools conda install r-BiocManager 3.进入R环境 install.packages("BiocManager") BiocManager::install("GenomicRanges") devtools::install_github("sulab-wmu/scPagwas") 4.测试例子 请按照以上安装流程重新安装。看看是不是还有错误。 另外,建议你在window中安装scPagwas进行测试,如果没有问题那可能是linux的问题。

1667857557 commented 10 months ago

我在window也遇到了同样的报错,换个数据又行了,可能是数据本身格式的问题

jfckkiu commented 10 months ago

作者您好,

你的问题我没有遇到过,我在我的linux环境中删除包又重新安装仍然没有遇见你的问题,下面说说我的建议: 1.conda 新建环境scPagwas 2.安装R和一些必要的包: source activate scPagwas conda install r-base #conda现在默认安装4.3版本 conda install r-Seurat conda install r-ggpubr conda install r-devtools conda install r-BiocManager 3.进入R环境 install.packages("BiocManager") BiocManager::install("GenomicRanges") devtools::install_github("sulab-wmu/scPagwas") 4.测试例子 请按照以上安装流程重新安装。看看是不是还有错误。 另外,建议你在window中安装scPagwas进行测试,如果没有问题那可能是linux的问题。

作者您好,经过这几天调试,我发现这可能是潜在的一个问题,我一开始由于GITHUB镜像连接不上,选择的是您目录里面的超链接下载的tar.gz文件,然后使用devtools::install_local("sulab-wmu-scPagwas-****.tar.gz"),后续修改至git clone下载相关git目录文件,再通过devtools::install_local()相关文件夹,成功运行,不知是否是您github上的超链接tar.gz文件可能不适配相关这个版本,最后感谢您的回复

dengchunyu commented 10 months ago

最后一个安装方法确实是版本落后了,这个方法是在前面都失败的情况下的尝试,现在删除了这种方式

dengchunyu commented 10 months ago

我把安装包放在百度云盘上,连接不上github或者无法翻墙的可以从这里下载,我会和github同步更新的 链接:https://pan.baidu.com/s/1X7pRzevQUIfLIATd2I0Dvw?pwd=1234 提取码:1234

haitianyisee commented 10 months ago

我在windows安装了github的版本也是报同样的错QAQ

dengchunyu commented 10 months ago

我在windows安装了github的版本也是报同样的错QAQ 用什么方法安装的?

haitianyisee commented 10 months ago

我在windows安装了github的版本,也是报同样的错QAQ 用什么方法安装的?

我下载了上述百度网盘的版本 install.packages("C:/Users/Desktop/scPagwas_1.3.0.tar.gz", repos = NULL, type = "source")

haitianyisee commented 10 months ago

我已通过网盘加您好友,要不直接在那里交流?

dengchunyu commented 10 months ago

你提供的意见很重要,我测试一下联系你

dengchunyu commented 10 months ago

我在我自己电脑和别人电脑那里都重新测试了,找不到你遇到的问题。 我测试的R版本是R4.2.2和R4.3.1

另外你尝试换个真实的数据试试,我怀疑包里面的测试数据体量太小可能比较极端。我这里提供之前分析时使用的一个真实数据例子: 链接:https://pan.baidu.com/s/1Z5SIQub38bGVXjeTJbQZ2g?pwd=1234 提取码:1234

zywz12138 commented 9 months ago

我在windows安装了github的版本,也是报同样的错QAQ 用什么方法安装的?

我下载了上述百度网盘的版本 install.packages("C:/Users/Desktop/scPagwas_1.3.0.tar.gz", repos = NULL, type = "source")

  • installing source package 'scPagwas' ... using staged installation R data moving datasets to lazyload DB inst byte-compile and prepare package for lazy loading help Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:114: unknown macro '\item' Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:160: unexpected section header '\description' Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:163: unexpected section header '\details' Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:175: unexpected section header '\note' Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:186: unexpected section header '\examples' Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:205: unexpected section header '\references' Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:209: unexpected section header '\author' Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:212: unexpected section header '\keyword' Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:213: unexpected section header '\keyword' Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:214: unexpected section header '\keyword' Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:215: unexpected section header '\keyword' Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:216: unexpected section header '\keyword' Warning: C:/Users/AppData/Local/Temp/RtmpoRwDbU/R.INSTALL53b87fdd21eb/scPagwas/man/scPagwas_main.Rd:217: unexpected END_OF_INPUT ' ' installing help indices * copying figures 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 (scPagwas)

library(scPagwas)

1.start to run the wrapper functions for example.

Pagwas_data<-scPagwas_main(Pagwas = NULL,

  •                      gwas_data =system.file("extdata", "GWAS_summ_example.txt", package = "scPagwas"), # The GWAS Summary statistics files
  •                      Single_data =system.file("extdata", "scRNAexample.rds", package = "scPagwas"),# scRNA-seq data in seruat format with "RNA" assays and normalized.
  •                      output.prefix="test", # the prefix name for output files
  •                      output.dirs="scPagwastest_output",# the directory file's name for output
  •                      block_annotation = block_annotation,# gene position in chromosome is provided by package.
  •                      assay="RNA", # the assays for scRNA-seq data to use.
  •                      Pathway_list=Genes_by_pathway_kegg,# pathway list is provided by package, including gene symbols.
  •                      n.cores=1,
  •                      iters_singlecell = 10,
  •                      chrom_ld = chrom_ld,# The LD data is provided by package.
  •                      singlecell=T, # Whether to run the singlecell process.
  •                      celltype=T# Whether to run the celltype process.
  • )

    ------ Wed Nov 22 12:27:40 2023 ------## *** 1st: Single_data_input function start! ****

    Start to read the single cell data! Start to filter single cell data! Input single cell data! 10 cell types are remain, after filter! As of Seurat v5, we recommend using AggregateExpression to perform pseudo-bulk analysis. This message is displayed once per session. done!

    ------ Wed Nov 22 12:27:45 2023 ------## *** 2nd: Pathway_pcascore_run function start!! ****

  • Start to get Pathway SVD socre! | | 0%Error in names(x) <- value : 'names' attribute [88] must be the same length as the vector [0] 最终报错

您好,我也遇到了同样的问题,请问解决了吗

dengchunyu commented 9 months ago

删除RMTstat,irlba,这两个依赖包,删除重装现有的scPagwas,重装过程不要更新依赖包,依赖包更新后有可能不兼容导致错误

corrschi commented 6 months ago

另外你尝试换个真实的数据试试,我怀疑包里面的测试数据体量太小可能比较极端。我这里提供之前分析时使用的一个真实数据例子: 链接:https://pan.baidu.com/s/1Z5SIQub38bGVXjeTJbQZ2g?pwd=1234 提取码:1234

您好,因使用自己的数据报错,我运行测试您此处提供的真实数据例子。运行至 9th: scGet_PCC function start! 报错,麻烦帮忙看下,谢谢~【我用的linux系统,R4.2.2】

报错如下:

------ Tue Mar 12 23:33:51 2024 ------## *** 9th: scGet_PCC function start! ****

done! Warning: The following features are not present in the object: MT-ATP8, MT-ND3, MT-ATP6, MT-ND4L, IGKV1-16, MT-ND4, MT-CO3, MT-CO2, MT-ND5, MT-CO1, IGKV1D-16, PTPRCAP, C11orf31, MT-ND1, IGLL5, MT-ND2, IGKV3-15, MT-CYB, IGHV5-51, IGHV5-78, IGKV3D-15, IGKV3-20, MT-ND6, IGHV3OR16-6, IGHE, NGRN, AKAP2, HIST1H1C, FAM103A1, IGHV3OR16-7, ZMYM6NB, NSMCE3, ZBED1, PPP3R1, TRAPPC2P1, TP53I13, CH17-212P11.4, MATR3.1, not searching for symbol synonyms Warning: The following features are not present in the object: SNHG29, IGLV4-69, IGHV3-74, GAS5, SEPTIN6, SNHG6, TOMM6, ATP5F1D, ATP5PO, ATP5MC2, NOP53, RACK1, NIBAN3, MICOS10, ATP5F1E, ATP5MG, ATP5MPL, RTRAF, ATP5F1B, SEPTIN7, ATP5F1A, ATP5MD, DANCR, ELOB, SELENOH, IGLC7, ATP5F1C, ATP5MF, ATP5PF, DUXAP8, CIAO2B, ATP5MC3, CIAO2A, JPT1, ATP5ME, AL133467.1, SEM1, AC004687.1, IFI30, SMIM26, MICOS13, IGLC3, ATP5MC1, RBIS, ATP5PD, SELENOW, LHFPL3-AS2, RESF1, TLE5, MEF2B, FAM174C, UBE2V1, CERNA2, AC015871.1, RIPOR2, TRIR, SNHG3, BLOC1S1, TRAPPC2B, ATP5PB, AL079338.1, SEPTIN9, SEPTIN2, NAXE, SEPTIN1, ATP5IF1, RO60, AC004130.2, SINHCAF, NDUFAF8, ELOC, SELENOT, ARHGAP45, IGHV3-73, ZNRD2, RTF2, RAB5IF, NCBP2AS2, RUBCNL, REX1BD, COPS9, LINC02397, MTLN, OIP5-AS1, PCED1B-AS1, EBLN3P, METTL26, AC090152.1, RIOX2, PCLAF, RAMAC, TOMM5, BEX3, MCUB, IGKV4-1, SNHG16, MMP24OS, AC010642.2, RPL26, STMP1, AC233755.2, TASOR, SNHG5, DMAC1, AL138963.4, ANTKMT, SELENOK, AC010247.1, CCDC18-AS1, ZNF581, SDHAF2, PMF1, UFD1, [... truncated]