Skip to content

Commit

Permalink
feat(tools): add neo4jsbml (#144)
Browse files Browse the repository at this point in the history
* feat(tools): add `neo4jsbml`

* docs(tools): update
  • Loading branch information
guillaume-gricourt authored Oct 9, 2023
1 parent 9fe4f29 commit 14f6dc2
Show file tree
Hide file tree
Showing 4 changed files with 349 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/neo4jsbml/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
categories:
- Systems Biology
description: Import SBML file into Neo4j
long_description: Import SBML file into Neo4j
name: neo4jsbml
owner: tduigou
homepage_url: https://github.com/brsynth/neo4jsbml
remote_repository_url: https://github.com/brsynth/neo4jsbml
76 changes: 76 additions & 0 deletions tools/neo4jsbml/neo4jsbml.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<tool id="neo4jsbml" name="neo4jsbml" version="@TOOL_VERSION@" profile="21.09" license="MIT">
<description>Import SBML file into Neo4j</description>
<macros>
<token name="@TOOL_VERSION@">0.12.0</token>
</macros>
<requirements>
<requirement type="package" version="@TOOL_VERSION@">neo4jsbml</requirement>
</requirements>
<command detect_errors="exit_code"><![CDATA[
python -m neo4jsbml
--input-auradb-file '$input_auradb_file'
--input-file-sbml '$input_file_sbml'
#if str($input_tag_str) != ""
--input-tag-str '$input_tag_str'
#end if
--input-modelisation-json '$input_modelisation_json' | tee '$output'
]]></command>
<inputs>
<param name="input_auradb_file" type="data" format="txt" label="Config file provided by AuraDB"/>
<param name="input_file_sbml" type="data" format="sbml" label="SBML model"/>
<param name="input_tag_str" type="text" label="Identifier of the model">
<validator type="regex" message="No special characters allowed">^(?:[\w-]*)$</validator>
</param>
<param name="input_modelisation_json" type="data" format="json" label="Arrow's schema"/>
</inputs>
<outputs>
<data name="output" format="txt" label="${tool.name} - log" />
</outputs>
<help><![CDATA[
Neo4jSbml
=========
Step 1
------
Create a schema with `Arrows <https://arrows.app>`_
Rules:
- Nodes are labelled based on SBML object name as defined in the `SBML specification <https://sbml.org>`_
- Properties are labelled based on SBML object properties as defined the `SBML specification <https://sbml.org>`_
Step 2
------
Export your schema at the JSON format.
Step 3
------
Import your data with `neo4jsbml` into Neo4j.
- Use either a configuration file `ini` or individual parameters
- Password needs to be store in a file for safety security
- If you have multiple model in the database, pass a `tag` to identify the model loaded into the database if you want to avoid collision
Inputs
------
- **AuraDB config like**: a txt file with these variables NEO4J_URI, NEO4J_USERNAME, NEO4J_PASSWORD and AURA_INSTANCENAME. One per line like: NEO4J_USERNAME=neo4j
- **SBML model**: SBML model
- **Identifier of the model**: Associate an ID to the nodes (optional)
- **Arrow's schema**: Schema created with Arrow
Ouput
-----
- Traceback of the tool
]]></help>
<citations>
<citation type="bibtex">
@unpublished{neo4jsbml
author = {Guillaume Gricourt, Thomas Duigou, Sandra Dérozier, Jean-Loup Faulon},
title = {{Neo4jSbml}},
url = {https://github.com/brsynth/neo4jsbml/},
}
</citation>
</citations>
</tool>
265 changes: 265 additions & 0 deletions tools/neo4jsbml/test-data/PathwayModelisation-2.0.3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
{
"style": {
"font-family": "sans-serif",
"background-color": "#ffffff",
"background-image": "",
"background-size": "100%",
"node-color": "#ffffff",
"border-width": 4,
"border-color": "#000000",
"radius": 50,
"node-padding": 5,
"node-margin": 2,
"outside-position": "auto",
"node-icon-image": "",
"node-background-image": "",
"icon-position": "inside",
"icon-size": 64,
"caption-position": "inside",
"caption-max-width": 200,
"caption-color": "#000000",
"caption-font-size": 50,
"caption-font-weight": "normal",
"label-position": "inside",
"label-display": "pill",
"label-color": "#000000",
"label-background-color": "#ffffff",
"label-border-color": "#000000",
"label-border-width": 4,
"label-font-size": 40,
"label-padding": 5,
"label-margin": 4,
"directionality": "directed",
"detail-position": "inline",
"detail-orientation": "parallel",
"arrow-width": 5,
"arrow-color": "#000000",
"margin-start": 5,
"margin-end": 5,
"margin-peer": 20,
"attachment-start": "normal",
"attachment-end": "normal",
"relationship-icon-image": "",
"type-color": "#000000",
"type-background-color": "#ffffff",
"type-border-color": "#000000",
"type-border-width": 0,
"type-font-size": 16,
"type-padding": 5,
"property-position": "outside",
"property-alignment": "colon",
"property-color": "#000000",
"property-font-size": 16,
"property-font-weight": "normal"
},
"nodes": [
{
"id": "n0",
"position": {
"x": 0,
"y": 0
},
"caption": "",
"style": {},
"labels": [],
"properties": {}
},
{
"id": "n1",
"position": {
"x": 884.6635137872785,
"y": 380.3581544878789
},
"caption": "",
"labels": [
"Compartment"
],
"properties": {
"id": "str (required)",
"name": "str (optional)",
"metaid": "str (optional)",
"sboTerm": "str (optional)",
"spatialDimensions": "int (optional)",
"size": "int (optional)",
"constant": "bool (optional)"
},
"style": {}
},
{
"id": "n2",
"position": {
"x": 560.2494455950304,
"y": 380.3581544878789
},
"caption": "",
"labels": [
"Species"
],
"properties": {
"id": "str (required)",
"initialAmount": "float (optional)",
"hasOnlySubstanceUnits": "bool (optional)",
"boundaryCondition": "bool (optional)",
"constant": "bool (optional)"
},
"style": {}
},
{
"id": "n3",
"position": {
"x": 432.24944559503035,
"y": 204.94864525928773
},
"caption": "",
"labels": [
"Parameter"
],
"properties": {
"id": "str (required)",
"name": "str (optional)",
"metaid": "str (optional)",
"sboTerm": "str (optional)",
"value": "float (optional)",
"constant": "bool"
},
"style": {}
},
{
"id": "n4",
"position": {
"x": 833.1523435518487,
"y": 204.94864525928796
},
"caption": "",
"labels": [
"Reaction"
],
"properties": {
"id": "str (required)",
"name": "str (optional)",
"metaid": "str (optional)",
"sboTerm": "str (optional)",
"reversible": "bool"
},
"style": {}
},
{
"id": "n5",
"position": {
"x": 129,
"y": 204.94864525928773
},
"caption": "",
"labels": [
"model"
],
"properties": {
"id": "str",
"name": "str",
"metaid": "str",
"sboTerm": "str"
},
"style": {}
},
{
"id": "n6",
"position": {
"x": 129,
"y": 380.3581544878789
},
"caption": "",
"labels": [
"UnitDefinition"
],
"properties": {
"id": "str (optional)",
"name": "str (optional)",
"metaid": "str (optional)",
"sboTerm": "str (optional)"
},
"style": {}
},
{
"id": "n7",
"position": {
"x": 560.2494455950304,
"y": -4
},
"caption": "",
"labels": [
"GeneProduct"
],
"properties": {
"id": "str",
"name": "str"
},
"style": {}
}
],
"relationships": [
{
"id": "n0",
"fromId": "n2",
"toId": "n1",
"type": "IN_COMPARTMENT",
"properties": {},
"style": {}
},
{
"id": "n1",
"fromId": "n4",
"toId": "n2",
"type": "HAS_PRODUCT",
"properties": {},
"style": {}
},
{
"id": "n2",
"fromId": "n4",
"toId": "n3",
"type": "HAS_LOWERFLUXBOUND",
"properties": {},
"style": {}
},
{
"id": "n3",
"fromId": "n5",
"toId": "n3",
"type": "HAS_PARAMETER",
"properties": {},
"style": {}
},
{
"id": "n4",
"type": "HAS_UNITS",
"style": {},
"properties": {},
"fromId": "n3",
"toId": "n6"
},
{
"id": "n5",
"fromId": "n4",
"toId": "n3",
"type": "HAS_UPPERFLUXBOUND",
"properties": {},
"style": {}
},
{
"id": "n6",
"fromId": "n4",
"toId": "n7",
"type": "IS_IMPLIED",
"properties": {},
"style": {}
},
{
"id": "n7",
"fromId": "n2",
"toId": "n4",
"type": "IS_REACTANT",
"properties": {},
"style": {}
}
]
}
Binary file added tools/neo4jsbml/test-data/e_coli_core.xml.gz
Binary file not shown.

0 comments on commit 14f6dc2

Please sign in to comment.