How to use the gillespy2.sbml.SBMLimport.__read_sbml_model function in gillespy2

To help you get started, we’ve selected a few gillespy2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github StochSS / stochss / stochss / handlers / util / convert_sbml_to_model.py View on Github external
def get_sbml_function_definitions(path):
    sbml_model = __read_sbml_model(path)[0]
    function_definitions = []

    for i in range(sbml_model.getNumFunctionDefinitions()):
        function = sbml_model.getFunctionDefinition(i)
        function_name = function.getId()
        function_tree = function.getMath()
        num_nodes = function_tree.getNumChildren()
        function_args = [function_tree.getChild(i).getName() for i in range(num_nodes-1)]
        function_string = __get_math(function_tree.getChild(num_nodes-1))
        fd = {"name":function_name, "function":function_string, "args":function_args}
        function_definitions.append(fd)

    return function_definitions