egeulgen / pathfindR

pathfindR: Enrichment Analysis Utilizing Active Subnetworks
https://egeulgen.github.io/pathfindR/
Other
177 stars 25 forks source link

Error in { : task 1 failed - "could not find function "active_snw_search"" #164

Closed PyrearSuhuiZhao closed 11 months ago

PyrearSuhuiZhao commented 1 year ago

Hi,

pathfindR is an amazing tool to analyze the enriched gene and its pathway. I am using it on my data set. I made the required dataframe,

input_UP.Gene input_UP.log2FoldChange input_UP.padj 1 TIAM2 4.436077 4.822046e-174 2 NAMPT 7.007628 4.338000e-98 3 SPRY1 7.110435 8.318978e-97 4 POLB 2.931225 2.901540e-85 5 KCNK5 6.093810 6.073096e-85 6 CD200 6.098573 2.619538e-79 7 NR4A2 6.318238 3.431318e-73 8 HSPE1 4.012742 5.502913e-63 9 TNFRSF9 4.980874 4.893399e-62

But when I run the run_pathfindR, I encounter the following errors,

output_UP <- run_pathfindR(input_UP, interations = 25)

Testing input

The input looks OK

Processing input. Converting gene symbols,

if necessary (and if human gene symbols provided) Number of genes provided in input: 3754 Number of genes in input after p-value filtering: 3642 pathfindR cannot handle p values < 1e-13. These were changed to 1e-13 Could not find any interactions for 129 (3.54%) genes in the PIN Final number of genes in input: 3513 Error in active_snw_enrichment_wrapper(input_processed, pin_path, gset_list, : unused argument (interations = 25)

How should I fix this problem? Thank you, Py

egeulgen commented 1 year ago

You have a typo, it should be “iterations”-EOn 15 Jun 2023, at 13:37, PyrearSuhuiZhao @.***> wrote: Hi, pathfindR is an amazing tool to analyze the enriched gene and its pathway. I am using it on my data set. I made the required dataframe, input_UP.Gene input_UP.log2FoldChange input_UP.padj 1 TIAM2 4.436077 4.822046e-174 2 NAMPT 7.007628 4.338000e-98 3 SPRY1 7.110435 8.318978e-97 4 POLB 2.931225 2.901540e-85 5 KCNK5 6.093810 6.073096e-85 6 CD200 6.098573 2.619538e-79 7 NR4A2 6.318238 3.431318e-73 8 HSPE1 4.012742 5.502913e-63 9 TNFRSF9 4.980874 4.893399e-62 But when I run the run_pathfindR, I encounter the following errors,

output_UP <- run_pathfindR(input_UP, interations = 25)

Testing input The input looks OK Processing input. Converting gene symbols, if necessary (and if human gene symbols provided)

Number of genes provided in input: 3754 Number of genes in input after p-value filtering: 3642 pathfindR cannot handle p values < 1e-13. These were changed to 1e-13 Could not find any interactions for 129 (3.54%) genes in the PIN Final number of genes in input: 3513 Error in active_snw_enrichment_wrapper(input_processed, pin_path, gset_list, : unused argument (interations = 25) How should I fix this problem? Thank you, Py

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

PyrearSuhuiZhao commented 1 year ago

I fixed it and it still has the same issue.

output_UP <- run_pathfindR(input_UP, iterations = 25)

Testing input

The input looks OK

Processing input. Converting gene symbols,

if necessary (and if human gene symbols provided) Number of genes provided in input: 3754 Number of genes in input after p-value filtering: 3642 pathfindR cannot handle p values < 1e-13. These were changed to 1e-13

Could not find any interactions for 129 (3.54%) genes in the PIN Final number of genes in input: 3513

Performing Active Subnetwork Search and Enrichment

Error in { : task 1 failed - "could not find function "active_snw_search""

PyrearSuhuiZhao commented 1 year ago

Here is the session info,

sessionInfo() R version 4.1.2 (2021-11-01) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

Matrix products: default BLAS/LAPACK: /panfs/pan01/hpc/apps/source/production/lib-6.7/mkl/2022.2.1/mkl/2022.2.1/lib/intel64/libmkl_gf_lp64.so.2

Random number generation: RNG: Mersenne-Twister Normal: Inversion Sample: Rounding

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] stats4 stats graphics grDevices utils datasets methods base

other attached packages: [1] pathfindR_2.1.0 pathfindR.data_2.0.0
[3] reshape2_1.4.4 BiocParallel_1.28.3
[5] lubridate_1.9.2 forcats_1.0.0
[7] stringr_1.5.0 dplyr_1.1.2
[9] purrr_1.0.1 readr_2.1.4
[11] tidyr_1.3.0 tibble_3.2.1
[13] ggplot2_3.4.2 tidyverse_2.0.0
[15] DESeq2_1.34.0 SummarizedExperiment_1.24.0 [17] Biobase_2.54.0 MatrixGenerics_1.6.0
[19] matrixStats_1.0.0 GenomicRanges_1.46.1
[21] GenomeInfoDb_1.30.1 IRanges_2.28.0
[23] S4Vectors_0.32.4 BiocGenerics_0.40.0

loaded via a namespace (and not attached): [1] bitops_1.0-7 bit64_4.0.5 doParallel_1.0.17
[4] RColorBrewer_1.1-3 httr_1.4.6 tools_4.1.2
[7] utf8_1.2.3 R6_2.5.1 DBI_1.1.3
[10] colorspace_2.1-0 withr_2.5.0 gridExtra_2.3
[13] tidyselect_1.2.0 bit_4.0.5 compiler_4.1.2
[16] cli_3.6.1 DelayedArray_0.20.0 scales_1.2.1
[19] genefilter_1.76.0 digest_0.6.31 rmarkdown_2.22
[22] XVector_0.34.0 htmltools_0.5.5 pkgconfig_2.0.3
[25] fastmap_1.1.1 rlang_1.1.1 rstudioapi_0.14
[28] RSQLite_2.3.1 farver_2.1.1 generics_0.1.3
[31] RCurl_1.98-1.12 magrittr_2.0.3 GenomeInfoDbData_1.2.7 [34] Matrix_1.5-4.1 Rcpp_1.0.10 munsell_0.5.0
[37] fansi_1.0.4 viridis_0.6.3 lifecycle_1.0.3
[40] stringi_1.7.12 ggraph_2.1.0 MASS_7.3-54
[43] zlibbioc_1.40.0 org.Hs.eg.db_3.14.0 plyr_1.8.8
[46] grid_4.1.2 blob_1.2.4 ggrepel_0.9.3
[49] parallel_4.1.2 crayon_1.5.2 lattice_0.20-45
[52] graphlayouts_1.0.0 Biostrings_2.62.0 splines_4.1.2
[55] annotate_1.72.0 hms_1.1.3 KEGGREST_1.34.0
[58] locfit_1.5-9.8 knitr_1.43 pillar_1.9.0
[61] igraph_1.4.3 geneplotter_1.72.0 codetools_0.2-18
[64] XML_3.99-0.14 glue_1.6.2 evaluate_0.21
[67] BiocManager_1.30.21 tweenr_2.0.2 png_0.1-8
[70] vctrs_0.6.3 tzdb_0.4.0 foreach_1.5.2
[73] gtable_0.3.3 polyclip_1.10-4 cachem_1.0.8
[76] xfun_0.39 ggforce_0.4.1 xtable_1.8-4
[79] tidygraph_1.2.3 viridisLite_0.4.2 survival_3.2-13
[82] iterators_1.0.14 AnnotationDbi_1.56.2 memoise_2.0.1
[85] timechange_0.2.0

egeulgen commented 1 year ago

This is a new issue. It is very odd that it can’t find the “active_snw_search” function. If you don’t set iterations, do you still get an error?In either case, for me to to replicate this, kindly provide your input data frame as an RDS object and share it if you’re comfortable to?-EOn 15 Jun 2023, at 21:04, PyrearSuhuiZhao @.***> wrote: I fix it and it still has the same issue.

output_UP <- run_pathfindR(input_UP, iterations = 25)

Testing input The input looks OK Processing input. Converting gene symbols, if necessary (and if human gene symbols provided)

Number of genes provided in input: 3754 Number of genes in input after p-value filtering: 3642 pathfindR cannot handle p values < 1e-13. These were changed to 1e-13 Could not find any interactions for 129 (3.54%) genes in the PIN Final number of genes in input: 3513 Performing Active Subnetwork Search and Enrichment Error in { : task 1 failed - "could not find function "active_snw_search""

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

PyrearSuhuiZhao commented 1 year ago

Hi Ege,

I still get the same error when I don't set the iterations. I am attaching the rds of my input data here for you.

make data frame

input_UP<-data.frame(input_UP$Gene, input_UP$log2FoldChange, input_UP$padj) input_UB<-data.frame(input_UB$Gene, input_UB$log2FoldChange, input_UB$padj) input_URB<-data.frame(input_URB$Gene, input_URB$log2FoldChange, input_URB$padj) output_UP <- run_pathfindR(input_UP)

Testing input

The input looks OK

Processing input. Converting gene symbols,

if necessary (and if human gene symbols provided) Number of genes provided in input: 2416 Number of genes in input after p-value filtering: 2290 pathfindR cannot handle p values < 1e-13. These were changed to 1e-13

Could not find any interactions for 98 (4.28%) genes in the PIN Final number of genes in input: 2192

Performing Active Subnetwork Search and Enrichment

n_processes is set to iterations because iterations < n_processes Error in { : task 1 failed - "could not find function "active_snw_search""

On Thu, Jun 15, 2023 at 5:45 PM Ege Ulgen @.***> wrote:

This is a new issue. It is very odd that it can’t find the “active_snw_search” function. If you don’t set iterations, do you still get an error?In either case, for me to to replicate this, kindly provide your input data frame as an RDS object and share it if you’re comfortable to?-EOn 15 Jun 2023, at 21:04, PyrearSuhuiZhao @.***> wrote: I fix it and it still has the same issue.

output_UP <- run_pathfindR(input_UP, iterations = 25)

Testing input The input looks OK Processing input. Converting gene symbols, if necessary (and if human gene symbols provided)

Number of genes provided in input: 3754 Number of genes in input after p-value filtering: 3642 pathfindR cannot handle p values < 1e-13. These were changed to 1e-13 Could not find any interactions for 129 (3.54%) genes in the PIN Final number of genes in input: 3513 Performing Active Subnetwork Search and Enrichment Error in { : task 1 failed - "could not find function "active_snw_search""

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/egeulgen/pathfindR/issues/164#issuecomment-1593761302, or unsubscribe https://github.com/notifications/unsubscribe-auth/BASRKUAAWIEN7POVGCPDPBDXLN66XANCNFSM6AAAAAAZHZELYY . You are receiving this because you authored the thread.Message ID: @.***>

egeulgen commented 1 year ago

hello again, I think attachments via mail don't work, can you try sending from github web?

PyrearSuhuiZhao commented 1 year ago

Hi Ege,

I repeat the message here. I try to upload my input data here but it doesn't support the file type. I still get the same error when I don't set the iterations.

make data frame

input_UP<-data.frame(input_UP$Gene, input_UP$log2FoldChange, input_UP$padj) input_UB<-data.frame(input_UB$Gene, input_UB$log2FoldChange, input_UB$padj) input_URB<-data.frame(input_URB$Gene, input_URB$log2FoldChange, input_URB$padj) output_UP <- run_pathfindR(input_UP)

Testing input

The input looks OK

Processing input. Converting gene symbols,

if necessary (and if human gene symbols provided) Number of genes provided in input: 2416 Number of genes in input after p-value filtering: 2290 pathfindR cannot handle p values < 1e-13. These were changed to 1e-13

Could not find any interactions for 98 (4.28%) genes in the PIN Final number of genes in input: 2192

Performing Active Subnetwork Search and Enrichment

n_processes is set to iterations because iterations < n_processes Error in { : task 1 failed - "could not find function "active_snw_search""

egeulgen commented 1 year ago

Please try zipping and uploading. Best,-EOn 20 Jun 2023, at 18:20, PyrearSuhuiZhao @.***> wrote: Hi Ege, I repeat the message here. I try to upload my input data here but it doesn't support the file type. I still get the same error when I don't set the iterations.

make data frame

input_UP<-data.frame(input_UP$Gene, input_UP$log2FoldChange, input_UP$padj) input_UB<-data.frame(input_UB$Gene, input_UB$log2FoldChange, input_UB$padj) input_URB<-data.frame(input_URB$Gene, input_URB$log2FoldChange, input_URB$padj) output_UP <- run_pathfindR(input_UP)

Testing input The input looks OK Processing input. Converting gene symbols, if necessary (and if human gene symbols provided)

Number of genes provided in input: 2416 Number of genes in input after p-value filtering: 2290 pathfindR cannot handle p values < 1e-13. These were changed to 1e-13 Could not find any interactions for 98 (4.28%) genes in the PIN Final number of genes in input: 2192 Performing Active Subnetwork Search and Enrichment n_processes is set to iterations because iterations < n_processes Error in { : task 1 failed - "could not find function "active_snw_search""

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

PyrearSuhuiZhao commented 1 year ago

input_UP.rds.zip

Thank you, Py

cristoforo88 commented 1 year ago

I am having the same error. Was this bug solved? let me know please

egeulgen commented 11 months ago

I couldn't replicate your error. Do you mind updating R to the latest version and also updating pathfindR?

PyrearSuhuiZhao commented 11 months ago

I updated R and pathfindR to the latest one, and I still got the same error.

output_UP <- run_pathfindR(input_UP)

Testing input

The input looks OK

Processing input. Converting gene symbols,

if necessary (and if human gene symbols provided) Number of genes provided in input: 2416 Number of genes in input after p-value filtering: 2290 pathfindR cannot handle p values < 1e-13. These were changed to 1e-13 Could not find any interactions for 98 (4.28%) genes in the PIN Final number of genes in input: 2192

Performing Active Subnetwork Search and Enrichment

n_processes is set to iterations because iterations < n_processes Error in { : task 1 failed - "could not find function "active_snw_search"" In addition: Warning messages: 1: In for (i in (1L:cols)[do]) { : closing unused connection 12 (<-localhost:11949) 2: In for (i in (1L:cols)[do]) { : closing unused connection 11 (<-localhost:11949) 3: In for (i in (1L:cols)[do]) { : closing unused connection 10 (<-localhost:11949) 4: In for (i in (1L:cols)[do]) { : closing unused connection 9 (<-localhost:11949) 5: In for (i in (1L:cols)[do]) { : closing unused connection 8 (<-localhost:11949) 6: In for (i in (1L:cols)[do]) { : closing unused connection 7 (<-localhost:11949) 7: In for (i in (1L:cols)[do]) { : closing unused connection 6 (<-localhost:11949) 8: In for (i in (1L:cols)[do]) { : closing unused connection 5 (<-localhost:11949) 9: In for (i in (1L:cols)[do]) { : closing unused connection 4 (<-localhost:11949) 10: In for (i in (1L:cols)[do]) { : closing unused connection 3 (<-localhost:11949)

egeulgen commented 11 months ago

Sorry for the late response. I think this might be an issue related to foreach on CentOS. Do you mind setting iterations=1 when running pathfindR, that will not be using foreach and we'll be sure

PyrearSuhuiZhao commented 11 months ago

It works, thank you.

egeulgen commented 11 months ago

So this seems to be an issue related to the parallel run. I’ll add a flag to disable running in parallel when executing multiple iterations (I suspect this would slow down the runtime significantly) and let you know when I update. Meanwhile, I’ll try to replicate the issue on a CentOS docker image. If I can, I’ll try to raise a ticket with foreach or whichever package might be causing the issue

egeulgen commented 11 months ago

I have included a new argument called disable_parallel to be able to disable parallel runs via foreach. You may use disable_parallel=TRUE to get the result for multiple iterations (default = 10) without running them in parallel.

I'm still trying to see if the issue can be replicated in a CentOS Docker container

egeulgen commented 11 months ago

Managed to replicate the issue on docker, foreach wasn't exporting pathfindR although it's loaded. explicitly added the package and that finally resolved the issue. You may pdate to the latest version via devtools |

install.packages("devtools") # if you have not installed "devtools"
devtools::install_github("egeulgen/pathfindR")