Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
SBML.jl
Commits
31e63fe7
Commit
31e63fe7
authored
Mar 14, 2021
by
Miroslav Kratochvil
Browse files
read FBC chemical formulae
parent
e6d30729
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/readsbml.jl
View file @
31e63fe7
...
...
@@ -80,9 +80,18 @@ function extractModel(mdl::VPtr)::Model
species
=
Dict
{
String
,
Species
}()
for
i
=
1
:
ccall
(
sbml
(
:
Model_getNumSpecies
),
Cuint
,
(
VPtr
,),
mdl
)
sp
=
ccall
(
sbml
(
:
Model_getSpecies
),
VPtr
,
(
VPtr
,
Cuint
),
mdl
,
i
-
1
)
sp_fbc
=
ccall
(
sbml
(
:
SBase_getPlugin
),
VPtr
,
(
VPtr
,
Cstring
),
sp
,
"fbc"
)
formula
=
""
if
sp_fbc
!=
C_NULL
&&
0
!=
ccall
(
sbml
(
:
FbcSpeciesPlugin_isSetChemicalFormula
),
Cint
,
(
VPtr
,),
sp_fbc
)
formula
=
unsafe_string
(
ccall
(
sbml
(
:
FbcSpeciesPlugin_getChemicalFormula
),
Cstring
,
(
VPtr
,),
sp_fbc
),
)
end
species
[
unsafe_string
(
ccall
(
sbml
(
:
Species_getId
),
Cstring
,
(
VPtr
,),
sp
))]
=
Species
(
unsafe_string
(
ccall
(
sbml
(
:
Species_getName
),
Cstring
,
(
VPtr
,),
sp
)),
unsafe_string
(
ccall
(
sbml
(
:
Species_getCompartment
),
Cstring
,
(
VPtr
,),
sp
)),
formula
,
)
end
...
...
src/structs.jl
View file @
31e63fe7
...
...
@@ -41,7 +41,8 @@ identifier
struct
Species
name
::
String
compartment
::
String
Species
(
n
,
c
)
=
new
(
n
,
c
)
formula
::
String
Species
(
n
,
c
,
f
)
=
new
(
n
,
c
,
f
)
end
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment