Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Parasim #6

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/ebcsgen/.shed.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
owner: sybila
remote_repository_url: "https://github.com/sybila/galaxytools/tree/master/tools/ebcsgen"
remote_repository_url: "https://github.com/sybila/galaxytools/tree/main/tools/ebcsgen"
homepage_url: "https://github.com/sybila/eBCSgen"
categories:
- Systems Biology
Expand Down
12 changes: 12 additions & 0 deletions tools/parasim/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
owner: sybila
remote_repository_url: "https://github.com/sybila/galaxytools/tree/main/tools/parasim"
homepage_url: "https://github.com/sybila/parasim"
categories:
- Systems Biology
repositories:
parasim:
description: "Robustness analysis of SBML model with respect to STL property."
include:
- parasim.xml
- test-data
- macros.xml
21 changes: 21 additions & 0 deletions tools/parasim/macros.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<macros>
<token name="@TOOL_VERSION@">2.2.0</token>

<xml name="creator">
<creator>
<person
givenName="Martin"
familyName="Demko"
url="https://github.com/martindemko"/>
<person
givenName="Matej"
familyName="Troják"
url="https://github.com/xtrojak"
identifier="0000-0003-0841-2707" />
<organization
url="https://sybila.fi.muni.cz/"
email="[email protected]"
name="SYBILA MUNI" />
</creator>
</xml>
</macros>
96 changes: 96 additions & 0 deletions tools/parasim/parasim.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<tool id="parasim" name="Parasim" version="@TOOL_VERSION@_galaxy0">
<description>robustness analysis of given SBML model and STL property</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="creator"/>
<requirements>
<container type="docker">sybila/parasim:@TOOL_VERSION@</container>
</requirements>

<stdio>
<regex match="OutOfMemoryError" source="stderr" level="warning" description="Java GC OutOfMemoryError: result data might be incomplete or corrupt!" />
<regex match="out of memory" source="stderr" level="warning" description="Java GC OutOfMemoryError: result data might be incomplete or corrupt!" />
<regex match="ParseException" source="stderr" level="fatal" description="Error during parsing of input" />
<regex match="parse error" source="stderr" level="fatal" description="Error during parsing of input" />
<regex match="FormatException" source="stderr" level="fatal" description="Error during parsing of input" />
<regex match="IOException" source="stderr" level="fatal" description="IO Exception: Can't load data for experiment." />
<regex match="exception" source="stderr" level="fatal" description="Java Exception" />
<regex match="error" source="stderr" level="fatal" description="Unknown error" />

<regex match="nothing to store" level="fatal" description="Nothing to store - no output produced in specified time limit." />
<regex match="timeout" level="fatal" description="Computation timeout: result data might be incomplete or corrupt! Increase Time limit until timeout input." />
<regex match="killed" level="fatal" description="Out of memory." />
</stdio>

<command><![CDATA[
sh ${create_experiment} &&
export PARASIM_OPTS="-Xmx17179869184" &&
parasim -e 'experiment' -b -csv '$output'
]]> </command>

<configfiles>
<configfile name="create_experiment">
touch experiment
echo "sbml.file=$model_file" >> experiment
echo "stl.file=$property_file" >> experiment
echo "simulation.precision.file=$precission_file" >> experiment
echo "space.initial.file=$init_space_file" >> experiment
echo "space.simulation.file=$simul_space_file" >> experiment
echo "result.output.file=result.xml" >> experiment
echo "timeout.amount=$time_horizon.time" >> experiment
echo "timeout.unit=$time_horizon.time_unit" >> experiment
echo "iteration.limit=$iterations" >> experiment
</configfile>
</configfiles>

<inputs>
<param format="xml" name="model_file" type="data" label="SBML model file"/>
<param format="xml" name="property_file" type="data" label="STL property file"/>
<param format="xml" name="init_space_file" type="data" label="Initial space file"/>
<param format="xml" name="simul_space_file" type="data" label="Simulation space file"/>
<param format="xml" name="precission_file" type="data" label="Simulation precission file"/>
<conditional name="time_horizon">
<param name="time_unit" type="select" label="Time limit until timeout" help="When running simulation exceeds timeout, it terminates.">
<option value="SECONDS" >Seconds</option>
<option value="MINUTES" selected="true" >Minutes</option>
<option value="HOURS" >Hours</option>
<option value="DAYS" >Unlimited</option>
</param>
<when value="DAYS">
<param hidden="true" name="time" type="integer" min="1" value="1000" label="Amount of time"/>
</when>
<when value="HOURS">
<param name="time" type="integer" min="1" value="5" label="Amount of time"/>
</when>
<when value="MINUTES">
<param name="time" type="integer" min="1" value="10" label="Amount of time"/>
</when>
<when value="SECONDS">
<param name="time" type="integer" min="1" value="10" label="Amount of time"/>
</when>
</conditional>
<param name="iterations" type="integer" min="1" value="5" label="Iteration limit" help="Limits precision of robustness analysis method. Generally, 10 should be more than sufficient."/>
</inputs>

<outputs>
<data format="tsv" name="output" />
</outputs>

<tests>
<test>
<param name="model_file" value="lotkav.model.xml" ftype="xml"/>
<param name="property_file" value="oscil.star.formula.xml" ftype="xml"/>
<param name="init_space_file" value="params.init_space.xml" ftype="xml"/>
<param name="simul_space_file" value="base.sim_space.xml" ftype="xml"/>
<param name="precission_file" value="base.precision.xml" ftype="xml"/>
<section name="time_horizon">
<param name="time_unit" value="MINUTES"/>
<param name="time" value="30"/>
</section>
<param name="iterations" value="2"/>
<output name="output" value="lotkav.model.xml" ftype="tsv"/>
</test>
</tests>

</tool>
5 changes: 5 additions & 0 deletions tools/parasim/test-data/base.precision.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<precision xmlns="http://www.sybila.org/parasim/precision" maxRelativeError="1.0E-8" timeStep="0.1">
<dimension maxAbsoluteError="1.0E-6"/>
<dimension maxAbsoluteError="1.0E-6"/>
</precision>
6 changes: 6 additions & 0 deletions tools/parasim/test-data/base.sim_space.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<space xmlns="http://www.sybila.org/parasim/space">
<time max="800.0" min="0.0"/>
<variable max="200.0" min="0.0" name="predator"/>
<variable max="200.0" min="0.0" name="prey"/>
</space>
65 changes: 65 additions & 0 deletions tools/parasim/test-data/lotkav.model.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="1">
<model>
<listOfCompartments>
<compartment id="uVol" size="1"/>
</listOfCompartments>
<listOfSpecies>
<species id="predator" compartment="uVol" initialConcentration="80"/>
<species id="prey" compartment="uVol" initialConcentration="40"/>
</listOfSpecies>
<listOfParameters>
<parameter id="natality" value="0.1"/>
<parameter id="mortality" value="0.1"/>
<parameter id="predation" value="0.002"/>
</listOfParameters>
<listOfReactions>
<reaction id="prey_born" reversible="false">
<listOfProducts>
<speciesReference species="prey"/>
</listOfProducts>
<kineticLaw>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<times/>
<ci> natality </ci>
<ci> prey </ci>
</apply>
</math>
</kineticLaw>
</reaction>
<reaction id="predator_die" reversible="false">
<listOfReactants>
<speciesReference species="predator"/>
</listOfReactants>
<kineticLaw>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<times/>
<ci> mortality </ci>
<ci> predator </ci>
</apply>
</math>
</kineticLaw>
</reaction>
<reaction id="predate" reversible="false">
<listOfReactants>
<speciesReference species="prey"/>
</listOfReactants>
<listOfProducts>
<speciesReference species="predator"/>
</listOfProducts>
<kineticLaw>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<times/>
<ci> predation </ci>
<ci> prey </ci>
<ci> predator </ci>
</apply>
</math>
</kineticLaw>
</reaction>
</listOfReactions>
</model>
</sbml>
57 changes: 57 additions & 0 deletions tools/parasim/test-data/oscil.star.formula.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<formula xmlns="http://www.sybila.org/parasim/stl-formula">
<globally>
<interval>
<lower type="closed">0</lower>
<upper type="closed">300</upper>
</interval>
<and>
<and>
<predicate>
<variable multiplier="1.0" frozen="0">prey</variable>
<greater/>
<value>1</value>
</predicate>
<predicate>
<variable multiplier="1.0" frozen="0">predator</variable>
<greater/>
<value>0</value>
</predicate>
</and>
<future>
<interval>
<lower type="closed">0</lower>
<upper type="closed">50</upper>
</interval>
<freeze index="1">
<and>
<future>
<interval>
<lower type="closed">0</lower>
<upper type="closed">75</upper>
</interval>
<predicate>
<variable multiplier="1.0" frozen="1">prey</variable>
<variable multiplier="-1.0" frozen="0">prey</variable>
<greater/>
<value>25</value>
</predicate>
</future>
<future>
<interval>
<lower type="closed">0</lower>
<upper type="closed">75</upper>
</interval>
<predicate>
<variable multiplier="1.0" frozen="0">prey</variable>
<variable multiplier="-1.0" frozen="1">prey</variable>
<greater/>
<value>25</value>
</predicate>
</future>
</and>
</freeze>
</future>
</and>
</globally>
</formula>
6 changes: 6 additions & 0 deletions tools/parasim/test-data/params.init_space.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<space xmlns="http://www.sybila.org/parasim/space">
<time max="0.0" min="0.0"/>
<parameter max="0.7" min="0.01" name="natality"/>
<parameter max="0.008" min="1.0E-4" name="predation"/>
</space>
18 changes: 18 additions & 0 deletions tools/parasim/test-data/result.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
predator prey natality predation Robustness
80.0 40.0 0.01 1.0E-4 -12.5
80.0 40.0 0.01 0.0012999999 -12.5
80.0 40.0 0.01 0.0025 -12.5
80.0 40.0 0.2575 7.0E-4 3.606793
80.0 40.0 0.2575 0.0012999999 11.5911665
80.0 40.0 0.2575 0.0018999999 9.342419
80.0 40.0 0.505 1.0E-4 -12.037555
80.0 40.0 0.505 7.0E-4 -0.9595153
80.0 40.0 0.505 0.0012999999 -0.54846215
80.0 40.0 0.505 0.0018999999 0.5288335
80.0 40.0 0.505 0.0025 2.125179
80.0 40.0 0.7525 7.0E-4 -0.9998965
80.0 40.0 0.7525 0.0012999999 -0.99468964
80.0 40.0 0.7525 0.0018999999 -0.95502543
80.0 40.0 1.0 1.0E-4 -12.499986
80.0 40.0 1.0 0.0012999999 -0.9999726
80.0 40.0 1.0 0.0025 -0.9955077