Esempio n. 1
0
def VersionDict():
    '''Return dict of version strings.'''
    import tesbml, tesedml, tecombine
    return {
        'tellurium': getTelluriumVersion(),
        'roadrunner': roadrunner.getVersionStr(roadrunner.VERSIONSTR_BASIC),
        'antimony': antimony.__version__,
        'phrasedml': phrasedml.__version__,
        'tesbml': libsbml.getLibSBMLDottedVersion(),
        'tesedml': tesedml.__version__,
        'tecombine': tecombine.__version__
    }
Esempio n. 2
0
def VersionDict():
    '''Return dict of version strings.'''
    import tesbml, tesedml, tecombine
    return {
        'tellurium': getTelluriumVersion(),
        'roadrunner': roadrunner.getVersionStr(roadrunner.VERSIONSTR_BASIC),
        'antimony': antimony.__version__,
        'phrasedml': phrasedml.__version__,
        'tesbml': libsbml.getLibSBMLDottedVersion(),
        'tesedml': tesedml.__version__,
        'tecombine': tecombine.__version__
        }
Esempio n. 3
0
def getVersionInfo():
    print "telluirum Version: ", getTelluriumVersion()
    print "RoadRunner version:", roadrunner.getVersionStr()
    print "Antimony version:", antimony.__version__
    print "No information on sbnw viewer"
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 21 12:47:12 2015

@author: phantom
"""

import roadrunner as rr
import tellurium as te
import csv
import time
from sys import stderr, stdout

csvwriter = csv.writer(stdout, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)

csvwriter.writerow([rr.getVersionStr()])
csvwriter.writerow(['Name', 'Run_time'])

r = rr.RoadRunner(r'C:\Users\phantom\Documents\devel\src\rr-benchmarking\jean_marie\Jean_Marie_AMPA16_RobHow_v6.xml')

#print(r.rv())

name = 'JeanMarie'
for n in range(3):
    #print te.sbmlToAntimony(r.getCurrentSBML())
    startTime = time.time()
    m = r.simulate(0, 5000000, 10000)
    #r.plot()
    endTime = time.time()
    csvwriter.writerow([name, endTime-startTime])
Esempio n. 5
0
    def gatherInfo(self):
        """
        Gathers information about relevant versions and paths into a dictionary.
        """
        import subprocess
        import os
        import bionetgen
        import numpy
        import pandas
        import roadrunner

        self.logger.debug("Gathering info",
                          loc=f"{__file__} : BNGInfo.gatherInfo()")

        self.info = {}

        # Add some description for the following information
        self.info[
            "\nThe following are related to BioNetGen and its execution"] = ""

        self.logger.debug("BNG info", loc=f"{__file__} : BNGInfo.gatherInfo()")
        # Get BNG version
        with open(
                os.path.join(*[
                    os.path.dirname(bionetgen.__file__), "assets", "BNGVERSION"
                ]),
                "r",
        ) as f:
            read_data = f.read()
        self.info["BNG version"] = read_data[10:15]

        # Get BNG2.pl path
        self.info["BNG2.pl path"] = (self.config.get("bionetgen", "bngpath") +
                                     " (the main executable for BNG)")

        self.logger.debug("Perl info",
                          loc=f"{__file__} : BNGInfo.gatherInfo()")
        # Get Perl version
        # Read in CLI text
        result = subprocess.run(["perl", "-v"], stdout=subprocess.PIPE)
        text = str(result.stdout)
        # Find start & end indices
        num_start = text.find("(v") + 2
        num_end = text.find(")")
        # Save version info
        self.info["Perl version"] = text[
            num_start:num_end] + " (used to run BNG2.pl)"

        self.logger.debug("PyBNG info",
                          loc=f"{__file__} : BNGInfo.gatherInfo()")
        # Get CLI version
        with open(
                os.path.join(*[
                    os.path.dirname(bionetgen.__file__), "assets", "VERSION"
                ]),
                "r",
        ) as f:
            read_data = f.read()
        self.info["CLI version"] = read_data

        # Get pyBNG path
        self.info["pyBNG path"] = (os.path.dirname(bionetgen.__file__) +
                                   " (the PyBNG installation)")

        self.logger.debug(
            "Info on installed python libraries",
            loc=f"{__file__} : BNGInfo.gatherInfo()",
        )

        # Add some description for the following information
        self.info["\nThe following libraries are required by PyBioNetGen"] = ""

        # Get numpy version
        self.info["numpy version"] = numpy.version.version

        # Get pandas version
        self.info["pandas version"] = pandas.__version__

        # Get libRoadRunner version
        text = roadrunner.getVersionStr()
        self.info["libRoadRunner version"] = text[0:5]

        return self.info
#!/usr/bin/python
############################################################
# Test the roadrunner installation/python bindings
#
# Usage: 
# 	./roadrunner_test.sh 2>&1 | tee ./logs/roadrunner_test.log
#
# To select a branch/tag/commit to build from change the
# checkout command for roadrunner.
#
# @author: Matthias Koenig
# @date: 2016-01-06
############################################################
import roadrunner
print roadrunner.getVersionStr()

import roadrunner.testing
roadrunner.testing.runTester()

Esempio n. 7
0
"""
The LibRoadRunner SBML Simulation Engine, (c) 2009-2014 Andy Somogyi and Herbert Sauro

LibRoadRunner is an SBML JIT compiler and simulation engine with a variety of analysis
functions. LibRoadRunner is a self contained library which is designed to be integrated
into existing simulation platforms or may be used a stand alone simulation and analysis
package.
"""

import roadrunner
from roadrunner import *

__version__ = roadrunner.getVersionStr()


def runTests(testDir=None):
    import testing
    return testing.tester.runTester(testDir)
# -*- coding: utf-8 -*-
"""
Performing simulation with event driven peak.

@author: Matthias Koenig
@date: 2015-05-28
"""
from __future__ import print_function
import os
import roadrunner
from roadrunner import SelectionRecord

print(roadrunner.getVersionStr())
import antimony

model_txt = """
    model time_peak()
    // Reactions
    J0: $PP_S -> 2 S3; K1 * PP_S;

    // Species initializations:
    var species S3;
    S3 = 0.5;
    // S4 := sin(time)
    PP_S = 0.0;

    // Rule for S1
    K1 = 0.5;    
    t_peak = 2;
    t_duration = 0.5;
    mu = t_peak + 0.5*t_duration;
# -*- coding: utf-8 -*-

import roadrunner as rr
import csv
import time
from sys import stdout

csvwriter = csv.writer(stdout,
                       delimiter=',',
                       quotechar='"',
                       quoting=csv.QUOTE_MINIMAL)

csvwriter.writerow([rr.getVersionStr()])
csvwriter.writerow(['Name', 'Run_time'])

print('Load Model ...')
r = rr.RoadRunner(r'Galactose_v107_Nc20_galchallenge_noevents.xml')
r.selections = r.selections + ["[PP__gal]", '[PV__gal]']

name = 'Koenig_Liver'
for n in range(3):
    # reset the model ! for repeated simulation
    r.reset()

    # perform integration
    absTol = 1E-8
    relTol = 1E-8
    absTol = absTol * min(
        r.model.getCompartmentVolumes())  # absTol relative to the amounts
    tend = 100
    tsteps = 1000
Esempio n. 10
0
"""
The LibRoadRunner SBML Simulation Engine, (c) 2009-2014 Andy Somogyi and Herbert Sauro

LibRoadRunner is an SBML JIT compiler and simulation engine with a variety of analysis
functions. LibRoadRunner is a self contained library which is designed to be integrated
into existing simulation platforms or may be used a stand alone simulation and analysis
package.
"""

import roadrunner
from roadrunner import *

__version__ = roadrunner.getVersionStr()

def runTests(testDir=None):
  import testing
  return testing.tester.runTester(testDir)