Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lifeware
biocham
Commits
73c8176f
Commit
73c8176f
authored
Jul 16, 2020
by
Sylvain Soliman
Browse files
Adding SBML API for main units
parent
6538e492
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/sbml/sbml.pl
View file @
73c8176f
...
...
@@ -12,6 +12,9 @@
model_getListOfParameters
/
2
,
model_getListOfRules
/
2
,
model_getSpeciesById
/
3
,
model_getTimeUnits
/
2
,
model_getSubstanceUnits
/
2
,
model_getVolumeUnits
/
2
,
listOf_get
/
3
,
listOf_size
/
2
,
reaction_getKineticLaw
/
2
,
...
...
modules/sbml/sbml_swiprolog.c
View file @
73c8176f
...
...
@@ -567,6 +567,45 @@ pl_compartment_getVolume(term_t compartment_term, term_t volume_term) {
}
static
foreign_t
pl_model_getTimeUnits
(
term_t
model_term
,
term_t
units_term
)
{
const
char
*
units
;
Model_t
*
model
;
PL_check
(
PL_get_model
(
model_term
,
&
model
));
PL_check
(
units
=
Model_getTimeUnits
(
model
));
PL_check
(
PL_unify_atom_chars
(
units_term
,
units
));
PL_succeed
;
}
static
foreign_t
pl_model_getSubstanceUnits
(
term_t
model_term
,
term_t
units_term
)
{
const
char
*
units
;
Model_t
*
model
;
PL_check
(
PL_get_model
(
model_term
,
&
model
));
PL_check
(
units
=
Model_getSubstanceUnits
(
model
));
PL_check
(
PL_unify_atom_chars
(
units_term
,
units
));
PL_succeed
;
}
static
foreign_t
pl_model_getVolumeUnits
(
term_t
model_term
,
term_t
units_term
)
{
const
char
*
units
;
Model_t
*
model
;
PL_check
(
PL_get_model
(
model_term
,
&
model
));
PL_check
(
units
=
Model_getVolumeUnits
(
model
));
PL_check
(
PL_unify_atom_chars
(
units_term
,
units
));
PL_succeed
;
}
PL_extension
sbml_predicates
[]
=
{
{
"readSBML"
,
2
,
(
pl_function_t
)
pl_readSBML
,
0
},
{
"sbmlDocument_getNumErrors"
,
2
,
(
pl_function_t
)
pl_sbmlDocument_getNumErrors
,
0
},
...
...
@@ -580,6 +619,9 @@ PL_extension sbml_predicates[] = {
{
"model_getListOfRules"
,
2
,
(
pl_function_t
)
pl_model_getListOfRules
,
0
},
{
"model_getListOfFunctions"
,
2
,
(
pl_function_t
)
pl_model_getListOfFunctions
,
0
},
{
"model_getSpeciesById"
,
3
,
(
pl_function_t
)
pl_model_getSpeciesById
,
0
},
{
"model_getTimeUnits"
,
2
,
(
pl_function_t
)
pl_model_getTimeUnits
,
0
},
{
"model_getSubstanceUnits"
,
2
,
(
pl_function_t
)
pl_model_getSubstanceUnits
,
0
},
{
"model_getVolumeUnits"
,
2
,
(
pl_function_t
)
pl_model_getVolumeUnits
,
0
},
{
"listOf_get"
,
3
,
(
pl_function_t
)
pl_listOf_get
,
0
},
{
"listOf_size"
,
2
,
(
pl_function_t
)
pl_listOf_size
,
0
},
{
"reaction_getKineticLaw"
,
2
,
(
pl_function_t
)
pl_reaction_getKineticLaw
,
0
},
...
...
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