Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAT model not converting to CanonicalModel #8

Closed
HettieC opened this issue Aug 19, 2024 · 5 comments · Fixed by #9
Closed

MAT model not converting to CanonicalModel #8

HettieC opened this issue Aug 19, 2024 · 5 comments · Fixed by #9

Comments

@HettieC
Copy link

HettieC commented Aug 19, 2024

Next issue... the yeast-GEM downloaded from here errors when converted to a CanonicalModel

using MATFBCModels, COBREXA
import AbstractFBCModels.CanonicalModel as CM
model = convert(CM.Model,load_model("yeast-GEM.mat"))

Think it was initially a problem in v1 as well but can't remember what the problem actually was!

@exaexa
Copy link
Member

exaexa commented Aug 19, 2024

@HettieC can you please paste the error?

@exaexa
Copy link
Member

exaexa commented Aug 19, 2024

ah OK found it here: LCSB-BioCore/COBREXA.jl#691

There's a workaround in the issue. Looks like the fix we applied somehow didn't make it to MATFBCModels, I'll check where it got dropped. Thanks for spotting this!

@HettieC
Copy link
Author

HettieC commented Aug 19, 2024

Here is the error in case still needed:

ERROR: InexactError: Int64(NaN)
Stacktrace:
  [1] Int64
    @ Base ./float.jl:909 [inlined]
  [2] parse_charge(x::Float64)
    @ MATFBCModels ~/.julia/packages/MATFBCModels/pA6WE/src/utils.jl:20
  [3] metabolite_charge(m::MATFBCModel, mid::String)
    @ MATFBCModels ~/.julia/packages/MATFBCModels/pA6WE/src/interface.jl:108
  [4] (::AbstractFBCModels.CanonicalModel.var"#19#23"{MATFBCModel})(::Tuple{String, Float64})
    @ AbstractFBCModels.CanonicalModel ./none:0
  [5] iterate(g::Base.Generator, s::Vararg{Any})
    @ Base ./generator.jl:47 [inlined]
  [6] _all(f::Base.var"#384#386", itr::Base.Generator{…}, ::Colon)
    @ Base ./reduce.jl:1297
  [7] all
    @ ./reduce.jl:1283 [inlined]
  [8] Dict(kv::Base.Generator{Base.Iterators.Zip{Tuple{…}}, AbstractFBCModels.CanonicalModel.var"#19#23"{MATFBCModel}})
    @ Base ./dict.jl:111
  [9] convert(::Type{AbstractFBCModels.CanonicalModel.Model}, x::MATFBCModel)
    @ AbstractFBCModels.CanonicalModel ~/.julia/packages/AbstractFBCModels/UeDEO/src/canonical.jl:197
 [10] top-level scope
    @ ~/Documents/Projects/DifferentiableEFMPaper/src/yeastGEM/gecko_setup.jl:26

caused by: InexactError: Int64(NaN)
Stacktrace:
  [1] Int64
    @ Base ./float.jl:909 [inlined]
  [2] parse_charge(x::Float64)
    @ MATFBCModels ~/.julia/packages/MATFBCModels/pA6WE/src/utils.jl:20
  [3] metabolite_charge(m::MATFBCModel, mid::String)
    @ MATFBCModels ~/.julia/packages/MATFBCModels/pA6WE/src/interface.jl:108
  [4] (::AbstractFBCModels.CanonicalModel.var"#19#23"{MATFBCModel})(::Tuple{String, Float64})
    @ AbstractFBCModels.CanonicalModel ./none:0
  [5] iterate
    @ ./generator.jl:47 [inlined]
  [6] Dict{…}(kv::Base.Generator{…})
    @ Base ./dict.jl:85
  [7] dict_with_eltype
    @ ./abstractdict.jl:581 [inlined]
  [8] dict_with_eltype
    @ ./abstractdict.jl:588 [inlined]
  [9] Dict(kv::Base.Generator{Base.Iterators.Zip{Tuple{…}}, AbstractFBCModels.CanonicalModel.var"#19#23"{MATFBCModel}})
    @ Base ./dict.jl:109
 [10] convert(::Type{AbstractFBCModels.CanonicalModel.Model}, x::MATFBCModel)
    @ AbstractFBCModels.CanonicalModel ~/.julia/packages/AbstractFBCModels/UeDEO/src/canonical.jl:197
 [11] top-level scope
    @ ~/Documents/Projects/DifferentiableEFMPaper/src/yeastGEM/gecko_setup.jl:26
Some type information was truncated. Use `show(err)` to see complete types.

@exaexa
Copy link
Member

exaexa commented Aug 19, 2024

ok wait this is another one. NaN's in charges. :D

@exaexa exaexa transferred this issue from COBREXA/COBREXA.jl Aug 19, 2024
@exaexa
Copy link
Member

exaexa commented Aug 19, 2024

@HettieC should be fixed by #9 , I'll try to release that ASAP.

@exaexa exaexa closed this as completed in #9 Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants