Metadata-Version: 2.4
Name: SimpleSEDML
Version: 0.0.4
Summary: Python Subnet Discovery for Systems Biology
Author-email: Joseph Hellerstein <joseph.hellerstein@gmail.com>, Herbert S Sauro <hsauro@uw.edu>
License: MIT License
        
        Copyright (c) 2025 UW Sauro Lab
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/sys-bio/SimpleSEDML
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: build
Requires-Dist: coverage
Requires-Dist: jupyterlab
Requires-Dist: matplotlib
Requires-Dist: nose2
Requires-Dist: pandas
Requires-Dist: phrasedml
Requires-Dist: pip
Requires-Dist: requests
Requires-Dist: tabulate
Requires-Dist: tellurium
Requires-Dist: twine
Requires-Dist: urllib3
Dynamic: license-file

[![Build](https://github.com/sys-bio/SimpleSEDML/actions/workflows/github-actions.yml/badge.svg)](https://github.com/sys-bio/SimpleSBML/actions/workflows/github-actions.yml)

# SimpleSEDML
A simple API for using the [Simulation Experiment Description Markup Language (SED-ML)](https://sed-ml.org/), a community standard for describing simulation experiments.

The project provides a python interface to generating SED-ML based on the abstractions provided by [phraSED-ML](https://pmc.ncbi.nlm.nih.gov/articles/PMC5313123/pdf/nihms846540.pdf) to describe simulation experiments. These absractions are: (a) models (including changes in values of model parameters);
(b) simulations (including deterministic, stochastic, and steady state);
(c) tasks (which specify simulations to run on tasks and repetitions for changes in parameter values);
and (d) output for data reports and plots.

``SimpleSEDML`` generalizes the capabilities of ``PhraSEDML`` and simplifies its usage by exploiting the Python environment:

* A model source can be a file path or URL and may be in the Antimony language as well as SBML;
* Repeated tasks are defined more simply by the use of a ``pandas`` ``DataFrame``.
* Convenience methods are provided to simplify the API.
  
# Example

See this [Jupyter notebook](https://github.com/sys-bio/SimpleSEDML/blob/main/examples/usage_examples.ipynb) for a detailed example.

Consider the model below in the Antimony language.

    MODEL_ANT = '''
    model myModel
        J1: S1 -> S2; k1*S1
        J2: S2 -> S3; k2*S2
        
        S1 = 10
        S2 = 0
        k1 = 1
        k2 = 1
    end
    '''


We want to simulate this model and do a time course plot of all floating species in the model.

    from simple_sedml import SimpleSEDML

    sedml_str = SimpleSEDML.makeTimeCourse(MODEL_ANT, title="My Plot")

The SED-ML generated by this statement can be viewed with

    print(sedml_str)

This generates the following SED-ML:

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created by phraSED-ML version v1.3.0 with libSBML version 5.19.5. -->
    <sedML xmlns="http://sed-ml.org/sed-ml/level1/version4" xmlns:sbml="http://www.sbml.org/sbml/level3/version2/core" level="1" version="4">
    <listOfModels>
        <model id="time_course_model" language="urn:sedml:language:sbml.level-3.version-2" source="/Users/jlheller/home/Technical/repos/SimpleSEDML/examples/time_course_model"/>
    </listOfModels>
    <listOfSimulations>
        <uniformTimeCourse id="time_course_sim" initialTime="0" outputStartTime="0" outputEndTime="5" numberOfSteps="50">
        <algorithm name="CVODE" kisaoID="KISAO:0000019"/>
        </uniformTimeCourse>
    </listOfSimulations>
    <listOfTasks>
        <task id="time_course_task" modelReference="time_course_model" simulationReference="time_course_sim"/>
    </listOfTasks>
    <listOfDataGenerators>
        <dataGenerator id="plot_0_0_0" name="time">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
            <ci> time </ci>
        </math>
        <listOfVariables>
            <variable id="time" symbol="urn:sedml:symbol:time" taskReference="time_course_task" modelReference="time_course_model"/>
        </listOfVariables>
        </dataGenerator>
        <dataGenerator id="plot_0_0_1" name="S1">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
            <ci> S1 </ci>
        </math>
        <listOfVariables>
            <variable id="S1" target="/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='S1']" taskReference="time_course_task" modelReference="time_course_model"/>
        </listOfVariables>
        </dataGenerator>
        <dataGenerator id="plot_0_1_1" name="S2">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
            <ci> S2 </ci>
        </math>
        <listOfVariables>
            <variable id="S2" target="/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='S2']" taskReference="time_course_task" modelReference="time_course_model"/>
        </listOfVariables>
        </dataGenerator>
        <dataGenerator id="plot_0_2_1" name="S3">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
            <ci> S3 </ci>
        </math>
        <listOfVariables>
            <variable id="S3" target="/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='S3']" taskReference="time_course_task" modelReference="time_course_model"/>
        </listOfVariables>
        </dataGenerator>
    </listOfDataGenerators>
    <listOfOutputs>
        <plot2D id="plot_0" name="My Plot">
        <listOfCurves>
            <curve id="plot_0__plot_0_0_0__plot_0_0_1" logX="false" xDataReference="plot_0_0_0" logY="false" yDataReference="plot_0_0_1"/>
            <curve id="plot_0__plot_0_0_0__plot_0_1_1" logX="false" xDataReference="plot_0_0_0" logY="false" yDataReference="plot_0_1_1"/>
            <curve id="plot_0__plot_0_0_0__plot_0_2_1" logX="false" xDataReference="plot_0_0_0" logY="false" yDataReference="plot_0_2_1"/>
        </listOfCurves>
        </plot2D>
    </listOfOutputs>
    </sedML>

The PhraSED-ML to generate the above SED-ML is displayed below. It is considerably more text than the one-line API call.

    time_course_model = model "/Users/jlheller/home/Technical/repos/SimpleSEDML/examples/time_course_model" 
    time_course_sim = simulate uniform(0, 5, 50)
    time_course_sim.algorithm = CVODE
    time_course_task = run time_course_sim on time_course_model
    plot "My Plot" time vs S1, S2, S3

Executing this SED-ML is done by

    SimpleSEDML.executeSEDML(sedml_str)

which generates the following plot:

<img src="examples/simple_sedml_plot.png" style="width:300px;height:300px;">

# Restrictions
1. If there are multiple task directives and/or there is a repeated task directive AND there is a report directive, SimpleSEDML.execute only returns the results of the last simulation. You can circumvent this by iterating in python to obtain the desired reports.
