GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
388 stars 140 forks source link

After imputeMatrix, NAs & NANs introduced into matrix #1845

Closed CoderMatthias closed 1 year ago

CoderMatthias commented 1 year ago

ArchR-addImputeWeights-32256e4135c7-Date-2023-02-16_Time-15-58-20.log ArchR-imputeMatrix-32258a6768a-Date-2023-02-16_Time-15-58-54.log

Describe the bug I am ending up with NAs and NANs in my imputed data matrix after running imputeMatrix. I had previously ran the same code on the same sample, but at lower sequencing depth, without issue. We resequenced the same libraries at a much greater depth (~1.6 billion reads across 2500 cells) and now the impute matrix has NA/NAN for all values for only certain cells. Below is the code I ran:

############## Imputing scores
gene_score <- getMatrixFromProject(proj_in_tissue)
rownames(gene_score) <- rowData(gene_score)$name

# Add imputed values
proj_in_tissue <- addImputeWeights(proj_in_tissue)
gene_score_im <- imputeMatrix(assay(gene_score), getImputeWeights(proj_in_tissue), verbose = T)

There is no missing values in gene_score, but missing values in gene_score_im.

To Reproduce Not applicable due to connection to depth of sequencing.

Expected behavior I was expecting an imputed matrix with values for genes across all cells.

Screenshots image The image is of the transposed gene_score matrix (genes ending in .x) and the transposed imputed_score matrix (genes ending in .y). Only the first 6 genes were shown for each matrix and a subset of the cells. You'll see NA/NANs for some of the cells only in the imputed matrix (row 4, 11, 14), and this extended across all genes for that cell.

Session Info

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 8.6 (Ootpa)

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.15.so

Random number generation:
 RNG:     L'Ecuyer-CMRG 
 Normal:  Inversion 
 Sample:  Rejection 

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    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] uwot_0.1.14                 purrr_0.3.5                 repr_1.1.4                  org.Mm.eg.db_3.15.0         AnnotationDbi_1.58.0        clusterProfiler_4.4.4       tibble_3.1.8                dplyr_1.0.10               
 [9] kableExtra_1.3.4            patchwork_1.1.2             sp_1.5-0                    SeuratObject_4.1.2          Seurat_4.2.0                rhdf5_2.40.0                SummarizedExperiment_1.26.1 Biobase_2.56.0             
[17] MatrixGenerics_1.8.1        Rcpp_1.0.9                  Matrix_1.5-1                GenomicRanges_1.48.0        GenomeInfoDb_1.32.4         IRanges_2.30.1              S4Vectors_0.34.0            BiocGenerics_0.42.0        
[25] matrixStats_0.62.0          data.table_1.14.4           stringr_1.4.1               plyr_1.8.7                  magrittr_2.0.3              ggplot2_3.3.6               gtable_0.3.1                gtools_3.9.3               
[33] gridExtra_2.3               ArchR_1.0.2                

loaded via a namespace (and not attached):
  [1] scattermore_0.8        tidyr_1.2.1            nabor_0.5.0            bit64_4.0.5            knitr_1.40             irlba_2.3.5.1          DelayedArray_0.22.0    rpart_4.1.16           KEGGREST_1.36.3       
 [10] RCurl_1.98-1.9         generics_0.1.3         callr_3.7.2            cowplot_1.1.1          usethis_2.1.6          RSQLite_2.2.18         shadowtext_0.1.2       RANN_2.6.1             future_1.28.0         
 [19] bit_4.0.4              enrichplot_1.16.2      spatstat.data_2.2-0    webshot_0.5.4          xml2_1.3.3             httpuv_1.6.6           assertthat_0.2.1       viridis_0.6.2          xfun_0.32             
 [28] evaluate_0.18          promises_1.2.0.1       fansi_1.0.3            igraph_1.3.5           DBI_1.1.3              htmlwidgets_1.5.4      spatstat.geom_2.4-0    ellipsis_0.3.2         deldir_1.0-6          
 [37] vctrs_0.4.2            remotes_2.4.2          Cairo_1.6-0            ROCR_1.0-11            abind_1.4-5            cachem_1.0.6           withr_2.5.0            ggforce_0.4.1          progressr_0.11.0      
 [46] sctransform_0.3.5      treeio_1.20.2          prettyunits_1.1.1      goftest_1.2-3          svglite_2.1.0          cluster_2.1.4          DOSE_3.22.1            ape_5.6-2              lazyeval_0.2.2        
 [55] crayon_1.5.2           pkgconfig_2.0.3        labeling_0.4.2         tweenr_2.0.2           nlme_3.1-160           pkgload_1.3.0          devtools_2.4.5         rlang_1.0.5            globals_0.16.1        
 [64] lifecycle_1.0.1        miniUI_0.1.1.1         downloader_0.4         polyclip_1.10-0        lmtest_0.9-40          aplot_0.1.8            Rhdf5lib_1.18.2        zoo_1.8-11             base64enc_0.1-3       
 [73] ggridges_0.5.4         processx_3.7.0         png_0.1-7              viridisLite_0.4.1      bitops_1.0-7           KernSmooth_2.23-20     rhdf5filters_1.8.0     Biostrings_2.64.1      blob_1.2.3            
 [82] qvalue_2.28.0          parallelly_1.32.1      spatstat.random_2.2-0  gridGraphics_0.5-1     scales_1.2.1           memoise_2.0.1          ica_1.0-3              zlibbioc_1.42.0        compiler_4.2.1        
 [91] scatterpie_0.1.8       RColorBrewer_1.1-3     fitdistrplus_1.1-8     cli_3.4.1              XVector_0.36.0         urlchecker_1.0.1       listenv_0.8.0          pbapply_1.5-0          ps_1.7.1              
[100] MASS_7.3-58.1          mgcv_1.8-40            tidyselect_1.2.0       stringi_1.7.8          yaml_2.3.5             GOSemSim_2.22.0        ggrepel_0.9.1          fastmatch_1.1-3        tools_4.2.1           
[109] future.apply_1.9.1     rstudioapi_0.14        farver_2.1.1           Rtsne_0.16             ggraph_2.1.0           digest_0.6.30          rgeos_0.5-9            shiny_1.7.2            later_1.3.0           
[118] RcppAnnoy_0.0.19       httr_1.4.4             colorspace_2.0-3       rvest_1.0.3            fs_1.5.2               tensor_1.5             reticulate_1.26        splines_4.2.1          yulab.utils_0.0.5     
[127] tidytree_0.4.1         spatstat.utils_2.3-1   graphlayouts_0.8.2     ggplotify_0.1.0        plotly_4.10.0          sessioninfo_1.2.2      systemfonts_1.0.4      xtable_1.8-4           jsonlite_1.8.2        
[136] ggtree_3.4.4           tidygraph_1.2.2        ggfun_0.0.8            R6_2.5.1               profvis_0.3.7          pillar_1.8.1           htmltools_0.5.3        mime_0.12              glue_1.6.2            
[145] fastmap_1.1.0          BiocParallel_1.30.4    codetools_0.2-18       fgsea_1.22.0           pkgbuild_1.3.1         utf8_1.2.2             lattice_0.20-45        spatstat.sparse_2.1-1  curl_4.3.3            
[154] leiden_0.4.3           GO.db_3.15.0           survival_3.4-0         rmarkdown_2.17         munsell_0.5.0          DO.db_2.9              GenomeInfoDbData_1.2.8 reshape2_1.4.4         spatstat.core_2.4-4  

Additional context This data is for a spatial technology, DBiT-seq, that uses ArchR for the analysis. Each spatial dot should resemble a single cell though.

rcorces commented 1 year ago

Hi @CoderMatthias! Thanks for using ArchR! Please make sure that your post belongs in the Issues section. Only bugs and error reports belong in the Issues section. Usage questions and feature requests should be posted in the Discussions section, not in Issues.
Before we help you, you must respond to the following questions unless your original post already contained this information: 1. If you've encountered an error, have you already searched previous Issues to make sure that this hasn't already been solved? 2. Can you recapitulate your error using the tutorial code and dataset? If so, provide a reproducible example. 3. Did you post your log file? If not, add it now. 4. Remove any screenshots that contain text and instead copy and paste the text using markdown's codeblock syntax (three consecutive backticks). You can do this by editing your original post.

CoderMatthias commented 1 year ago

Hi Ryan,

Thanks for your response! My initial response contains the information and I couldn't find a similar error.

Thanks for your help!

Best, Matt

On Thu, Feb 16, 2023, 11:54 AM Ryan Corces @.***> wrote:

Hi @CoderMatthias https://github.com/CoderMatthias! Thanks for using ArchR! Please make sure that your post belongs in the Issues section. Only bugs and error reports belong in the Issues section. Usage questions and feature requests should be posted in the Discussions https://github.com/GreenleafLab/ArchR/discussions section, not in Issues.

Before we help you, you must respond to the following questions unless your original post already contained this information: 1. If you've encountered an error, have you already searched previous Issues to make sure that this hasn't already been solved? 2. Can you recapitulate your error using the tutorial code and dataset? If so, provide a reproducible example. 3. Did you post your log file? If not, add it now. 4. Remove any screenshots that contain text and instead copy and paste the text using markdown's codeblock syntax (three consecutive backticks). You can do this by editing your original post.

— Reply to this email directly, view it on GitHub https://github.com/GreenleafLab/ArchR/issues/1845#issuecomment-1433399072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3XH3IGVIQISOECB7BWHY3WXZLT5ANCNFSM6AAAAAAU6NMUUQ . You are receiving this because you were mentioned.Message ID: @.***>

rcorces commented 1 year ago

I dont have an intuition for why this might happen. In order to be able to help, you'll need to provide a reproducible example. For example, sharing with me your summarized experiment and impute weights. Ideally for both the case where it works and does not work.

rcorces commented 1 year ago

closing due to inactivity.