r3fang / SnapATAC

Analysis Pipeline for Single Cell ATAC-seq
GNU General Public License v3.0
300 stars 125 forks source link

"createGmatFromMat" Error:.M.kind(x) : not yet implemented for matrix with typeof NULL #124

Open aina91 opened 4 years ago

aina91 commented 4 years ago

@r3fang hello, I am very glad to use your great tools. when i tried to reload the bmat matrix , he16.sp = addBmatToSnap(he16.sp); he16.sp = createGmatFromMat(obj=he16.sp,input.mat="bmat",genes=genes.sel.gr,do.par=TRUE, num.cores=10); However,I got this issue, Error in .M.kind(x) : not yet implemented for matrix with typeof NULL i have searched the previous issues.It seems like this [https://github.com/r3fang/SnapATAC/issues/19],but i still confused about this error. Could you please give me some suggestions? Thx~ Here is my seesionInfo , FYI.

Matrix products: default BLAS: /software/biosoft/software/python/anaconda3-python3-2018/lib/libblas.so.3.8.0 LAPACK: /software/biosoft/software/python/anaconda3-python3-2018/lib/liblapack.so.3.8.0

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets [8] methods base

other attached packages: [1] Seurat_3.0.3.9041 umap_0.2.3.1 leiden_0.3.1 [4] GenomicRanges_1.36.0 GenomeInfoDb_1.20.0 IRanges_2.18.1 [7] S4Vectors_0.22.0 BiocGenerics_0.30.0 ggplot2_3.2.1 [10] SnapATAC_1.0.0 rhdf5_2.28.0 Matrix_1.2-17

loaded via a namespace (and not attached): [1] bigmemory_4.5.33 bigmemory.sri_0.1.3 Rtsne_0.15 [4] colorspace_1.4-1 ggridges_0.5.1 XVector_0.24.0 [7] listenv_0.7.0 npsurv_0.4-0 ggrepel_0.8.1 [10] RSpectra_0.15-0 codetools_0.2-16 splines_3.6.1 [13] R.methodsS3_1.7.1 doParallel_1.0.15 lsei_1.2-0 [16] zeallot_0.1.0 jsonlite_1.6 ica_1.0-2 [19] cluster_2.1.0 png_0.1-7 R.oo_1.23.0 [22] uwot_0.1.3 sctransform_0.2.0 compiler_3.6.1 [25] httr_1.4.1 backports_1.1.5 assertthat_0.2.1 [28] lazyeval_0.2.2 limma_3.40.6 htmltools_0.4.0 [31] tools_3.6.1 rsvd_1.0.2 igraph_1.2.4.1 [34] misc3d_0.8-4 gtable_0.3.0 glue_1.3.1 [37] GenomeInfoDbData_1.2.1 reshape2_1.4.3 RANN_2.6.1 [40] dplyr_0.8.3 Rcpp_1.0.2 vctrs_0.2.0 [43] gdata_2.18.0 ape_5.3 nlme_3.1-141 [46] iterators_1.0.12 gbRd_0.4-11 lmtest_0.9-37 [49] stringr_1.4.0 globals_0.12.4 lifecycle_0.1.0 [52] irlba_2.3.3 gtools_3.8.1 future_1.14.0 [55] edgeR_3.26.8 zlibbioc_1.30.0 MASS_7.3-51.4 [58] zoo_1.8-6 scales_1.0.0 doSNOW_1.0.18 [61] plot3D_1.1.1 RColorBrewer_1.1-2 reticulate_1.13 [64] pbapply_1.4-1 gridExtra_2.3 stringi_1.4.3 [67] foreach_1.4.7 caTools_1.17.1.2 bibtex_0.4.2 [70] Rdpack_0.11-0 SDMTools_1.1-221.1 rlang_0.4.1 [73] pkgconfig_2.0.3 bitops_1.0-6 lattice_0.20-38 [76] ROCR_1.0-7 purrr_0.3.3 Rhdf5lib_1.6.0 [79] htmlwidgets_1.5.1 labeling_0.3 cowplot_1.0.0 [82] tidyselect_0.2.5 RcppAnnoy_0.0.12 plyr_1.8.4 [85] magrittr_1.5 R6_2.4.0 snow_0.4-3 [88] gplots_3.0.1.1 pillar_1.4.2 withr_2.1.2 [91] fitdistrplus_1.0-14 survival_2.44-1.1 RCurl_1.95-4.12 [94] tsne_0.1-3 tibble_2.1.3 future.apply_1.3.0 [97] crayon_1.3.4 KernSmooth_2.23-15 plotly_4.9.1 [100] viridis_0.5.1 locfit_1.5-9.1 grid_3.6.1 [103] data.table_1.12.6 metap_1.1 digest_0.6.22 [106] tidyr_1.0.0 R.utils_2.9.0 RcppParallel_4.4.3 [109] openssl_1.4.1 munsell_0.5.0 viridisLite_0.3.0 [112] askpass_1.1

rojinsafavi commented 4 years ago

did you figure this out? I'm having the same issue

hbliu commented 3 years ago

I also have the same issue. After check the code, I found following code return a NULL matrix: ovs = as.data.frame(GenomicRanges::findOverlaps(peaks.use, genes)); The reason for this is the column seqnames of peaks.use does not include "chr" which does not match with that in genes. Adding "chr" to seqnames of x.sp@feature solved the issue.

BiocManager::install("diffloop")
library(diffloop)
x.sp@feature <- addchr(x.sp@feature)
x.sp = createGmatFromMat(
    obj=x.sp, 
    input.mat="bmat",
    genes=genes.sel.gr,
    do.par=TRUE,
    num.cores=1
  );

Wish this would be helpful if you have the same issue.

Telogen commented 2 years ago

Same problem for me, after I do this seqlevelsStyle(genes.gr) <- 'UCSC', all codes run well.