Mercurial > repos > metexplore > met4j_extractsubbipnetwork
changeset 0:96589870be02 draft
planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy commit e28ca123295d50b85ba872e5a4720fd72697ecc3
| author | metexplore |
|---|---|
| date | Thu, 13 Mar 2025 15:42:23 +0000 |
| parents | |
| children | 56501f9a2a6b |
| files | ExtractSubBipNetwork.xml macros.xml test-data/sc.txt test-data/seeds.txt test-data/targets.txt test-data/test.gml test-data/toy_model.xml |
| diffstat | 6 files changed, 271 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ExtractSubBipNetwork.xml Thu Mar 13 15:42:23 2025 +0000 @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<tool id="met4j_ExtractSubBipNetwork" name="ExtractSubBipNetwork" version="@TOOL_VERSION@"> + <description>Create a subnetwork from a metabolic network in SBML format, and two files containing lists of compounds and/or reactions of interests ids, one per row, plus one file of the same format containing side compounds ids.</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.networkAnalysis.ExtractSubBipNetwork -i "$inputPath" + -s "$sourcePath" + -t "$targetPath" + $undirected + -sc "$sideCompoundFile" +#if str($blkdReactionFile) != 'None': + -br "$blkdReactionFile" +#end if +#if str($weightFile) != 'None': + -cw "$weightFile" +#end if +#if str($k): + -k "$k" +#end if + $st +#if str($format): + -f "$format" +#end if + -o "$output" +]]></command> + <inputs> + <param argument="-i" format="sbml" label="input SBML file" name="inputPath" optional="false" type="data" value=""/> + <param argument="-s" format="txt" label="input sources txt file" name="sourcePath" optional="false" type="data" value=""/> + <param argument="-t" format="txt" label="input targets txt file" name="targetPath" optional="false" type="data" value=""/> + <param argument="-u" checked="false" falsevalue="" label="Ignore reaction direction" name="undirected" truevalue="-u" type="boolean" value="false"/> + <param argument="-sc" format="txt" label="a file containing list of side compounds to ignore" name="sideCompoundFile" optional="false" type="data" value=""/> + <param argument="-br" format="txt" label="a file containing list of blocked reactions to ignore" name="blkdReactionFile" optional="true" type="data" value=""/> + <param argument="-cw" format="tsv" label="an optional file containing weights for reactions pairs" name="weightFile" optional="true" type="data" value=""/> + <param argument="-k" label="Extract k-shortest paths" name="k" optional="true" type="text" value="1"> + <sanitizer invalid_char="_"> + <valid initial="string.printable"/> + </sanitizer> + </param> + <param argument="-st" checked="false" falsevalue="" label="Extract Steiner Tree" name="st" truevalue="-st" type="boolean" value="false"/> + <param argument="-f" label="Format of the exported graphTabulated edge list by default (source id 	 edge type 	 target id). Other options include GML, JsonGraph, and tabulated node list (label 	 node id 	 node type)." name="format" optional="true" type="select" value="tab"> + <option value="gml">gml</option> + <option selected="true" value="tab">tab</option> + <option value="nodeList">nodeList</option> + <option value="json">json</option> + <option value="matrix">matrix</option> + </param> + </inputs> + <outputs> + <data format="txt" name="output"/> + </outputs> + <tests> + <test> + <param name="inputPath" value="toy_model.xml"/> + <param name="sourcePath" value="seeds.txt"/> + <param name="targetPath" value="targets.txt"/> + <param name="sideCompoundFile" value="sc.txt"/> + <param name="format" value="gml"/> + <output ftype="txt" name="output"> + <assert_contents> + <has_line_matching expression=".*node.*" n="5"/> + <has_line_matching expression=".*edge.*" n="4"/> + </assert_contents> + </output> + </test> + </tests> + <help><![CDATA[Create a subnetwork from a metabolic network in SBML format, and two files containing lists of compounds and/or reactions of interests ids, one per row, plus one file of the same format containing side compounds ids. +The subnetwork corresponds to the part of the network that connects reactions and compounds from the first list to reactions and compounds from the second list. +Sources and targets list can have elements in common. The connecting part can be defined as the union of shortest or k-shortest paths between sources and targets, or the Steiner tree connecting them. Contrary to compound graph, bipartite graph often lacks weighting policy for edge relevance. In order to ensure appropriate network density, a list of side compounds and blocked reactions to ignore during path build must be provided. An optional edge weight file, if available, can also be used. +@ATTRIBUTION@]]></help> + <citations/> +</tool>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Thu Mar 13 15:42:23 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/seeds.txt Thu Mar 13 15:42:23 2025 +0000 @@ -0,0 +1,1 @@ +A \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/targets.txt Thu Mar 13 15:42:23 2025 +0000 @@ -0,0 +1,1 @@ +D \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/test.gml Thu Mar 13 15:42:23 2025 +0000 @@ -0,0 +1,56 @@ +Creator "JGraphT GML Exporter" +Version 1 +graph +[ + label "" + directed 1 + node + [ + id 1 + label "A" + ] + node + [ + id 2 + label "reac2" + ] + node + [ + id 3 + label "B" + ] + node + [ + id 4 + label "reac4" + ] + node + [ + id 5 + label "D" + ] + edge + [ + source 1 + target 2 + label "(A : reac2)" + ] + edge + [ + source 2 + target 3 + label "(reac2 : B)" + ] + edge + [ + source 3 + target 4 + label "(B : reac4)" + ] + edge + [ + source 4 + target 5 + label "(reac4 : D)" + ] +]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/toy_model.xml Thu Mar 13 15:42:23 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
