LCSB-BioCore / COBREXA.jl

Constraint-Based Reconstruction and EXascale Analysis
https://lcsb-biocore.github.io/COBREXA.jl/
Apache License 2.0
42 stars 8 forks source link

Mapping through delimited IDs into inner models #765

Closed stelmo closed 3 months ago

stelmo commented 1 year ago

We do not currently have a good way to map through delimited IDs to the underlying ID and call the correct accessor on it. For example:

julia> rid = "ecoli1#PFK#forward#1"
"ecoli1#PFK#forward#1"

julia> rid2 = "PFK#forward#1"
"PFK#forward#1"

julia> reaction_subsystem(gm, rid2)
ERROR: KeyError: key "PFK#forward#1" not found
Stacktrace:
 [1] getindex
   @ C:\Users\stelmo\.julia\packages\OrderedCollections\PRayh\src\ordered_dict.jl:380 [inlined]
 [2] reaction_subsystem(model::COBREXA.Types.ObjectModel, id::String)
   @ COBREXA.Types C:\Users\stelmo\Documents\GitHub\pkgs\COBREXA.jl\src\types\models\ObjectModel.jl:135
 [3] reaction_subsystem(model::COBREXA.Types.EnzymeConstrainedModel, rid::String)
   @ COBREXA.Accessors C:\Users\stelmo\Documents\GitHub\pkgs\COBREXA.jl\src\types\accessors\ModelWrapper.jl:20
 [4] top-level scope
   @ REPL[186]:1

julia> rid3 = "PFK"
"PFK"

julia> reaction_subsystem(gm, rid3)
"Glycolysis/Gluconeogenesis"
exaexa commented 9 months ago

Kinda obsoleted by ConstraintTrees. I'll leave this open so that we check if this will work.

exaexa commented 3 months ago

aaaaaaaaand it worked.