digitalcytometry/cytotrace2

Error in var(exp1[1:20, 1:20]) : is.atomic(y) is not TRUE

Closed this issue · 9 comments

Dear Author,

Hello, I encountered the error mentioned in the subject line when running Cytotrace2. Could you please advise on how to resolve this issue? I look forward to your reply. Thank you very much!

Best regards,

Anler

Hi,

Thank you for reaching out and for using CytoTRACE 2.
To help you resolve this issue, could you please provide more context? Specifically:

  1. Input Data: What kind of data are you using as input? Are you sure that the input matrix is numeric and doesn't contain factors, characters, NAs or other non-numeric types?
  2. Code Snippet: Could you please share the line of the code you use to run the tool?
  3. Session Info: If possible, sharing the session info (e.g., version of R, packages loaded) might also help diagnose the issue better.

Thank you for your patience, and I look forward to your reply.

Hi,

Thank you for reaching out and for using CytoTRACE 2. To help you resolve this issue, could you please provide more context? Specifically:

  1. Input Data: What kind of data are you using as input? Are you sure that the input matrix is numeric and doesn't contain factors, characters, NAs or other non-numeric types?
  2. Code Snippet: Could you please share the line of the code you use to run the tool?
  3. Session Info: If possible, sharing the session info (e.g., version of R, packages loaded) might also help diagnose the issue better.

Thank you for your patience, and I look forward to your reply.

Hi.
Thank you for your reply. When I use the sample code here, the same error message occurs.
`library(CytoTRACE2)

example run with a scRNA-seq dataset (10x) encompassing 2280 cells from murine pancreatic epithelium (Bastidas-Ponce et al., 2019)

download the .rds file (this will download the file to your working directory)

download.file("https://drive.google.com/uc?export=download&id=1ivi9TBlmzVTDGzNWQrXXeyL68Wug989K", "Pancreas_10x_downsampled.rds")

load rds

data <- readRDS("Pancreas_10x_downsampled.rds")

extract expression data

expression_data <- data$expression_data

running CytoTRACE 2 main function - cytotrace2 - with default parameters

cytotrace2_result <- cytotrace2(expression_data)
`
image

And:
image

And:
`sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 20.04.6 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3; LAPACK version 3.9.0

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

time zone: Asia/Shanghai
tzcode source: system (glibc)

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

other attached packages:
[1] CytoTRACE2_1.0.0 Rfast_2.1.0 RcppParallel_5.1.7 RcppZiggurat_0.1.6 RANN_2.6.1 plyr_1.8.8 HiClimR_2.2.0 doParallel_1.0.17
[9] iterators_1.0.14 foreach_1.5.2 magrittr_2.0.3 harmony_0.1.1 Rcpp_1.0.8 ROCR_1.0-11 KernSmooth_2.23-20 fields_14.1
[17] viridis_0.6.2 viridisLite_0.4.2 spam_2.9-1 DoubletFinder_2.0.4 data.table_1.14.8 ggpubr_0.4.0 org.Mm.eg.db_3.16.0 AnnotationDbi_1.60.0
[25] IRanges_2.32.0 S4Vectors_0.36.1 ClusterGVis_0.1.1 monocle_2.26.0 DDRTree_0.1.5 irlba_2.3.5.1 VGAM_1.1-7 Biobase_2.58.0
[33] BiocGenerics_0.44.0 Matrix_1.6-1.1 glmGamPoi_1.10.2 sctransform_0.3.5 scRNAtoolVis_0.0.7 showtext_0.9-5 showtextdb_3.0 sysfonts_0.8.8
[41] future_1.19.1 lubridate_1.9.2 forcats_1.0.0 purrr_1.0.2 readr_2.1.4 tidyr_1.3.0 tibble_3.2.1 tidyverse_2.0.0
[49] dplyr_1.1.4 ggsci_2.9 patchwork_1.1.2 ggplot2_3.4.4 stringr_1.5.0 SeuratObject_5.0.0 Seurat_4.3.0

loaded via a namespace (and not attached):
[1] fs_1.5.2 matrixStats_0.63.0 spatstat.sparse_3.0-0 bitops_1.0-7 httr_1.4.4 RColorBrewer_1.1-3
[7] docopt_0.7.1 tools_4.4.0 backports_1.2.1 utf8_1.2.3 R6_2.5.1 lazyeval_0.2.2
[13] uwot_0.1.16 GetoptLong_1.0.5 withr_2.5.0 sp_1.5-1 gridExtra_2.3 progressr_0.11.0
[19] textshaping_0.3.6 cli_3.6.1 Cairo_1.6-0 spatstat.explore_3.0-5 labeling_0.4.2 slam_0.1-50
[25] spatstat.data_3.0-0 ggridges_0.5.4 pbapply_1.6-0 systemfonts_1.0.4 R.utils_2.12.2 maps_3.4.0
[31] limma_3.54.0 rstudioapi_0.14 RSQLite_2.2.8 generics_0.1.3 shape_1.4.6 combinat_0.0-8
[37] ica_1.0-3 spatstat.random_3.0-1 car_3.1-1 ggbeeswarm_0.6.0 fansi_1.0.4 abind_1.4-5
[43] R.methodsS3_1.8.2 lifecycle_1.0.3 carData_3.0-5 SummarizedExperiment_1.20.0 Rtsne_0.16 grid_4.4.0
[49] blob_1.2.3 promises_1.2.0.1 crayon_1.5.2 miniUI_0.1.1.1 lattice_0.20-44 cowplot_1.1.1
[55] KEGGREST_1.38.0 magick_2.7.4 pillar_1.9.0 ComplexHeatmap_2.14.0 GenomicRanges_1.50.1 rjson_0.2.20
[61] future.apply_1.10.0 codetools_0.2-18 leiden_0.4.3 glue_1.6.2 leidenbase_0.1.14 vctrs_0.6.5
[67] png_0.1-7 gtable_0.3.3 cachem_1.0.6 mime_0.11 ncdf4_1.21 qlcMatrix_0.9.7
[73] HSMMSingleCell_1.18.0 survival_3.2-11 SingleCellExperiment_1.20.1 pheatmap_1.0.12 fastICA_1.2-3 ellipsis_0.3.2
[79] fitdistrplus_1.1-8 nlme_3.1-152 usethis_2.1.6 bit64_4.0.5 RcppAnnoy_0.0.21 GenomeInfoDb_1.34.3
[85] vipor_0.4.5 colorspace_2.1-0 DBI_1.1.3 ggrastr_1.0.1 tidyselect_1.2.0 bit_4.0.4
[91] compiler_4.4.0 rvest_1.0.3 xml2_1.3.3 ggdendro_0.1.23 DelayedArray_0.24.0 plotly_4.10.1
[97] scales_1.3.0 lmtest_0.9-38 digest_0.6.27 goftest_1.2-2 spatstat.utils_3.0-5 sparsesvd_0.2-1
[103] XVector_0.30.0 htmltools_0.5.2 pkgconfig_2.0.3 sparseMatrixStats_1.2.1 MatrixGenerics_1.10.0 fastmap_1.1.0
[109] rlang_1.1.1 GlobalOptions_0.1.2 htmlwidgets_1.5.4 DelayedMatrixStats_1.12.3 shiny_1.7.3 farver_2.1.1
[115] zoo_1.8-11 jsonlite_1.7.2 R.oo_1.25.0 RCurl_1.98-1.4 GenomeInfoDbData_1.2.9 dotCall64_1.0-2
[121] munsell_0.5.0 reticulate_1.26 stringi_1.7.12 zlibbioc_1.36.0 MASS_7.3-60.0.1 listenv_0.8.0
[127] ggrepel_0.9.4 deldir_1.0-6 Biostrings_2.58.0 tensor_1.5 hms_1.1.2 do_2.0.0.0
[133] circlize_0.4.15 igraph_1.3.5 spatstat.geom_3.0-3 ggsignif_0.6.4 reshape2_1.4.4 tzdb_0.1.2
[139] httpuv_1.6.3 polyclip_1.10-0 clue_0.3-59 scattermore_0.7 broom_1.0.5 xtable_1.8-4
[145] monocle3_1.0.0 rstatix_0.7.1 later_1.3.0 ragg_1.2.5 memoise_2.0.1 beeswarm_0.4.0
[151] cluster_2.1.2 timechange_0.1.1 globals_0.16.1 `

Hope to receive your help!!!!

Best,
Anler

Hi,

We are sorry for the inconvenience. I tried to replicate your issue with your version of R (4.4.0), but I didn't get any errors when running the tool. My package versions also generally match your session environment, with just a couple of differences. Could you please try to upgrade these packages to their specified version:

  • Rcpp_1.0.8 --> Rcpp_1.0.13
  • RcppParallel_5.1.7 --> RcppParallel_5.1.8

After doing this, please reinstall CytoTRACE 2:
devtools::install_github("digitalcytometry/cytotrace2", subdir = "cytotrace2_r")

Please let us know if this works. If not we will take it further to investigate and resolve the issue for you.

I also come across this problem, when i use cytotrace 2 to treat my seurat object, then this error ocurr.

result<-cytotrace2(downsample,is_seurat = T,slot_type = "counts",species = "human",seed=1234)
cytotrace2: Started loading data
Dataset contains 33613 genes and 2000 cells.
Windows OS can run only on 1 core
The passed subsample size is greater than the number of cells in dataset.
Now setting subsample size to 2000
cytotrace2: Running on 1 subsample(s) approximately of length 2000
cytotrace2: Started running on subsample(s). This will take a few minutes.
cytotrace2: Started preprocessing.
14090 input genes mapped to model genes.
cytotrace2: Started prediction.
This section will run using 1 / 32 core(s).
错误于var(x): 不是所有的is.atomic(y)都是TRUE

I have update Rcpp and PcppParallel to latest version, and reinstall cytotrace 2, but the error still occur.

when i use cytotrace 1.0, there is also error
result<-CytoTRACE(expr,ncores = 1)
The number of cells in your dataset is less than 3,000. Fast mode has been disabled.
错误于FUN(newX[, i], ...): 不是所有的is.atomic(y)都是TRUE

Hi,

Thank you for using CytoTRACE 2 and reaching out with your issue.
Could you please share here your full session info? I'm particularly interested in your R version and the version of the BiocGenerics package. You can do so by calling sessionInfo().

We really appreciate your collaboration in investigating and solving your issue.

Hi @amingson,

We haven't heard back from you. Please let us know if the issue persists for you and we can suggest workarounds to resolve the problem. If you don't experience the problem anymore, we will go ahead and close this issue.

Thanks!

Hi @amingson,

We haven't heard back from you. Please let us know if the issue persists for you and we can suggest workarounds to resolve the problem. If you don't experience the problem anymore, we will go ahead and close this issue.

Thanks!

Hi savagyan00:

Thank you for your help. I've been very busy recently and couldn't reply in time. I have changed the operating environment here and haven't encountered such a problem again. Thank you again for your careful and enthusiastic help.

Best,
Anler