BIMIB-DISCo / J-Space.jl

J-SPACE is a Julia package to simulate the spatial growth and the genomic evolution of a cell population and the experiment of sequencing the genome of the sampled cells.
Other
6 stars 1 forks source link

Error when running example code #4

Open xieduo7 opened 1 year ago

xieduo7 commented 1 year ago

I run it as follows:

julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.3 (2022-05-06)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Pkg

julia> Pkg.activate("/data/xieduo/software/J-Space.jl")
  Activating project at `/data/xieduo/software/J-Space.jl`

julia> using J_Space

julia> Start_J_Space("Parameters.toml","Config.toml")
START...
CREATE/LOAD GRAPH....
RUN DYNAMIC....
save plot...
ERROR: SystemError: opening file "/data/xieduo/software/J-Space.jl/test/.\\Plot\\/Conf_t_10.png": No such file or directory
Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:174
  [2] #systemerror#68
    @ ./error.jl:173 [inlined]
  [3] systemerror
    @ ./error.jl:173 [inlined]
  [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Bool, append::Nothing)
    @ Base ./iostream.jl:293
  [5] open(fname::String, mode::String; lock::Bool)
    @ Base ./iostream.jl:355
  [6] open(fname::String, mode::String)
    @ Base ./iostream.jl:355
  [7] open(::Makie.var"#917#918"{Float64, Float64, Bool, DataType, Makie.Scene}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:328
  [8] open
    @ ./io.jl:328 [inlined]
  [9] save(file::FileIO.File{FileIO.DataFormat{:PNG}, String}, fig::Makie.Figure; resolution::Tuple{Int64, Int64}, pt_per_unit::Float64, px_per_unit::Float64, update::Bool)
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:246
 [10] save(file::FileIO.File{FileIO.DataFormat{:PNG}, String}, fig::Makie.Figure)
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:228
 [11] save(filename::String, fig::Makie.Figure; args::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:218
 [12] save(filename::String, fig::Makie.Figure)
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:218
 [13] Start_J_Space(paramaters::String, config::String)
    @ J_Space /data/xieduo/software/J-Space.jl/src/Start.jl:130
 [14] top-level scope
    @ REPL[4]:1

julia> Start_J_Space("Parameters.toml","Config.toml")
START...
CREATE/LOAD GRAPH....
RUN DYNAMIC....
save plot...
ERROR: SystemError: opening file "/data/xieduo/software/J-Space.jl/test/.\\Plot\\/Conf_t_10.png": No such file or directory
Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:174
  [2] #systemerror#68
    @ ./error.jl:173 [inlined]
  [3] systemerror
    @ ./error.jl:173 [inlined]
  [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Bool, append::Nothing)
    @ Base ./iostream.jl:293
  [5] open(fname::String, mode::String; lock::Bool)
    @ Base ./iostream.jl:355
  [6] open(fname::String, mode::String)
    @ Base ./iostream.jl:355
  [7] open(::Makie.var"#917#918"{Float64, Float64, Bool, DataType, Makie.Scene}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:328
  [8] open
    @ ./io.jl:328 [inlined]
  [9] save(file::FileIO.File{FileIO.DataFormat{:PNG}, String}, fig::Makie.Figure; resolution::Tuple{Int64, Int64}, pt_per_unit::Float64, px_per_unit::Float64, update::Bool)
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:246
 [10] save(file::FileIO.File{FileIO.DataFormat{:PNG}, String}, fig::Makie.Figure)
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:228
 [11] save(filename::String, fig::Makie.Figure; args::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:218
 [12] save(filename::String, fig::Makie.Figure)
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:218
 [13] Start_J_Space(paramaters::String, config::String)
    @ J_Space /data/xieduo/software/J-Space.jl/src/Start.jl:130
 [14] top-level scope
    @ REPL[4]:1

Do you have any suggestions?

Best, Duo

Alessandro-Guidi commented 1 year ago

Hi @xieduo7, Start_J_Space is the main function of J-Space, if you want to use it you must first set the parameters in the toml file, in this case, they are "Config.toml" and "Parameters.toml". In particular, the error occurs because in the Config file, in the field "_path_to_saveplot", the value is ".\Plot\" and this is for the Windows environment. You must replace it with "./Plot/". For further information, the README explained all the fields of the toml files. (If anyone is unclear, you can open an issue to improve the descriptions).

To execute an example, please refer to the "RUN THE EXAMPLES" section of the README. A possible example to run is as follows: Move in the main folder of J-Space, using the command line run julia --project=. ./Experiments/Experiment_2D/experiment_2D.jl. Otherwise, in the Example directory, there are several examples explaining how to use the functions in J-Space, with a README for each script.

Alessandro

marcoxa commented 1 year ago

Alessandro....

./Path/

will work on W10/W11 as well.

MA