--
You received this message because you are subscribed to a topic in the Google Groups "sbml-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sbml-discuss/Y_3S0gk--P0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sbml-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbml-discuss/c0bce674-774f-4121-b40b-fd294b40ccf6n%40googlegroups.com.
import libsbml
def print_terms(element):
"""prints resources and qualifier for sbase element"""
num_terms = element.getNumCVTerms()
for i in range(num_terms):
term = element.getCVTerm(i)
if term.getQualifierType() == libsbml.BIOLOGICAL_QUALIFIER:
print('element qualifier is bq_{0}'.format(libsbml.BiolQualifierType_toString(term.getBiologicalQualifierType())))
else:
print('element qualifier is model_{0}'.format(libsbml.ModelQualifierType_toString(term.getBiologicalQualifierType())))
num_resources = term.getNumResources()
for j in range(num_resources):
print(' {0}'.format(term.getResourceURI(j)))
doc = libsbml.readSBMLFromFile('BIOMD0000000001.xml')
model = doc.getModel()
for i in range(model.getNumSpecies()):
species = model.getSpecies(i)
print('annotatiosn for species {0}'.format(species.getId()))
print_terms(species)
for i in range(model.getNumReactions()):
reaction = model.getReaction(i)
print('annotations for reaction {0}'.format(reaction.getId()))
print_terms(reaction)
You received this message because you are subscribed to the Google Groups "sbml-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sbml-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbml-discuss/CALSwGsFhed76jtyupwKaDZtuMOu9EWphnPGCPG%3DjZfOGoKg8iA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbml-discuss/CAEnSYuJ%2Ba0Ws%3DyqhvCMR-kyNeMGGpFnFvAtUkLm%2BpVn6-gFL1Q%40mail.gmail.com.