netZoo / netZooR

netZooR is a network biology package implemented in R.
https://netzoo.github.io/
GNU General Public License v3.0
101 stars 39 forks source link

pandaPy #229

Closed liujilei156231 closed 2 years ago

liujilei156231 commented 2 years ago

treated_all_panda_result <- pandaPy(expr_file = treated_expression_file_path, motif_file = motif_file_path, ppi_file = ppi_file_path, modeProcess="legacy", remove_missing = TRUE )

> Use the legacy mode to pre-process the input dataset and keep only the matched TFs or Genes Error in py_run_string_impl(code, local, convert) : FileNotFoundError: [Errno 2] No such file or directory: '/tmp/expression.npy'

It is a Example from pandaPy. But it can not run until add a parameter [save_tmp = FALSE] on the win10 .

marouenbg commented 2 years ago

Hi @liujilei156231 , I just changed the path '/tmp/expression.npy' to a windows compatible path in https://github.com/netZoo/netZooR/pull/230 Please reinstall netZooR from the devel branch devtools::install_github("netZoo/netZooR@devel") and let me know how it goes ! Marouen

liujilei156231 commented 2 years ago

Problem solved.

zyb1984 commented 2 years ago

Also with the same error message with pandaPy function, but then adding a parameter "save_tmp = FALSE" on the win10, all problems had been solved, and what happened, could you tell me more information about this?

marouenbg commented 2 years ago

Hi @zyb1984 ,

Thank you for using netZooR, can you please share your code?

zyb1984 commented 2 years ago

original code on win10 , and with R version 4.2.1

library(viridisLite) library(netZooR)
library(reshape2)
library('visNetwork') use_python("C:/ProgramData/Anaconda3/envs/r-reticulate/python.exe")

retrieve the file path of these files

treated_expression_file_path <- system.file("extdata", "expr4_matched.txt", package = "netZooR", mustWork = TRUE) control_expression_file_path <- system.file("extdata", "expr10_matched.txt", package = "netZooR", mustWork = TRUE) motif_file_path <- system.file("extdata", "chip_matched.txt", package = "netZooR", mustWork = TRUE) ppi_file_path <- system.file("extdata", "ppi_matched.txt", package = "netZooR", mustWork = TRUE)

WIth error message

treated_all_panda_result <- pandaPy(expr_file = treated_expression_file_path, motif_file = motif_file_path, ppi_file= ppi_file_path,modeProcess="legacy", remove_missing = TRUE)

All is OK

treated_all_panda_result <- pandaPy(expr_file = treated_expression_file_path, motif_file = motif_file_path, ppi_file= ppi_file_path,modeProcess="legacy", remove_missing = TRUE, save_tmp = FALSE)

When not set the parameter "save_tmp = FALSE" , an error message with "py_run_string_impl(code, local, convert) : FileNotFoundError: [Errno 2] No such file or directory: '/tmp/expression.npy'" had appeared, but with the parameter "save_tmp = FALSE", all is ok, could you tell me more information about this?

marouenbg commented 2 years ago

Hi @zyb1984 , You need to create a folder called tmp to save the temporary data using save_tmp=TRUE

zyb1984 commented 2 years ago

OK, All had been solved, thank you very much.