8000 do_GroupWiseDEPlot returns "Error in if (dmax - dmin < eps) { : missing value where TRUE/FALSE needed" · Issue #82 · enblacar/SCpubr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

do_GroupWiseDEPlot returns "Error in if (dmax - dmin < eps) { : missing value where TRUE/FALSE needed" #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
samgest opened this issue Feb 10, 2025 · 2 comments

Comments

@samgest
Copy link
samgest commented Feb 10, 2025

Hi, I'm trying to run plot the GroupWise_DE genes but I keep getting an error.

Given a Seurat v5 object "Malignant.Merged" with an SCTAssay as default:

> Malignant.Merged
An object of class Seurat 
45750 features across 74858 samples within 4 assays 
Active assay: SCT (19995 features, 3000 variable features)
 3 layers present: counts, data, scale.data
 3 other assays present: RNA, pathwaysmlm, tfsulm
 10 dimensional reductions calculated: pca, umap_unintegrated_SCT, harmony_SCT, umap_integrated_harmony_SCT, umap_unintegrated_harmony_SCT, pca_SCT_Feats, harmony_SCT_Feats, umap_integrated_harmony_SCT_Feats, umap_integrated_harmony_SCT_default, umap_integrated_harmony_SCT_umapLearn

Image

I run:

de_genes <- FindAllMarkers(Malignant.Merged, assay = "SCT", group.by = "malignantClustersOnly")

SCpubr::do_GroupwiseDEPlot(sample = Malignant.Merged,
                           de_genes = de_genes,
                           min.cutoff = 1
                           )

When trying to get the plot, the console returns this error:

Error in if (dmax - dmin < eps) { : missing value where TRUE/FALSE needed
In addition: Warning message:
In min(., na.rm = TRUE) : no non-missing arguments to min; returning Inf

The "de_markers" object looks like this:

head(de_markers)
        p_val avg_log2FC pct.1 pct.2 p_val_adj         cluster    gene
SERTAD1     0   1.074416 0.706 0.441         0 Sc. 2 - SERTAD1 SERTAD1
ATF3        0   1.745181 0.878 0.616         0 Sc. 2 - SERTAD1    ATF3
MAFF        0   1.115368 0.552 0.315         0 Sc. 2 - SERTAD1    MAFF
ANKRD37     0   1.357709 0.573 0.359         0 Sc. 2 - SERTAD1 ANKRD37
BTG2        0   1.256733 0.677 0.464         0 Sc. 2 - SERTAD1    BTG2
DNAJB4      0   1.537753 0.489 0.277         0 Sc. 2 - SERTAD1  DNAJB4


summary(de_markers)
 p_val               avg_log2FC        pct.1          pct.2              p_val_adj        cluster     
 Min.   :0.000e+00   Min.   : 0.1000   Min.   :0.0060   Min.   :0.0000   Min.   :0.0000   Sc. 2 - SERTAD1:10237  
 1st Qu.:0.000e+00   1st Qu.: 0.3191   1st Qu.:0.0490   1st Qu.:0.0280   1st Qu.:0.0000   Sc. 6 - CCL2   : 6721  
 Median :0.000e+00   Median : 0.5059   Median :0.1080   Median :0.0720   Median :0.0000   Sc. 11 - SLPI  : 6605  
 Mean   :3.949e-04   Mean   : 0.7463   Mean   :0.1768   Mean   :0.1321   Mean   :0.2106   Sc. 12 - TGFBI : 6590  
 3rd Qu.:3.726e-06   3rd Qu.: 0.8404   3rd Qu.:0.2230   3rd Qu.:0.1570   3rd Qu.:0.0745   Sc. 8 - SST    : 6178  
 Max.   :9.999e-03   Max.   :13.3652   Max.   :1.0000   Max.   :0.9990   Max.   :1.0000   Sc. 1 - N4BP2L2: 4948  
                                                                                          (Other)        :13443  
 gene          
 Length:54722      
 Class :character  
 Mode  :character  

Thanks in advance!

> sessionInfo()
R version 4.4.2 (2024-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26100)

Matrix products: default


locale:
[1] LC_COLLATE=English_Europe.utf8  LC_CTYPE=English_Europe.utf8    LC_MONETARY=English_Europe.utf8 LC_NUMERIC=C                   
[5] LC_TIME=English_Europe.utf8    

time zone: Europe/Madrid
tzcode source: internal

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

other attached packages:
 [1] convenience_1.0.0           rwty_1.0.2                  coda_0.19-4.1               ape_5.8-1                  
 [5] scran_1.34.0                psych_2.4.12                writexl_1.5.1               readxl_1.4.3               
 [9] Nebulosa_1.16.0             scCustomize_3.0.1           future_1.34.0               presto_1.0.0               
[13] glmGamPoi_1.18.0            clustree_0.5.1              ggraph_2.2.1                data.table_1.16.4          
[17] reshape2_1.4.4              DESeq2_1.46.0               GSVA_2.0.5                  BaseSet_0.9.0              
[21] reticulate_1.40.0           GSEABase_1.68.0             graph_1.84.1                annotate_1.84.0            
[25] XML_3.99-0.18               AnnotationDbi_1.68.0        splitstackshape_1.4.8       lubridate_1.9.4            
[29] forcats_1.0.0               stringr_1.5.1               purrr_1.0.2                 readr_2.1.5                
[33] tidyr_1.3.1                 tidyverse_2.0.0             tibble_3.2.1                dplyr_1.1.4                
[37] patchwork_1.3.0             ComplexHeatmap_2.22.0       scater_1.34.0               ggplot2_3.5.1              
[41] scuttle_1.16.0              SingleCellExperiment_1.28.1 SummarizedExperiment_1.36.0 Biobase_2.66.0             
[45] GenomicRanges_1.58.0        GenomeInfoDb_1.42.1         
8000
IRanges_2.40.1              S4Vectors_0.44.0           
[49] BiocGenerics_0.52.0         MatrixGenerics_1.18.1       matrixStats_1.5.0           harmony_1.2.3              
[53] Rcpp_1.0.14                 zellkonverter_1.16.0        Matrix_1.7-2                SeuratDisk_0.0.0.9021      
[57] pbmcref.SeuratData_1.0.0    kidneyref.SeuratData_1.0.2  SeuratData_0.2.2.9001       Seurat_5.2.1               
[61] SeuratObject_5.0.2          sp_2.2-0                   

loaded via a namespace (and not attached):
  [1] SpatialExperiment_1.16.0 goftest_1.2-3            Biostrings_2.74.1        HDF5Array_1.34.0         vctrs_0.6.5             
  [6] spatstat.random_3.3-2    digest_0.6.37            png_0.1-8                shape_1.4.6.1            ggrepel_0.9.6           
 [11] deldir_2.0-4             parallelly_1.42.0        magick_2.8.5             MASS_7.3-64              httpuv_1.6.15           
 [16] foreach_1.5.2            withr_3.0.2              ggrastr_1.0.2            survival_3.8-3           memoise_2.0.1           
 [21] ggbeeswarm_0.7.2         janitor_2.2.1            zoo_1.8-12               GlobalOptions_0.1.2      pbapply_1.7-2           
 [26] GGally_2.2.1             rematch2_2.1.2           KEGGREST_1.46.0          promises_1.3.2           httr_1.4.7              
 [31] globals_0.16.3           fitdistrplus_1.2-2       rhdf5filters_1.18.0      rhdf5_2.50.2             rstudioapi_0.17.1       
 [36] UCSC.utils_1.2.0         miniUI_0.1.1.1           generics_0.1.3           dir.expiry_1.14.0        zlibbioc_1.52.0         
 [41] ScaledMatrix_1.14.0      polyclip_1.10-7          quadprog_1.5-8           GenomeInfoDbData_1.2.13  SparseArray_1.6.1       
 [46] xtable_1.8-4             pracma_2.4.4             doParallel_1.0.17        S4Arrays_1.6.0           hms_1.1.3               
 [51] irlba_2.3.5.1            colorspace_2.1-1         filelock_1.0.3           hdf5r_1.3.12             ROCR_1.0-11             
 [56] spatstat.data_3.1-4      magrittr_2.0.3           lmtest_0.9-40            snakecase_0.11.1         later_1.4.1             
 [61] viridis_0.6.5            lattice_0.22-6           spatstat.geom_3.3-5      future.apply_1.11.3      scattermore_1.2         
 [66] cowplot_1.1.3            RcppAnnoy_0.0.22         pillar_1.10.1            nlme_3.1-167             iterators_1.0.14        
 [71] compiler_4.4.2           beachmat_2.22.0          RSpectra_0.16-2          stringi_1.8.4            tensor_1.5              
 [76] plyr_1.8.9               crayon_1.5.3             abind_1.4-8              ggdendro_0.2.0           gridGraphics_0.5-1      
 [81] locfit_1.5-9.10          graphlayouts_1.2.2       bit_4.5.0.1              fastmatch_1.1-6          codetools_0.2-20        
 [86] BiocSingular_1.22.0      paletteer_1.6.0          GetoptLong_1.0.5         plotly_4.10.4            mime_0.12               
 [91] splines_4.4.2            circlize_0.4.16          fastDummies_1.7.5        basilisk_1.18.0          sparseMatrixStats_1.18.0
 [96] cellranger_1.1.0         blob_1.2.4               clue_0.3-66              fs_1.6.5                 listenv_0.9.1           
[101] ggplotify_0.1.2          statmod_1.5.0            tzdb_0.4.0               tweenr_2.0.3             pkgconfig_2.0.3         
[106] tools_4.4.2              cachem_1.1.0             RSQLite_2.3.9            viridisLite_0.4.2        DBI_1.2.3               
[111] fastmap_1.2.0            scales_1.3.0             ica_1.0-3                ggstats_0.8.0            ggprism_1.0.5           
[116] dotCall64_1.2            RANN_2.6.2               farver_2.1.2             tidygraph_1.3.1          cli_3.6.3               
[121] lifecycle_1.0.4          uwot_0.2.2               mvtnorm_1.3-3            bluster_1.16.0           BiocParallel_1.40.0     
[126] timechange_0.3.0         gtable_0.3.6             rjson_0.2.23             ggridges_0.5.6           progressr_0.15.1        
[131] parallel_4.4.2           limma_3.62.2             jsonlite_1.8.9           edgeR_4.4.1              RcppHNSW_0.6.0          
[136] assertthat_0.2.1         bit64_4.6.0-1            Rtsne_0.17               yulab.utils_0.2.0        spatstat.utils_3.1-2    
[141] BiocNeighbors_2.0.1      metapod_1.14.0           dqrng_0.4.1              spatstat.univar_3.1-1    lazyeval_0.2.2          
[146] shiny_1.10.0             htmltools_0.5.8.1        sctransform_0.4.1        rappdirs_0.3.3           basilisk.utils_1.18.0   
[151] glue_1.8.0               spam_2.11-1              XVector_0.46.0           mclust_6.1.1             ks_1.14.3               
[156] mnormt_2.1.1             SCpubr_2.0.2             gridExtra_2.3            igraph_2.1.4             R6_2.5.1                
[161] labeling_0.4.3           cluster_2.1.8            Rhdf5lib_1.28.0          DelayedArray_0.32.0      tidyselect_1.2.1        
[166] vipor_0.4.7              ggforce_0.4.2            rsvd_1.0.5               munsell_0.5.1            KernSmooth_2.23-24      
[171] htmlwidgets_1.6.4        RColorBrewer_1.1-3       rlang_1.1.5              spatstat.sparse_3.1-0    spatstat.explore_3.3-4  
[176] phangorn_2.12.1          beeswarm_0.4.0  
@enblacar
Copy link
Owner

Hi @samgest,

First of all, sorry for taking this long to come back to this Issue! And thanks for using my package!

I am in the process of updating SCpubr to a new major version. Would it be possible to get a copy of your de_genes object to debug this issue? You can send it to scpubr@gmail.com.

Thank you!
Enrique

@enblacar
Copy link
Owner
enblacar commented May 25, 2025

Hi @samgest,

Thanks for sending the object!

I have pushed a commit that I think could solve the issue (6be4e15). I could not reproduce entirely the error with your de_genes object, so this might need another iteration. If you download this commit and it does still not work, please send me the error log again.

Thanks a lot for helping out with this issue!
Enrique

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0