changeset 0:781eb27e0f5a draft

planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy commit e28ca123295d50b85ba872e5a4720fd72697ecc3
author metexplore
date Thu, 13 Mar 2025 15:52:07 +0000
parents
children 2d11c51ed536
files SetPathways.xml macros.xml test-data/pathways.tsv test-data/pathwaysOtherSep.tsv test-data/toy_model.xml
diffstat 5 files changed, 238 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SetPathways.xml	Thu Mar 13 15:52:07 2025 +0000
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<tool id="met4j_SetPathways" name="SetPathways" version="@TOOL_VERSION@">
+  <description>Set pathway to reactions in a network from a tabulated file containing the reaction ids and the pathways</description>
+  <macros>
+    <import>macros.xml</import>
+  </macros>
+  <expand macro="bio_tools"/>
+  <expand macro="requirements"/>
+  <command detect_errors="exit_code"><![CDATA[met4j fr.inrae.toulouse.metexplore.met4j_toolbox.attributes.SetPathways#if str($colp) != 'nan':
+ -cp "$colp"
+#end if
+#if str($sep):
+ -sep "$sep"
+#end if
+#if str($colid) != 'nan':
+ -ci "$colid"
+#end if
+ $p
+#if str($nSkip):
+ -n "$nSkip"
+#end if
+ -i "$sbml"
+#if str($tab) != 'None':
+ -tab "$tab"
+#end if
+#if str($c):
+ -c "$c"
+#end if
+ -o "$out"
+]]></command>
+  <inputs>
+    <param argument="-cp" label="[2] number of the column where are the pathways" name="colp" optional="true" type="integer" value="2"/>
+    <param argument="-sep" label="[|] Separator of pathways in the tabulated file" name="sep" optional="true" type="text" value="|">
+      <sanitizer invalid_char="_">
+        <valid initial="string.printable"/>
+      </sanitizer>
+    </param>
+    <param argument="-ci" label="[1] number of the column where are the reaction ids" name="colid" optional="true" type="integer" value="1"/>
+    <param argument="-p" checked="false" falsevalue="" label="[deactivated] To match the objects in the sbml file, adds the prefix R_ to reactions" name="p" truevalue="-p" type="boolean" value="false"/>
+    <param argument="-n" label="[0] Number of lines to skip at the beginning of the tabulated file" name="nSkip" optional="true" type="text" value="0">
+      <sanitizer invalid_char="_">
+        <valid initial="string.printable"/>
+      </sanitizer>
+    </param>
+    <param argument="-i" format="sbml" label="Original SBML file" name="sbml" optional="false" type="data" value=""/>
+    <param argument="-tab" format="tsv" label="Input Tabulated file" name="tab" optional="true" type="data" value=""/>
+    <param argument="-c" label="[#] Comment String in the tabulated file. The lines beginning by this string won't be read" name="c" optional="true" type="text" value="#">
+      <sanitizer invalid_char="_">
+        <valid initial="string.printable"/>
+      </sanitizer>
+    </param>
+  </inputs>
+  <outputs>
+    <data format="sbml" name="out"/>
+  </outputs>
+  <tests>
+    <test>
+      <param name="sbml" value="toy_model.xml"/>
+      <param name="tab" value="pathways.tsv"/>
+      <output ftype="sbml" name="out">
+        <assert_contents>
+          <is_valid_xml/>
+          <has_line_matching expression=".*groups:id=.*" n="3"/>
+          <has_line_matching expression=".*groups:id=.p1.*" n="1"/>
+          <has_line_matching expression=".*groups:id=.p2.*" n="1"/>
+          <has_line_matching expression=".*groups:id=.p3.*" n="1"/>
+        </assert_contents>
+      </output>
+    </test>
+    <test>
+      <param name="sbml" value="toy_model.xml"/>
+      <param name="tab" value="pathwaysOtherSep.tsv"/>
+      <param name="sep" value=" + "/>
+      <output ftype="sbml" name="out">
+        <assert_contents>
+          <is_valid_xml/>
+          <has_line_matching expression=".*groups:id=.*" n="3"/>
+          <has_line_matching expression=".*groups:id=.p1.*" n="1"/>
+          <has_line_matching expression=".*groups:id=.p2.*" n="1"/>
+          <has_line_matching expression=".*groups:id=.p3.*" n="1"/>
+        </assert_contents>
+      </output>
+    </test>
+  </tests>
+  <help><![CDATA[Set pathway to reactions in a network from a tabulated file containing the reaction ids and the pathways
+The ids must correspond between the tabulated file and the SBML file.
+If prefix R_ is present in the ids in the SBML file and not in the tabulated file, use the -p option.
+Pathways will be written in the SBML file in two ways:- as reaction note (e.g. SUBSYSTEM: purine_biosynthesis)- as SBML group (see Group package specifications: https://pmc.ncbi.nlm.nih.gov/articles/PMC5451322/)
+@ATTRIBUTION@]]></help>
+  <citations>
+    <citation type="doi">10.1515/jib-2016-290</citation>
+  </citations>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml	Thu Mar 13 15:52:07 2025 +0000
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<macros>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="2.0.1">met4j</requirement>
+            <yield/>
+        </requirements>
+    </xml>
+    <xml name="bio_tools">
+        <xrefs>
+            <xref type="bio.tools">met4j</xref>
+        </xrefs>
+    </xml>
+    <token name="@TOOL_VERSION@">2.0.1</token>
+    <token name="@ATTRIBUTION@"><![CDATA[
+**Attribution**
+
+This Galaxy tool relies on the met4j toolkit which is dedicated to the structural analysis of metabolic networks (https://forgemia.inra.fr/metexplore/met4j)
+    ]]></token>
+</macros>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/pathways.tsv	Thu Mar 13 15:52:07 2025 +0000
@@ -0,0 +1,3 @@
+reac1	P1
+reac2	P2|P3
+reac3	P1
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/pathwaysOtherSep.tsv	Thu Mar 13 15:52:07 2025 +0000
@@ -0,0 +1,3 @@
+reac1	P1
+reac2	P2 + P3
+reac3	P1
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/toy_model.xml	Thu Mar 13 15:52:07 2025 +0000
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding='UTF-8' ?>
+<sbml fbc:required="false" groups:required="false" level="3" version="1"
+	xmlns="http://www.sbml.org/sbml/level3/version1/core"
+	xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version2"
+	xmlns:groups="http://www.sbml.org/sbml/level3/version1/groups/version1">
+	<model fbc:strict="true" name="toy model">
+		<listOfUnitDefinitions>
+			<unitDefinition id="mmol_per_gDW_per_hr" name="mmol_per_gDW_per_hr">
+				<listOfUnits>
+					<unit exponent="-1" kind="gram" multiplier="1" scale="0"/>
+					<unit exponent="1" kind="mole" multiplier="1" scale="-3"/>
+					<unit exponent="-1" kind="second" multiplier="0.00027777" scale="0"/>
+				</listOfUnits>
+			</unitDefinition>
+		</listOfUnitDefinitions>
+		<listOfCompartments>
+			<compartment constant="false" id="c" name="Cytosol"/>
+			<compartment constant="false" id="e" name="Extracellular"/>
+		</listOfCompartments>
+		<listOfSpecies>
+			<species boundaryCondition="false" compartment="e" constant="false" fbc:charge="0" hasOnlySubstanceUnits="false" id="A_ext" name="A_ext">
+				<notes>
+					<body xmlns="http://www.w3.org/1999/xhtml">
+						<p>SMILES: C[C@@H](C(=O)O)NC</p>
+					</body>
+				</notes>
+				<annotation>
+					<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+						xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+						<rdf:Description rdf:about="#A_ext">
+							<bqbiol:is>
+								<in:inchi xmlns:in="https://biomodels.net/inchi">InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3</in:inchi>
+							</bqbiol:is>
+						</rdf:Description>
+					</rdf:RDF>
+				</annotation>
+
+			</species>
+			<species boundaryCondition="false" compartment="c" constant="false" fbc:charge="0" hasOnlySubstanceUnits="false" id="A" name="A"/>
+			<species boundaryCondition="false" compartment="c" constant="false" fbc:charge="0" hasOnlySubstanceUnits="false" id="B" name="B"/>
+			<species boundaryCondition="false" compartment="c" constant="false" fbc:charge="0" hasOnlySubstanceUnits="false" id="C" name="C"/>
+			<species boundaryCondition="false" compartment="c" constant="false" fbc:charge="0" hasOnlySubstanceUnits="false" id="D" name="D"/>
+			<species boundaryCondition="false" compartment="e" constant="false" fbc:charge="0" hasOnlySubstanceUnits="false" id="D_ext" name="D_ext"/>
+			<species boundaryCondition="false" compartment="e" constant="false" fbc:charge="0" hasOnlySubstanceUnits="false" id="E_ext" name="E_ext"/>
+			<species boundaryCondition="false" compartment="c" constant="false" fbc:charge="0" hasOnlySubstanceUnits="false" id="E" name="E"/>
+		</listOfSpecies>
+		<listOfParameters>
+			<parameter constant="true" id="cobra_default_lb" name="cobra default - lb" sboTerm="SBO:0000626" units="mmol_per_gDW_per_hr" value="-100000.0"/>
+			<parameter constant="true" id="cobra_default_ub" name="cobra default - ub" sboTerm="SBO:0000626" units="mmol_per_gDW_per_hr" value="100000.0"/>
+			<parameter constant="true" id="cobra_0_bound" name="cobra 0 - bound" sboTerm="SBO:0000625" units="mmol_per_gDW_per_hr" value="0.0"/>
+			<parameter constant="true" id="reac1_upper_bound" name="reac1 upper bound" sboTerm="SBO:0000625" units="mmol_per_gDW_per_hr" value="10.0"/>
+			<parameter constant="true" id="reac6_upper_bound" name="reac6 upper bound" sboTerm="SBO:0000625" units="mmol_per_gDW_per_hr" value="3.0"/>
+			<parameter constant="true" id="reac2_upper_bound" name="reac2 upper bound" sboTerm="SBO:0000625" units="mmol_per_gDW_per_hr" value="100000.0"/>
+			<parameter constant="true" id="reac3_upper_bound" name="reac3 upper bound" sboTerm="SBO:0000625" units="mmol_per_gDW_per_hr" value="100000.0"/>
+			<parameter constant="true" id="reac4_upper_bound" name="reac4 upper bound" sboTerm="SBO:0000625" units="mmol_per_gDW_per_hr" value="100000.0"/>
+			<parameter constant="true" id="reac5_upper_bound" name="reac5 upper bound" sboTerm="SBO:0000625" units="mmol_per_gDW_per_hr" value="100000.0"/>
+			<parameter constant="true" id="reac7_upper_bound" name="reac7 upper bound" sboTerm="SBO:0000625" units="mmol_per_gDW_per_hr" value="100000.0"/>
+		</listOfParameters>
+		<listOfReactions>
+			<reaction fast="false" fbc:lowerFluxBound="cobra_0_bound" fbc:upperFluxBound="reac1_upper_bound" id="reac1" name="reac1" reversible="false">
+				<listOfReactants>
+					<speciesReference constant="true" species="A_ext" stoichiometry="1.0"/>
+				</listOfReactants>
+				<listOfProducts>
+					<speciesReference constant="true" species="A" stoichiometry="1.0"/>
+				</listOfProducts>
+			</reaction>
+			<reaction fast="false" fbc:lowerFluxBound="cobra_default_lb" fbc:upperFluxBound="reac2_upper_bound" id="reac2" name="reac2" reversible="true">
+				<listOfReactants>
+					<speciesReference constant="true" species="A" stoichiometry="1.0"/>
+				</listOfReactants>
+				<listOfProducts>
+					<speciesReference constant="true" species="B" stoichiometry="1.0"/>
+				</listOfProducts>
+			</reaction>
+			<reaction fast="false" fbc:lowerFluxBound="cobra_0_bound" fbc:upperFluxBound="reac3_upper_bound" id="reac3" name="reac3" reversible="false">
+				<listOfReactants>
+					<speciesReference constant="true" species="A" stoichiometry="1.0"/>
+				</listOfReactants>
+				<listOfProducts>
+					<speciesReference constant="true" species="C" stoichiometry="1.0"/>
+				</listOfProducts>
+			</reaction>
+			<reaction fast="false" fbc:lowerFluxBound="cobra_0_bound" fbc:upperFluxBound="reac4_upper_bound" id="reac4" name="reac4" reversible="false">
+				<listOfReactants>
+					<speciesReference constant="true" species="B" stoichiometry="1.0"/>
+					<speciesReference constant="true" species="C" stoichiometry="1.0"/>
+				</listOfReactants>
+				<listOfProducts>
+					<speciesReference constant="true" species="D" stoichiometry="1.5"/>
+				</listOfProducts>
+			</reaction>
+			<reaction fast="false" fbc:lowerFluxBound="cobra_0_bound" fbc:upperFluxBound="reac5_upper_bound" id="reac5" name="reac5" reversible="false">
+				<listOfReactants>
+					<speciesReference constant="true" species="D" stoichiometry="1.0"/>
+				</listOfReactants>
+				<listOfProducts>
+					<speciesReference constant="true" species="D_ext" stoichiometry="1.0"/>
+				</listOfProducts>
+			</reaction>
+			<reaction fast="false" fbc:lowerFluxBound="cobra_0_bound" fbc:upperFluxBound="reac6_upper_bound" id="reac6" name="reac6" reversible="false">
+				<listOfReactants>
+					<speciesReference constant="true" species="E_ext" stoichiometry="1.0"/>
+				</listOfReactants>
+				<listOfProducts>
+					<speciesReference constant="true" species="E" stoichiometry="1.0"/>
+				</listOfProducts>
+			</reaction>
+			<reaction fast="false" fbc:lowerFluxBound="cobra_0_bound" fbc:upperFluxBound="reac7_upper_bound" id="reac7" name="reac7" reversible="false">
+				<listOfReactants>
+					<speciesReference constant="true" species="E" stoichiometry="2.0"/>
+				</listOfReactants>
+				<listOfProducts>
+					<speciesReference constant="true" species="D" stoichiometry="1.0"/>
+				</listOfProducts>
+			</reaction>
+		</listOfReactions>
+	</model>
+</sbml>
\ No newline at end of file