# HG changeset patch
# User sybila
# Date 1665233726 0
# Node ID 2f3f67415022db93117341c81cd521af6bd2e2e3
planemo upload for repository https://github.com/sybila/galaxytools/tree/master/tools/ebcsgen commit 74a375c33936106a892dafb042be953a943af026
diff -r 000000000000 -r 2f3f67415022 ebcsgen_sbml_export.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ebcsgen_sbml_export.py Sat Oct 08 12:55:26 2022 +0000
@@ -0,0 +1,30 @@
+import argparse
+
+from eBCSgen.Errors.ModelParsingError import ModelParsingError
+from eBCSgen.Errors.UnspecifiedParsingError import UnspecifiedParsingError
+from eBCSgen.Parsing.ParseBCSL import Parser
+
+import libsbml
+
+
+args_parser = argparse.ArgumentParser(description='Export SBML model with usage of SBML-multi package')
+
+args_parser._action_groups.pop()
+required = args_parser.add_argument_group('required arguments')
+
+required.add_argument('--model', type=str, required=True)
+required.add_argument('--output', type=str, required=True)
+
+args = args_parser.parse_args()
+
+model_parser = Parser("model")
+model_str = open(args.model, "r").read()
+
+model = model_parser.parse(model_str)
+if model.success:
+ document = model.data.export_sbml()
+ libsbml.writeSBMLToFile(document, args.output)
+else:
+ if "error" in model.data:
+ raise UnspecifiedParsingError(model.data["error"])
+ raise ModelParsingError(model.data, model_str)
diff -r 000000000000 -r 2f3f67415022 ebcsgen_sbml_export.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ebcsgen_sbml_export.xml Sat Oct 08 12:55:26 2022 +0000
@@ -0,0 +1,41 @@
+
+ - export given BCSL model to SBML employing multi package
+
+ macros.xml
+
+
+
+ sybila/ebcsgen:v@TOOL_VERSION@
+
+
+
+ python3 ${__tool_directory__}/ebcsgen_sbml_export.py
+ --model '$model'
+ --output '$output'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 000000000000 -r 2f3f67415022 macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml Sat Oct 08 12:55:26 2022 +0000
@@ -0,0 +1,17 @@
+
+ 2.0.3
+
+
+
+
+
+
+
+
diff -r 000000000000 -r 2f3f67415022 test-data/simple.bcsl.model
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/simple.bcsl.model Sat Oct 08 12:55:26 2022 +0000
@@ -0,0 +1,7 @@
+#! rules
+r1_S ~ P(S{i})::cell => P(S{a})::cell
+r1_T ~ P(T{i})::cell => P(T{a})::cell
+r2 ~ P()::cell => P()::out
+
+#! inits
+1 P(S{i},T{i})::cell
\ No newline at end of file