meringlab / FlashWeave.jl

Inference of microbial interaction networks from large-scale heterogeneous abundance data
Other
70 stars 8 forks source link

Export ERROR #11

Closed pbelmann closed 4 years ago

pbelmann commented 4 years ago

Thank you for providing this useful tool. When I try to export the network, save_network throws an error:

julia> save_network("/home/ubuntu/network_output.gml", netw_results, detailed=true)
ERROR: type FWResult has no field rejections
Stacktrace:
 [1] getproperty(::Any, ::Symbol) at ./sysimg.jl:18
 [2] save_rejections(::String, ::FlashWeave.FWResult{Int64}) at /home/ubuntu/.julia/packages/FlashWeave/F6Bpf/src/io.jl:228
 [3] #save_network#14(::Bool, ::Function, ::String, ::FlashWeave.FWResult{Int64}) at /home/ubuntu/.julia/packages/FlashWeave/F6Bpf/src/io.jl:76
 [4] (::getfield(FlashWeave, Symbol("#kw##save_network")))(::NamedTuple{(:detailed,),Tuple{Bool}}, ::typeof(save_network), ::String, ::FlashWeave.FWResult{Int64}) at ./none:0
 [5] top-level scope at none:0

However, the file is created.

jtackm commented 4 years ago

Thanks for the report, this should now be fixed. Could you try again with the latest master (]add FlashWeave#master) and see if the issue is solved? Only files with additional detail ("<>_rejections.tsv" and "<>_unchecked.tsv") were not properly created due to this bug; this is why you still saw the main network file ("<>.gml").

pbelmann commented 4 years ago

still fails:

(v1.0) pkg> add FlashWeave#master                                                                                                                                                                                                             
  Updating registry at `~/.julia/registries/General`                                                                                                                                                                                          
  Updating git-repo `https://github.com/JuliaRegistries/General.git`                                                                                                                                                                          
   Cloning git-repo `https://github.com/meringlab/FlashWeave.jl.git`                                                                                                                                                                          
  Updating git-repo `https://github.com/meringlab/FlashWeave.jl.git`                                                                                                                                                                          
 Resolving package versions...                                                                                                                                                                                                                
 Installed Combinatorics ─ v1.0.0                                                                                                                                                                                                             
 Installed QuadGK ──────── v2.3.1                                                                                                                                                                                                             
 Installed FileIO ──────── v1.2.0                                                                                                                                                                                                             
  Updating `~/.julia/environments/v1.0/Project.toml`                                                                                                                                                                                          
  [2be3f83a] ↑ FlashWeave v0.14.0 ⇒ v0.14.0+ #master (https://github.com/meringlab/FlashWeave.jl.git)                                                                                                                                         
  Updating `~/.julia/environments/v1.0/Manifest.toml`                                                                                                                                                                                         
  [861a8166] ↑ Combinatorics v0.7.0 ⇒ v1.0.0                                                                                                                                                                                                  
  [5789e2e9] ↑ FileIO v1.1.0 ⇒ v1.2.0                                                                                                                                                                                                         
  [2be3f83a] ↑ FlashWeave v0.14.0 ⇒ v0.14.0+ #master (https://github.com/meringlab/FlashWeave.jl.git)                                                                                                                                         
  [1fd47b50] ↑ QuadGK v2.3.0 ⇒ v2.3.1                                                                                                                                                                                                         

(v1.0) pkg> ^C                                                                                                                                                                                                                                

julia> using FlashWeave                                                                                                                                                                                                                       

julia> save_network("/home/ubuntu/network_output.gml", netw_results, detailed=true)                                                                                                                                                           
ERROR: type FWResult has no field rejections                                                                                                                                                                                                  
Stacktrace:                                                                                                                                                                                                                                   
 [1] getproperty(::Any, ::Symbol) at ./sysimg.jl:18                                                                                                                                                                                           
 [2] save_rejections(::String, ::FlashWeave.FWResult{Int64}) at /home/ubuntu/.julia/packages/FlashWeave/F6Bpf/src/io.jl:228                                                                                                                   
 [3] #save_network#14(::Bool, ::Function, ::String, ::FlashWeave.FWResult{Int64}) at /home/ubuntu/.julia/packages/FlashWeave/F6Bpf/src/io.jl:76                                                                                               
 [4] (::getfield(FlashWeave, Symbol("#kw##save_network")))(::NamedTuple{(:detailed,),Tuple{Bool}}, ::typeof(save_network), ::String, ::FlashWeave.FWResult{Int64}) at ./none:0                                                                
 [5] top-level scope at none:0                                                                                                                                                                                                                
jtackm commented 4 years ago

You probably need to restart your Julia session, seems the previous version of FlashWeave was still in memory.

pbelmann commented 4 years ago

Yep, that was the reason. Now it works. Thanks