quadbio / Pando

Multiome GRN inference.
https://quadbio.github.io/Pando/
MIT License
111 stars 21 forks source link

Error in MatrixGenerics #10

Closed yojetsharma closed 2 years ago

yojetsharma commented 2 years ago

I ran the Joint RNA and ATAC multiomic tutorial till the Peak Calling and added MACS2 peak set to the Seurat Object (d149 in this case) and started running Pando from thereon. But later I get error in MatrixGenerics:::. I am not sure what I did wrong. Please help.

library(Pando)
data(motifs)
d149.pando <-Seurat::FindVariableFeatures(d149, assay='RNA')
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
> d149.pando <- initiate_grn(d149.pando)
> d149.pando <- find_motifs(
    d149.pando,
    pfm = motifs,
    genome = BSgenome.Hsapiens.UCSC.hg38
)
Adding TF info
Building motif matrix
Finding motif positions
Creating Motif object
> d149.pando <- infer_grn(d149.pando)
Selecting candidate regulatory regions near genes
Error in MatrixGenerics:::.load_next_suggested_package_to_search(x) : 
  Failed to find a rowMaxs() method for lgCMatrix objects.

sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /ncbs_gs/nlsas_data/usershares/praghu/yojetsharma/.conda/envs/Signac/lib/libopenblasp-r0.3.21.so

locale:
 [1] LC_CTYPE=C                 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] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] DelayedMatrixStats_1.19.0         DelayedArray_0.23.2              
 [3] Matrix_1.5-1                      MatrixGenerics_1.9.1             
 [5] matrixStats_0.62.0                Pando_0.5.1                      
 [7] BSgenome.Hsapiens.UCSC.hg38_1.4.4 BSgenome_1.65.2                  
 [9] rtracklayer_1.57.0                Biostrings_2.65.6                
[11] XVector_0.37.1                    EnsDb.Hsapiens.v86_2.99.0        
[13] ensembldb_2.21.5                  AnnotationFilter_1.21.0          
[15] GenomicFeatures_1.49.7            AnnotationDbi_1.59.1             
[17] Biobase_2.57.1                    GenomicRanges_1.49.1             
[19] GenomeInfoDb_1.33.7               IRanges_2.31.2                   
[21] S4Vectors_0.35.4                  BiocGenerics_0.43.4              
[23] sp_1.5-0                          SeuratObject_4.1.2               
[25] Seurat_4.2.0                      Signac_1.8.0                     

loaded via a namespace (and not attached):
  [1] rappdirs_0.3.3              scattermore_0.8            
  [3] R.methodsS3_1.8.2           tidyr_1.2.1                
  [5] ggplot2_3.3.6               bit64_4.0.5                
  [7] knitr_1.40                  R.utils_2.12.0             
  [9] irlba_2.3.5                 data.table_1.14.2          
 [11] rpart_4.1.16                KEGGREST_1.37.3            
 [13] TFBSTools_1.35.0            RCurl_1.98-1.8             
 [15] generics_0.1.3              cowplot_1.1.1              
 [17] RSQLite_2.2.17              RANN_2.6.1                 
 [19] future_1.28.0               ggpointdensity_0.1.0       
 [21] bit_4.0.4                   tzdb_0.3.0                 
 [23] spatstat.data_2.2-0         xml2_1.3.3                 
 [25] httpuv_1.6.6                SummarizedExperiment_1.27.3
 [27] assertthat_0.2.1            DirichletMultinomial_1.39.0
 [29] viridis_0.6.2               xfun_0.33                  
 [31] hms_1.1.2                   promises_1.2.0.1           
 [33] fansi_1.0.3                 restfulr_0.0.15            
 [35] progress_1.2.2              caTools_1.18.2             
 [37] dbplyr_2.2.1                igraph_1.3.5               
 [39] DBI_1.1.3                   htmlwidgets_1.5.4          
 [41] spatstat.geom_2.4-0         purrr_0.3.4                
 [43] ellipsis_0.3.2              dplyr_1.0.10               
 [45] backports_1.4.1             annotate_1.75.0            
 [47] biomaRt_2.53.2              deldir_1.0-6               
 [49] sparseMatrixStats_1.9.0     vctrs_0.4.1                
 [51] ROCR_1.0-11                 abind_1.4-5                
 [53] cachem_1.0.6                withr_2.5.0                
 [55] grr_0.9.5                   ggforce_0.3.4              
 [57] progressr_0.11.0            checkmate_2.1.0            
 [59] sctransform_0.3.5           GenomicAlignments_1.33.1   
 [61] prettyunits_1.1.1           goftest_1.2-3              
 [63] cluster_2.1.4               lazyeval_0.2.2             
 [65] seqLogo_1.63.0              crayon_1.5.1               
 [67] hdf5r_1.3.6                 pkgconfig_2.0.3            
 [69] tweenr_2.0.2                nlme_3.1-159               
 [71] ProtGenerics_1.29.0         nnet_7.3-17                
 [73] pals_1.7                    rlang_1.0.5                
 [75] globals_0.16.1              lifecycle_1.0.2            
 [77] miniUI_0.1.1.1              filelock_1.0.2             
 [79] BiocFileCache_2.5.0         dichromat_2.0-0.1          
 [81] polyclip_1.10-0             lmtest_0.9-40              
 [83] Matrix.utils_0.9.8          zoo_1.8-11                 
 [85] base64enc_0.1-3             ggridges_0.5.3             
 [87] png_0.1-7                   viridisLite_0.4.1          
 [89] rjson_0.2.21                bitops_1.0-7               
 [91] R.oo_1.25.0                 KernSmooth_2.23-20         
 [93] blob_1.2.3                  stringr_1.4.1              
 [95] parallelly_1.32.1           spatstat.random_2.2-0      
 [97] readr_2.1.2                 jpeg_0.1-9                 
 [99] CNEr_1.33.0                 scales_1.2.1               
[101] memoise_2.0.1               magrittr_2.0.3             
[103] plyr_1.8.7                  ica_1.0-3                  
[105] zlibbioc_1.43.0             compiler_4.2.0             
[107] BiocIO_1.7.1                RColorBrewer_1.1-3         
[109] fitdistrplus_1.1-8          Rsamtools_2.13.4           
[111] cli_3.4.0                   listenv_0.8.0              
[113] patchwork_1.1.2             pbapply_1.5-0              
[115] htmlTable_2.4.1             Formula_1.2-4              
[117] MASS_7.3-58.1               mgcv_1.8-40                
[119] tidyselect_1.1.2            stringi_1.7.8              
[121] yaml_2.3.5                  latticeExtra_0.6-30        
[123] ggrepel_0.9.1               grid_4.2.0                 
[125] VariantAnnotation_1.43.3    fastmatch_1.1-3            
[127] tools_4.2.0                 future.apply_1.9.1         
[129] parallel_4.2.0              rstudioapi_0.14            
[131] TFMPvalue_0.0.8             foreign_0.8-82             
[133] gridExtra_2.3               farver_2.1.1               
[135] Rtsne_0.16                  ggraph_2.0.6               
[137] BiocManager_1.30.18         digest_0.6.29              
[139] rgeos_0.5-10                pracma_2.4.2               
[141] shiny_1.7.2                 motifmatchr_1.19.0         
[143] Rcpp_1.0.9                  later_1.3.0                
[145] RcppAnnoy_0.0.19            httr_1.4.4                 
[147] biovizBase_1.45.0           colorspace_2.0-3           
[149] XML_3.99-0.10               tensor_1.5                 
[151] reticulate_1.26             splines_4.2.0              
[153] uwot_0.1.14                 RcppRoll_0.3.0             
[155] spatstat.utils_2.3-1        graphlayouts_0.8.1         
[157] mapproj_1.2.8               plotly_4.10.0              
[159] xtable_1.8-4                jsonlite_1.8.0             
[161] poweRlaw_0.70.6             tidygraph_1.2.2            
[163] R6_2.5.1                    Hmisc_4.7-1                
[165] pillar_1.8.1                htmltools_0.5.3            
[167] mime_0.12                   glue_1.6.2                 
[169] fastmap_1.1.0               BiocParallel_1.31.12       
[171] codetools_0.2-18            maps_3.4.0                 
[173] utf8_1.2.2                  lattice_0.20-45            
[175] spatstat.sparse_2.1-1       tibble_3.1.8               
[177] curl_4.3.2                  leiden_0.4.3               
[179] gtools_3.9.3                GO.db_3.15.0               
[181] interp_1.1-3                survival_3.4-0             
[183] munsell_0.5.0               GenomeInfoDbData_1.2.8     
[185] reshape2_1.4.4              gtable_0.3.1               
[187] spatstat.core_2.4-4
joschif commented 2 years ago

Hi @yojetsharma, unfortunately I'm unsure what causes this, since the error seems to be thrown by MatrixGenerics which is not a direct dependency of Pando. I will look into it and try to reproduce the error.

yojetsharma commented 2 years ago

Sure, thank you! Please let me know if there is anything else required from my side.

On 2022-09-26 14:50, jonas wrote:

Hi @yojetsharma [1], unfortunately I'm unsure what causes this, since the error seems to be thrown by MatrixGenerics which is not a direct dependency of Pando. I will look into it and try to reproduce the error.

-- Reply to this email directly, view it on GitHub [2], or unsubscribe [3]. You are receiving this because you were mentioned.Message ID: @.***>

Links:

[1] https://github.com/yojetsharma [2] https://github.com/quadbiolab/Pando/issues/10#issuecomment-1257742462 [3] https://github.com/notifications/unsubscribe-auth/AS6UNG5EKR5EAALKK5LNSETWAFTEDANCNFSM6AAAAAAQT4E7EI

joschif commented 2 years ago

If you like, you can try if installing older versions of MatrixGenerics or sparseMatrixStats might solve the issue. I have them at 1.6.0 currently and I'm not experiencing the issue

yojetsharma commented 2 years ago

I see. I am using R=4.2.0 and Bioconductor version is 3.15. I am not sure if I will be install older version in this new R. What version is your R?

On 2022-09-26 15:08, jonas wrote:

If you like, you can try if installing older versions of MatrixGenerics or sparseMatrixStats might solve the issue. I have them at 1.6.0 currently and I'm not experiencing the issue

-- Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you were mentioned.Message ID: @.***>

Links:

[1] https://github.com/quadbiolab/Pando/issues/10#issuecomment-1257766580 [2] https://github.com/notifications/unsubscribe-auth/AS6UNGY3TMPSW6G6KERF7DTWAFVJ5ANCNFSM6AAAAAAQT4E7EI

joschif commented 2 years ago

My R is version 4.1.2 and so far I haven't tested Pando on newer versions, but usually package versions and R versions are not necessarily interlinked

yojetsharma commented 2 years ago

Okay. How do I downgrade these packages? Since, I remember they were already installed.

On 2022-09-26 19:18, jonas wrote:

My R is version 4.1.2 and so far I haven't tested Pando on newer versions, but usually package versions and R versions are not necessarily interlinked

-- Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you were mentioned.Message ID: @.***>

Links:

[1] https://github.com/quadbiolab/Pando/issues/10#issuecomment-1258070667 [2] https://github.com/notifications/unsubscribe-auth/AS6UNG5D4AK3CXOL3VJHHV3WAGSSDANCNFSM6AAAAAAQT4E7EI

yojetsharma commented 2 years ago

I ran it again with older versions of the packages that you earlier mentioned but I am still getting the same error.

d149 <- infer_grn(d149)

Selecting candidate regulatory regions near genes

Error in MatrixGenerics:::.load_next_suggested_package_to_search(x) :

Failed to find a rowMaxs() method for lgCMatrix objects.

sessionInfo()

R version 4.1.2 (2021-11-01)

Platform: x86_64-conda-linux-gnu (64-bit)

Running under: CentOS Linux 7 (Core)

Matrix products: default

BLAS/LAPACK: /ncbs_gs/nlsas_data/usershares/praghu/yojetsharma/.conda/envs/scenic/lib/libopenblasp-r0.3.21.so

locale:

[1] LC_CTYPE=C 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] stats graphics grDevices utils datasets methods base

other attached packages:

[1] sp_1.5-0 SeuratObject_4.1.2 Seurat_4.2.0 Pando_0.5.1

loaded via a namespace (and not attached):

[1] fastmatch_1.1-3 plyr_1.8.7

[3] igraph_1.3.5 lazyeval_0.2.2

[5] splines_4.1.2 BiocParallel_1.28.3

[7] listenv_0.8.0 scattermore_0.8

[9] GenomeInfoDb_1.30.1 ggplot2_3.3.6

[11] digest_0.6.29 htmltools_0.5.3

[13] viridis_0.6.2 fansi_1.0.3

[15] magrittr_2.0.3 tensor_1.5

[17] cluster_2.1.4 ROCR_1.0-11

[19] globals_0.16.1 Biostrings_2.62.0

[21] graphlayouts_0.8.1 matrixStats_0.62.0

[23] spatstat.sparse_2.1-1 colorspace_2.0-3

[25] ggrepel_0.9.1 dplyr_1.0.10

[27] crayon_1.5.1 RCurl_1.98-1.8

[29] jsonlite_1.8.0 progressr_0.11.0

[31] spatstat.data_2.2-0 survival_3.4-0

[33] zoo_1.8-11 glue_1.6.2

[35] polyclip_1.10-0 pals_1.7

[37] gtable_0.3.1 zlibbioc_1.40.0

[39] XVector_0.34.0 leiden_0.4.3

[41] DelayedArray_0.20.0 future.apply_1.9.1

[43] BiocGenerics_0.40.0 maps_3.4.0

[45] abind_1.4-5 scales_1.2.1

[47] DBI_1.1.3 Signac_1.8.0

[49] spatstat.random_2.2-0 miniUI_0.1.1.1

[51] Rcpp_1.0.9 viridisLite_0.4.1

[53] xtable_1.8-4 reticulate_1.26

[55] spatstat.core_2.4-4 mapproj_1.2.8

[57] stats4_4.1.2 htmlwidgets_1.5.4

[59] httr_1.4.4 RColorBrewer_1.1-3

[61] ellipsis_0.3.2 ica_1.0-3

[63] pkgconfig_2.0.3 farver_2.1.1

[65] uwot_0.1.14 deldir_1.0-6

[67] utf8_1.2.2 tidyselect_1.1.2

[69] rlang_1.0.6 reshape2_1.4.4

[71] later_1.3.0 munsell_0.5.0

[73] tools_4.1.2 cli_3.4.1

[75] generics_0.1.3 ggridges_0.5.4

[77] stringr_1.4.1 fastmap_1.1.0

[79] goftest_1.2-3 fitdistrplus_1.1-8

[81] tidygraph_1.2.2 purrr_0.3.4

[83] RANN_2.6.1 ggraph_2.0.6

[85] pbapply_1.5-0 future_1.28.0

[87] nlme_3.1-159 sparseMatrixStats_1.6.0

[89] mime_0.12 grr_0.9.5

[91] RcppRoll_0.3.0 compiler_4.1.2

[93] plotly_4.10.0 png_0.1-7

[95] spatstat.utils_2.3-1 tibble_3.1.8

[97] tweenr_2.0.2 stringi_1.7.8

[99] rgeos_0.5-9 lattice_0.20-45

[101] Matrix_1.5-1 vctrs_0.4.1

[103] pillar_1.8.1 lifecycle_1.0.2

[105] BiocManager_1.30.18 spatstat.geom_2.4-0

[107] lmtest_0.9-40 RcppAnnoy_0.0.19

[109] data.table_1.14.2 cowplot_1.1.1

[111] bitops_1.0-7 irlba_2.3.5

[113] Matrix.utils_0.9.8 httpuv_1.6.6

[115] patchwork_1.1.2 GenomicRanges_1.46.1

[117] R6_2.5.1 promises_1.2.0.1

[119] KernSmooth_2.23-20 gridExtra_2.3

[121] IRanges_2.28.0 parallelly_1.32.1

[123] codetools_0.2-18 dichromat_2.0-0.1

[125] MASS_7.3-58.1 assertthat_0.2.1

[127] withr_2.5.0 sctransform_0.3.5

[129] Rsamtools_2.10.0 S4Vectors_0.32.4

[131] GenomeInfoDbData_1.2.7 mgcv_1.8-40

[133] parallel_4.1.2 grid_4.1.2

[135] rpart_4.1.16 tidyr_1.2.1

[137] ggpointdensity_0.1.0 DelayedMatrixStats_1.16.0

[139] MatrixGenerics_1.6.0 Rtsne_0.16

[141] ggforce_0.3.4 shiny_1.7.2

On 2022-09-26 19:18, jonas wrote:

My R is version 4.1.2 and so far I haven't tested Pando on newer versions, but usually package versions and R versions are not necessarily interlinked

-- Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you were mentioned.Message ID: @.***>

Links:

[1] https://github.com/quadbiolab/Pando/issues/10#issuecomment-1258070667 [2] https://github.com/notifications/unsubscribe-auth/AS6UNG5D4AK3CXOL3VJHHV3WAGSSDANCNFSM6AAAAAAQT4E7EI

yojetsharma commented 2 years ago

On 2022-09-26 19:18, jonas wrote:

My R is version 4.1.2 and so far I haven't tested Pando on newer versions, but usually package versions and R versions are not necessarily interlinked

-- Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you were mentioned.Message ID: @.***>

I used remotes:: to install the Pando and not dev tools. Could that be the issue?

Links:

[1] https://github.com/quadbiolab/Pando/issues/10#issuecomment-1258070667 [2] https://github.com/notifications/unsubscribe-auth/AS6UNG5D4AK3CXOL3VJHHV3WAGSSDANCNFSM6AAAAAAQT4E7EI

joschif commented 2 years ago

I'm not sure if there is a functional difference the between and devtools function... We will test it on the new versions and let you know. Also it might be helpful if you could send the full error traceback by typing traceback() right after you get the error

johnblair7 commented 2 years ago

I am also having this error - here is the traceback:

> traceback()
8: stop(short_errmsg)
7: MatrixGenerics:::.load_next_suggested_package_to_search(x)
6: rowMaxs(peaks2motif)
5: rowMaxs(peaks2motif)
4: fit_grn_models.SeuratPlus(object = object, genes = genes, network_name = network_name, 
       peak_to_gene_method = peak_to_gene_method, upstream = upstream, 
       downstream = downstream, extend = extend, only_tss = only_tss, 
       parallel = parallel, tf_cor = tf_cor, peak_cor = peak_cor, 
       aggregate_rna_col = aggregate_rna_col, aggregate_peaks_col = aggregate_peaks_col, 
       method = method, alpha = alpha, family = family, interaction_term = interaction_term, 
       adjust_method = adjust_method, scale = scale, verbose = verbose, 
       ...)
3: fit_grn_models(object = object, genes = genes, network_name = network_name, 
       peak_to_gene_method = peak_to_gene_method, upstream = upstream, 
       downstream = downstream, extend = extend, only_tss = only_tss, 
       parallel = parallel, tf_cor = tf_cor, peak_cor = peak_cor, 
       aggregate_rna_col = aggregate_rna_col, aggregate_peaks_col = aggregate_peaks_col, 
       method = method, alpha = alpha, family = family, interaction_term = interaction_term, 
       adjust_method = adjust_method, scale = scale, verbose = verbose, 
       ...)
2: infer_grn.SeuratPlus(seurat_object, peak_to_gene_method = "Signac")
1: infer_grn(seurat_object, peak_to_gene_method = "Signac")
yojetsharma commented 2 years ago

On 2022-09-27 18:54, jonas wrote:

I'm not sure if there is a functional difference the between and devtools function... We will test it on the new versions and let you know. Also it might be helpful if you could send the full error traceback by typing traceback() right after you get the error

-- Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you were mentioned.Message ID: @.***>

Now, I reinstalled everything (bioconductor and its packages) and installed Pando using dev tools. MatrixGenerics and sparseMatrixStats are at 1.6.0 as you suggested. But still the same error

D149 <- INFER_GRN(D149)

SELECTING CANDIDATE REGULATORY REGIONS NEAR GENES

ERROR IN MATRIXGENERICS:::.LOAD_NEXT_SUGGESTED_PACKAGE_TO_SEARCH(X) :

FAILED TO FIND A ROWMAXS() METHOD FOR LGCMATRIX OBJECTS.

traceback()

13: stop(short_errmsg)

12: MatrixGenerics:::.load_next_suggested_package_to_search(x)

11: rowMaxs(x = x)

10: rowMaxs(x = x)

9: eval(call, parent.frame())

8: eval(call, parent.frame())

7: callGeneric()

6: rowMaxs(peaks2motif)

5: rowMaxs(peaks2motif)

4: fit_grn_models.SeuratPlus(object = object, genes = genes, network_name = network_name,

   peak_to_gene_method = peak_to_gene_method, upstream = upstream,  

   downstream = downstream, extend = extend, only_tss = only_tss,  

   parallel = parallel, tf_cor = tf_cor, peak_cor = peak_cor,  

   aggregate_rna_col = aggregate_rna_col, aggregate_peaks_col =

aggregate_peaks_col,

   method = method, alpha = alpha, family = family, interaction_term

= interaction_term,

   adjust_method = adjust_method, scale = scale, verbose = verbose, 

   ...) 

3: fit_grn_models(object = object, genes = genes, network_name = network_name,

   peak_to_gene_method = peak_to_gene_method, upstream = upstream,  

   downstream = downstream, extend = extend, only_tss = only_tss,  

   parallel = parallel, tf_cor = tf_cor, peak_cor = peak_cor,  

   aggregate_rna_col = aggregate_rna_col, aggregate_peaks_col =

aggregate_peaks_col,

   method = method, alpha = alpha, family = family, interaction_term

= interaction_term,

   adjust_method = adjust_method, scale = scale, verbose = verbose, 

   ...) 

2: infer_grn.SeuratPlus(d149)

1: infer_grn(d149)

R version 4.1.2 (2021-11-01)

Platform: x86_64-conda-linux-gnu (64-bit)

Running under: CentOS Linux 7 (Core)

Matrix products: default

BLAS/LAPACK: /ncbs_gs/nlsas_data/usershares/praghu/yojetsharma/.conda/envs/scenic/lib/libopenblasp-r0.3.21.so

Random number generation:

RNG: L'Ecuyer-CMRG

Normal: Inversion

Sample: Rejection

locale:

[1] LC_CTYPE=C 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] stats4 stats graphics grDevices utils datasets methods

[8] base

other attached packages:

[1] BSgenome.Hsapiens.UCSC.hg38_1.4.4 BSgenome_1.62.0

[3] rtracklayer_1.54.0 Biostrings_2.62.0

[5] XVector_0.34.0 GenomicRanges_1.46.1

[7] GenomeInfoDb_1.30.1 IRanges_2.28.0

[9] S4Vectors_0.32.4 BiocGenerics_0.40.0

[11] sp_1.5-0 SeuratObject_4.1.2

[13] Seurat_4.2.0 Pando_0.5.1

loaded via a namespace (and not attached):

[1] utf8_1.2.2 reticulate_1.26

[3] tidyselect_1.1.2 htmlwidgets_1.5.4

[5] grid_4.1.2 BiocParallel_1.28.3

[7] Rtsne_0.16 devtools_2.4.4

[9] munsell_0.5.0 codetools_0.2-18

[11] ica_1.0-3 future_1.28.0

[13] miniUI_0.1.1.1 withr_2.5.0

[15] spatstat.random_2.2-0 colorspace_2.0-3

[17] progressr_0.11.0 Biobase_2.54.0

[19] ROCR_1.0-11 tensor_1.5

[21] listenv_0.8.0 MatrixGenerics_1.6.0

[23] GenomeInfoDbData_1.2.7 polyclip_1.10-0

[25] farver_2.1.1 Matrix.utils_0.9.8

[27] parallelly_1.32.1 vctrs_0.4.1

[29] generics_0.1.3 R6_2.5.1

[31] graphlayouts_0.8.1 pals_1.7

[33] DelayedArray_0.20.0 bitops_1.0-7

[35] spatstat.utils_2.3-1 cachem_1.0.6

[37] assertthat_0.2.1 promises_1.2.0.1

[39] BiocIO_1.4.0 scales_1.2.1

[41] ggraph_2.0.6 rgeos_0.5-9

[43] gtable_0.3.1 globals_0.16.1

[45] processx_3.7.0 goftest_1.2-3

[47] tidygraph_1.2.2 rlang_1.0.6

[49] RcppRoll_0.3.0 splines_4.1.2

[51] lazyeval_0.2.2 dichromat_2.0-0.1

[53] spatstat.geom_2.4-0 BiocManager_1.30.18

[55] yaml_2.3.5 reshape2_1.4.4

[57] abind_1.4-5 httpuv_1.6.6

[59] tools_4.1.2 usethis_2.1.6

[61] ggplot2_3.3.6 ellipsis_0.3.2

[63] spatstat.core_2.4-4 RColorBrewer_1.1-3

[65] sessioninfo_1.2.2 ggridges_0.5.4

[67] Rcpp_1.0.9 plyr_1.8.7

[69] sparseMatrixStats_1.6.0 zlibbioc_1.40.0

[71] purrr_0.3.4 RCurl_1.98-1.8

[73] ps_1.7.1 prettyunits_1.1.1

[75] rpart_4.1.16 deldir_1.0-6

[77] pbapply_1.5-0 viridis_0.6.2

[79] cowplot_1.1.1 urlchecker_1.0.1

[81] zoo_1.8-11 grr_0.9.5

[83] SummarizedExperiment_1.24.0 ggrepel_0.9.1

[85] cluster_2.1.4 fs_1.5.2

[87] magrittr_2.0.3 data.table_1.14.2

[89] scattermore_0.8 lmtest_0.9-40

[91] RANN_2.6.1 fitdistrplus_1.1-8

[93] Signac_1.8.0 matrixStats_0.62.0

[95] pkgload_1.3.0 patchwork_1.1.2

[97] mime_0.12 xtable_1.8-4

[99] XML_3.99-0.10 gridExtra_2.3

[101] compiler_4.1.2 tibble_3.1.8

[103] maps_3.4.0 KernSmooth_2.23-20

[105] crayon_1.5.1 ggpointdensity_0.1.0

[107] htmltools_0.5.3 mgcv_1.8-40

[109] later_1.3.0 tidyr_1.2.1

[111] DBI_1.1.3 tweenr_2.0.2

[113] MASS_7.3-58.1 Matrix_1.5-1

[115] cli_3.4.1 parallel_4.1.2

[117] igraph_1.3.5 pkgconfig_2.0.3

[119] GenomicAlignments_1.30.0 plotly_4.10.0

[121] spatstat.sparse_2.1-1 stringr_1.4.1

[123] callr_3.7.2 digest_0.6.29

[125] sctransform_0.3.5 RcppAnnoy_0.0.19

[127] spatstat.data_2.2-0 leiden_0.4.3

[129] fastmatch_1.1-3 uwot_0.1.14

[131] DelayedMatrixStats_1.16.0 restfulr_0.0.15

[133] curl_4.3.2 shiny_1.7.2

[135] Rsamtools_2.10.0 rjson_0.2.21

[137] lifecycle_1.0.2 nlme_3.1-159

[139] jsonlite_1.8.0 mapproj_1.2.8

[141] viridisLite_0.4.1 fansi_1.0.3

[143] pillar_1.8.1 lattice_0.20-45

[145] fastmap_1.1.0 httr_1.4.4

[147] pkgbuild_1.3.1 survival_3.4-0

[149] glue_1.6.2 remotes_2.4.2

[151] png_0.1-7 ggforce_0.3.4

[153] stringi_1.7.8 profvis_0.3.7

[155] memoise_2.0.1 dplyr_1.0.10

[157] irlba_2.3.5 future.apply_1.9.1

Links:

[1] https://github.com/quadbiolab/Pando/issues/10#issuecomment-1259505209 [2] https://github.com/notifications/unsubscribe-auth/AS6UNG7QOZHF3EDUZSS6JTLWALYSRANCNFSM6AAAAAAQT4E7EI

johnblair7 commented 2 years ago

Working on this, it looks like the problem is at line 255 of the function

peaks_with_motif <- as.logical(rowMaxs(peaks2motif))

Where basically there no longer seems to be a function (from some package that got updated i assume) to call a maximum value (aka true) on a logical matrix. I am far too stupid to figure it out but that does appear to be the problem. As a workaround, I just made the function only use the peaks that are in genes peaks_at_gene and ignore the peaks_with_motif for the next set of things. I think there is a very low likelihood that a peak won't have a single TF motif in it, considering how common they are, so i think it's not a big deal to remove it, but maybe I am misunderstanding that part of the function!

Anyways, I removed it and it seems to be running fine now, so we'll see....

yojetsharma commented 2 years ago

Working on this, it looks like the problem is at line 255 of the function

peaks_with_motif <- as.logical(rowMaxs(peaks2motif))

Where basically there no longer seems to be a function (from some package that got updated i assume) to call a maximum value (aka true) on a logical matrix. I am far too stupid to figure it out but that does appear to be the problem. As a workaround, I just made the function only use the peaks that are in genes peaks_at_gene and ignore the peaks_with_motif for the next set of things. I think there is a very low likelihood that a peak won't have a single TF motif in it, considering how common they are, so i think it's not a big deal to remove it, but maybe I am misunderstanding that part of the function!

Anyways, I removed it and it seems to be running fine now, so we'll see....

I’m new to this so can you please provide the details of how you removed it? And how to make the function use only the peaks that are in genes peaks_at_gene and ignore the peaks_with_motif?

joschif commented 2 years ago

Great, thank you for the detailed descriptions and suggested fix. I assume @johnblair7 you are also running a more recent version of R and/or MatrixGenerics? I'll test it and will try to push a new version some time this week.

johnblair7 commented 2 years ago

Thanks Jonas, Here is my session info - Running R4.1.3 and MatrixGenerics 1.6. Also my fix doesn't seem to fully work as I ran the function overnight just now and it still didn't finish (trying to do 1605 genes? is that too many?)

@yojetsharma I just "forked" pando into my own repository (basically means that i copied the whole code to my own profile) and then went into where the "infer_grn" scripts were (R/grn.R from the main folder) and just deleted/edited those two lines. Then I uninstalled the version of pando that I had and reinstalled my own version using devtools::install_github('johnblair7/pando2') and ran everything as I would in pando "normal". But seeing as how it didn't end up running all the way through (no error, just timed out), its probably better just to wait for @joschif to look into it and deal with it properly

> sessionInfo()
R version 4.1.3 (2022-03-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.5 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.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   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] BSgenome.Hsapiens.UCSC.hg38_1.4.4 BSgenome_1.62.0                   rtracklayer_1.54.0                Biostrings_2.62.0                
 [5] XVector_0.34.0                    GenomicRanges_1.46.1              GenomeInfoDb_1.30.1               IRanges_2.28.0                   
 [9] S4Vectors_0.32.4                  BiocGenerics_0.40.0               sp_1.5-0                          SeuratObject_4.1.2               
[13] Seurat_4.2.0                      Pando_0.5.1                      

loaded via a namespace (and not attached):
  [1] utf8_1.2.2                  reticulate_1.26             tidyselect_1.1.2            htmlwidgets_1.5.4           grid_4.1.3                 
  [6] BiocParallel_1.28.3         Rtsne_0.16                  devtools_2.4.4              munsell_0.5.0               codetools_0.2-18           
 [11] ica_1.0-3                   future_1.28.0               miniUI_0.1.1.1              withr_2.5.0                 spatstat.random_2.2-0      
 [16] colorspace_2.0-3            progressr_0.11.0            Biobase_2.54.0              rstudioapi_0.14             ROCR_1.0-11                
 [21] tensor_1.5                  listenv_0.8.0               MatrixGenerics_1.6.0        GenomeInfoDbData_1.2.7      polyclip_1.10-0            
 [26] farver_2.1.1                parallelly_1.32.1           vctrs_0.4.1                 generics_0.1.3              R6_2.5.1                   
 [31] graphlayouts_0.8.1          pals_1.7                    DelayedArray_0.20.0         bitops_1.0-7                spatstat.utils_2.3-1       
 [36] cachem_1.0.6                assertthat_0.2.1            promises_1.2.0.1            BiocIO_1.4.0                scales_1.2.1               
 [41] ggraph_2.0.6                rgeos_0.5-9                 gtable_0.3.1                globals_0.16.1              processx_3.7.0             
 [46] goftest_1.2-3               tidygraph_1.2.2             rlang_1.0.6                 RcppRoll_0.3.0              splines_4.1.3              
 [51] lazyeval_0.2.2              dichromat_2.0-0.1           spatstat.geom_2.4-0         yaml_2.3.5                  reshape2_1.4.4             
 [56] abind_1.4-5                 httpuv_1.6.6                tools_4.1.3                 usethis_2.1.6               ggplot2_3.3.6              
 [61] ellipsis_0.3.2              spatstat.core_2.4-4         RColorBrewer_1.1-3          sessioninfo_1.2.2           ggridges_0.5.4             
 [66] Rcpp_1.0.9                  plyr_1.8.7                  sparseMatrixStats_1.6.0     zlibbioc_1.40.0             purrr_0.3.4                
 [71] RCurl_1.98-1.8              ps_1.7.1                    prettyunits_1.1.1           rpart_4.1.16                deldir_1.0-6               
 [76] pbapply_1.5-0               viridis_0.6.2               cowplot_1.1.1               urlchecker_1.0.1            zoo_1.8-11                 
 [81] SummarizedExperiment_1.24.0 ggrepel_0.9.1               cluster_2.1.3               fs_1.5.2                    magrittr_2.0.3             
 [86] data.table_1.14.2           scattermore_0.8             lmtest_0.9-40               RANN_2.6.1                  fitdistrplus_1.1-8         
 [91] Signac_1.8.0                matrixStats_0.62.0          pkgload_1.3.0               patchwork_1.1.2             mime_0.12                  
 [96] xtable_1.8-4                XML_3.99-0.10               gridExtra_2.3               compiler_4.1.3              tibble_3.1.8               
[101] maps_3.4.0                  KernSmooth_2.23-20          crayon_1.5.1                ggpointdensity_0.1.0        htmltools_0.5.3            
[106] mgcv_1.8-40                 later_1.3.0                 tidyr_1.2.1                 DBI_1.1.3                   tweenr_2.0.2               
[111] MASS_7.3-56                 Matrix_1.5-1                cli_3.4.1                   parallel_4.1.3              igraph_1.3.5               
[116] pkgconfig_2.0.3             GenomicAlignments_1.30.0    plotly_4.10.0               spatstat.sparse_2.1-1       stringr_1.4.1              
[121] callr_3.7.2                 digest_0.6.29               sctransform_0.3.5           RcppAnnoy_0.0.19            spatstat.data_2.2-0        
[126] leiden_0.4.3                fastmatch_1.1-3             uwot_0.1.14                 restfulr_0.0.15             shiny_1.7.2                
[131] Rsamtools_2.10.0            rjson_0.2.21                lifecycle_1.0.2             nlme_3.1-159                jsonlite_1.8.0             
[136] mapproj_1.2.8               viridisLite_0.4.1           fansi_1.0.3                 pillar_1.8.1                lattice_0.20-45            
[141] fastmap_1.1.0               httr_1.4.4                  pkgbuild_1.3.1              survival_3.4-0              glue_1.6.2                 
[146] remotes_2.4.2               png_0.1-7                   ggforce_0.3.4               presto_1.0.0                stringi_1.7.8              
[151] profvis_0.3.7               memoise_2.0.1               dplyr_1.0.10                irlba_2.3.5                 future.apply_1.9.1   
joschif commented 2 years ago

Hi all, it seems like there are some issues with some of the matrix classes of newer Matrix versions. I have pushed a new commit to the devel branch which should fix the above issue, but I haven't had time to fully test it. Also I expect that there will be other problems related to this. I will look into it when I'm back from holiday end of October.

joschif commented 2 years ago

I now had some time to test a new version for 4.2 and pushed it to main. I believe this issue should be fixed, but please let me know how it works for you.

Harrison-Q-Ma commented 1 year ago

Thank you guys for making such a great tool and I am trying to use it in my research. However I am still running into the same issue as people were describing above. Here's the session info and error:

Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

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

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

other attached packages:
 [1] sparseMatrixStats_1.11.1           MatrixGenerics_1.10.0             
 [3] matrixStats_0.63.0                 TFBSTools_1.36.0                  
 [5] JASPAR2022_0.99.7                  BiocFileCache_2.6.1               
 [7] dbplyr_2.3.2                       future_1.32.0                     
 [9] doParallel_1.0.17                  iterators_1.0.14                  
[11] foreach_1.5.2                      Signac_1.9.0                      
[13] lubridate_1.9.2                    forcats_1.0.0                     
[15] stringr_1.5.0                      dplyr_1.1.1                       
[17] purrr_1.0.1                        readr_2.1.4                       
[19] tidyr_1.3.0                        tibble_3.2.1                      
[21] ggplot2_3.4.2                      tidyverse_2.0.0                   
[23] EnsDb.Mmusculus.v79_2.99.0         ensembldb_2.22.0                  
[25] AnnotationFilter_1.22.0            GenomicFeatures_1.50.4            
[27] AnnotationDbi_1.60.2               Biobase_2.58.0                    
[29] BSgenome.Mmusculus.UCSC.mm10_1.4.3 BSgenome_1.66.3                   
[31] rtracklayer_1.58.0                 Biostrings_2.66.0                 
[33] XVector_0.38.0                     GenomicRanges_1.50.2              
[35] GenomeInfoDb_1.34.9                IRanges_2.32.0                    
[37] S4Vectors_0.36.2                   BiocGenerics_0.44.0               
[39] SeuratObject_4.1.3                 Seurat_4.3.0                      
[41] Pando_1.0.3                       

loaded via a namespace (and not attached):
  [1] rappdirs_0.3.3              pbdZMQ_0.3-9               
  [3] scattermore_0.8             R.methodsS3_1.8.2          
  [5] bit64_4.0.5                 irlba_2.3.5.1              
  [7] DelayedArray_0.24.0         R.utils_2.12.2             
  [9] data.table_1.14.8           KEGGREST_1.38.0            
 [11] RCurl_1.98-1.12             generics_0.1.3             
 [13] cowplot_1.1.1               RSQLite_2.3.1              
 [15] RANN_2.6.1                  ggpointdensity_0.1.0       
 [17] bit_4.0.5                   tzdb_0.3.0                 
 [19] spatstat.data_3.0-1         xml2_1.3.3                 
 [21] httpuv_1.6.9                SummarizedExperiment_1.28.0
 [23] DirichletMultinomial_1.40.0 viridis_0.6.2              
 [25] hms_1.1.3                   evaluate_0.20              
 [27] promises_1.2.0.1            fansi_1.0.4                
 [29] restfulr_0.0.15             progress_1.2.2             
 [31] caTools_1.18.2              igraph_1.4.2               
 [33] DBI_1.1.3                   htmlwidgets_1.6.2          
 [35] spatstat.geom_3.1-0         ellipsis_0.3.2             
 [37] annotate_1.76.0             biomaRt_2.54.1             
 [39] deldir_1.0-6                vctrs_0.6.1                
 [41] ROCR_1.0-11                 abind_1.4-5                
 [43] cachem_1.0.7                withr_2.5.0                
 [45] ggforce_0.4.1               grr_0.9.5                  
 [47] progressr_0.13.0            sctransform_0.3.5          
 [49] GenomicAlignments_1.34.1    prettyunits_1.1.1          
 [51] goftest_1.2-3               cluster_2.1.4              
 [53] IRdisplay_1.1               lazyeval_0.2.2             
 [55] seqLogo_1.64.0              crayon_1.5.2               
 [57] spatstat.explore_3.1-0      pkgconfig_2.0.3            
 [59] tweenr_2.0.2                nlme_3.1-162               
 [61] ProtGenerics_1.30.0         pals_1.7                   
 [63] rlang_1.1.0                 globals_0.16.2             
 [65] lifecycle_1.0.3             miniUI_0.1.1.1             
 [67] filelock_1.0.2              dichromat_2.0-0.1          
 [69] polyclip_1.10-4             lmtest_0.9-40              
 [71] Matrix_1.5-1                IRkernel_1.3.2             
 [73] zoo_1.8-12                  base64enc_0.1-3            
 [75] ggridges_0.5.4              png_0.1-8                  
 [77] viridisLite_0.4.1           rjson_0.2.21               
 [79] bitops_1.0-7                R.oo_1.25.0                
 [81] KernSmooth_2.23-20          blob_1.2.4                 
 [83] parallelly_1.35.0           spatstat.random_3.1-4      
 [85] CNEr_1.34.0                 scales_1.2.1               
 [87] memoise_2.0.1               magrittr_2.0.3             
 [89] plyr_1.8.8                  ica_1.0-3                  
 [91] zlibbioc_1.44.0             compiler_4.2.3             
 [93] BiocIO_1.8.0                RColorBrewer_1.1-3         
 [95] fitdistrplus_1.1-8          Rsamtools_2.14.0           
 [97] cli_3.6.1                   listenv_0.9.0              
 [99] patchwork_1.1.2             pbapply_1.7-0              
[101] MASS_7.3-58.3               tidyselect_1.2.0           
[103] stringi_1.7.12              yaml_2.3.7                 
[105] ggrepel_0.9.3               grid_4.2.3                 
[107] fastmatch_1.1-3             tools_4.2.3                
[109] timechange_0.2.0            future.apply_1.10.0        
[111] uuid_1.1-0                  TFMPvalue_0.0.9            
[113] gridExtra_2.3               farver_2.1.1               
[115] Rtsne_0.16                  ggraph_2.1.0               
[117] digest_0.6.31               shiny_1.7.4                
[119] pracma_2.4.2                Rcpp_1.0.10                
[121] later_1.3.0                 RcppAnnoy_0.0.20           
[123] httr_1.4.5                  colorspace_2.1-0           
[125] XML_3.99-0.14               tensor_1.5                 
[127] reticulate_1.28             splines_4.2.3              
[129] uwot_0.1.14                 RcppRoll_0.3.0             
[131] spatstat.utils_3.0-2        graphlayouts_0.8.4         
[133] sp_1.6-0                    mapproj_1.2.11             
[135] plotly_4.10.1               xtable_1.8-4               
[137] jsonlite_1.8.4              poweRlaw_0.70.6            
[139] tidygraph_1.2.3             R6_2.5.1                   
[141] pillar_1.9.0                htmltools_0.5.5            
[143] mime_0.12                   glue_1.6.2                 
[145] fastmap_1.1.1               BiocParallel_1.32.6        
[147] codetools_0.2-19            maps_3.4.1                 
[149] utf8_1.2.3                  lattice_0.20-45            
[151] spatstat.sparse_3.0-1       curl_5.0.0                 
[153] leiden_0.4.3                gtools_3.9.4               
[155] GO.db_3.16.0                survival_3.5-3             
[157] repr_1.1.6                  munsell_0.5.0              
[159] GenomeInfoDbData_1.2.9      reshape2_1.4.4             
[161] gtable_0.3.3               

Error Messages:


Preparing model input

Fitting models for 1789 target genes

Error in {: task 2 failed - "ℹ In index: 1.
Caused by error in `MatrixGenerics:::.load_next_suggested_package_to_search()`:
! Failed to find a colMaxs() method for tbl_df objects.Failed to find a colMaxs() method for tbl objects.Failed to find a colMaxs() method for data.frame objects."
Traceback:

1. infer_grn(sobj, peak_to_gene_method = "Signac", upstream = 1e+06, 
 .     downstream = 1e+06, method = "xgb", tf_cor = 0, scale = TRUE, 
 .     interaction_term = "*", parallel = T)
2. infer_grn.SeuratPlus(sobj, peak_to_gene_method = "Signac", upstream = 1e+06, 
 .     downstream = 1e+06, method = "xgb", tf_cor = 0, scale = TRUE, 
 .     interaction_term = "*", parallel = T)
3. fit_grn_models(object = object, genes = genes, network_name = network_name, 
 .     peak_to_gene_method = peak_to_gene_method, upstream = upstream, 
 .     downstream = downstream, extend = extend, only_tss = only_tss, 
 .     parallel = parallel, tf_cor = tf_cor, peak_cor = peak_cor, 
 .     aggregate_rna_col = aggregate_rna_col, aggregate_peaks_col = aggregate_peaks_col, 
 .     method = method, alpha = alpha, family = family, interaction_term = interaction_term, 
 .     adjust_method = adjust_method, scale = scale, verbose = verbose, 
 .     ...)
4. fit_grn_models.SeuratPlus(object = object, genes = genes, network_name = network_name, 
 .     peak_to_gene_method = peak_to_gene_method, upstream = upstream, 
 .     downstream = downstream, extend = extend, only_tss = only_tss, 
 .     parallel = parallel, tf_cor = tf_cor, peak_cor = peak_cor, 
 .     aggregate_rna_col = aggregate_rna_col, aggregate_peaks_col = aggregate_peaks_col, 
 .     method = method, alpha = alpha, family = family, interaction_term = interaction_term, 
 .     adjust_method = adjust_method, scale = scale, verbose = verbose, 
 .     ...)
5. map_par(features, function(g) {
 .     if (!g %in% rownames(peaks2gene)) {
 .         log_message("Warning: ", g, " not found in EnsDb", verbose = verbose == 
 .             2)
 .         return()
 .     }
 .     gene_peaks <- as.logical(peaks2gene[g, ])
 .     if (sum(gene_peaks) == 0) {
 .         log_message("Warning: No peaks found near ", g, verbose = verbose == 
 .             2)
 .         return()
 .     }
 .     g_x <- gene_data[gene_groups, g, drop = FALSE]
 .     peak_x <- peak_data[peak_groups, gene_peaks, drop = FALSE]
 .     peak_g_cor <- as(sparse_cor(peak_x, g_x), "generalMatrix")
 .     peak_g_cor[is.na(peak_g_cor)] <- 0
 .     peaks_use <- rownames(peak_g_cor)[abs(peak_g_cor[, 1]) > 
 .         peak_cor]
...
 . }, verbose = verbose, parallel = parallel)
6. foreach::foreach(i = 1:length(x)) %dopar% {
 .     fun(x[[i]])
 . }
7. e$fun(obj, substitute(ex), parent.frame(), e$data)

I have previously used R version 4.1.3 with sparseMatrixStats and MatrixGenerics 1.6.0 but that did not work either. Can anyone help me with this? Thank you all very much!