import means

"""
Explanation: SBML Parsing Example
End of explanation
"""


import urllib
__ = urllib.urlretrieve("http://www.ebi.ac.uk/biomodels/models-main/publ/"
                        "BIOMD0000000010/BIOMD0000000010.xml.origin", 
                        filename="autoreg.xml")

"""
Explanation: Biomodels repository hosts a number of published models.
We can download one of them to our working directory:
End of explanation
"""


# Requires: libsbml
autoreg_model, autoreg_parameters, autoreg_initial_conditions \
    = means.io.read_sbml('autoreg.xml')

"""
Explanation: This model can be parsed into MEANS Model object using means.io.read_sbml function. When parsing the SBML format, compartments of species are neglected, as the species names are assumed to be compartment-specific. 
The values for the constants and initial amounts of all species are also retrieved for making it easier to simulate the trajectories later.
WARNING: Please note that in order to run this example
one will have to have libsmbl installed together with its python bindings. 
Consult SBML website for more information on how to do this.
End of explanation
"""


autoreg_model

"""
Explanation: To view the model, simply output it:
End of explanation
"""


print autoreg_parameters[:3], '.. snip ..', autoreg_parameters[-3:]
print autoreg_initial_conditions

"""
Explanation: Note that a set of parameters and initial conditions are also parsed from the SBML file directly, let's view them:
End of explanation
"""


