view ReactionDistanceMatrix.xml @ 2:54837bf4d91d draft default tip

planemo upload for repository https://forge.inrae.fr/metexplore/met4j-galaxy commit 71335d4a636672d264cc4f443c07856907571928
author metexplore
date Fri, 21 Nov 2025 10:22:11 +0000
parents d05c0c639108
children
line wrap: on
line source

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<tool id="met4j_ReactionDistanceMatrix" name="ReactionDistanceMatrix" version="@TOOL_VERSION@">
  <description>Create a reaction to reaction distance matrix.</description>
  <macros>
    <import>macros.xml</import>
  </macros>
  <expand macro="bio_tools"/>
  <expand macro="requirements"/>
  <command detect_errors="exit_code"><![CDATA[met4j networkAnalysis.ReactionDistanceMatrix -i "$inputPath"
#if str($sideCompoundFile) != 'None':
 -sc "$sideCompoundFile"
#end if
 $degree
#if str($rExclude) != 'None':
 -re "$rExclude"
#end if
#if str($rxnFile) != 'None':
 -s "$rxnFile"
#end if
#if str($weightFile) != 'None':
 -w "$weightFile"
#end if
 $undirected
 -o "$outputPath"
]]></command>
  <inputs>
    <param argument="-i" format="sbml" label="input SBML file" name="inputPath" optional="false" type="data" value=""/>
    <param argument="-sc" format="txt" label="an optional file containing list of side compounds to ignore" name="sideCompoundFile" optional="true" type="data" value=""/>
    <param argument="-dw" checked="false" falsevalue="" label="penalize traversal of hubs by using degree square weighting (-w must not be set)" name="degree" truevalue="-dw" type="boolean" value="false"/>
    <param argument="-re" format="txt" label="an optional file containing list of reactions to ignore" name="rExclude" optional="true" type="data" value=""/>
    <param argument="-s" format="txt" label="an optional file containing list of reactions of interest." name="rxnFile" optional="true" type="data" value=""/>
    <param argument="-w" format="tsv" label="an optional file containing weights for compound pairs" name="weightFile" optional="true" type="data" value=""/>
    <param argument="-u" checked="false" falsevalue="" label="Ignore reaction direction" name="undirected" truevalue="-u" type="boolean" value="false"/>
  </inputs>
  <outputs>
    <data format="csv" name="outputPath"/>
  </outputs>
  <tests>
    <test>
      <param name="inputPath" value="toy_model.xml"/>
      <output ftype="csv" name="outputPath">
        <assert_contents>
          <has_n_lines n="8"/>
          <has_line_matching expression="id,reac1,reac2,reac3,reac4,reac5,reac6,reac7" n="1"/>
          <has_line_matching expression="reac1,0.0,1.0,1.0,2.0,3.0,Infinity,Infinity" n="1"/>
          <has_line_matching expression="reac2,Infinity,0.0,1.0,1.0,2.0,Infinity,Infinity" n="1"/>
        </assert_contents>
      </output>
    </test>
    <test>
      <param name="inputPath" value="toy_model.xml"/>
      <param name="undirected" value="true"/>
      <output ftype="csv" name="outputPath">
        <assert_contents>
          <has_n_lines n="8"/>
          <has_line_matching expression="id,reac1,reac2,reac3,reac4,reac5,reac6,reac7" n="1"/>
          <has_line_matching expression="reac1,0.0,1.0,1.0,2.0,3.0,5.0,4.0" n="1"/>
          <has_line_matching expression="reac2,1.0,0.0,1.0,1.0,2.0,4.0,3.0" n="1"/>
        </assert_contents>
      </output>
    </test>
    <test>
      <param name="inputPath" value="toy_model.xml"/>
      <param name="undirected" value="true"/>
      <param name="sideCompoundFile" value="sides.txt"/>
      <output ftype="csv" name="outputPath">
        <assert_contents>
          <has_n_lines n="8"/>
          <has_line_matching expression="id,reac1,reac2,reac3,reac4,reac5,reac6,reac7" n="1"/>
          <has_line_matching expression="reac1,0.0,1.0,1.0,2.0,3.0,5.0,4.0" n="1"/>
          <has_line_matching expression="reac2,1.0,0.0,1.0,2.0,3.0,5.0,4.0" n="1"/>
          <has_line_matching expression="reac3,1.0,1.0,0.0,1.0,2.0,4.0,3.0" n="1"/>
          <has_line_matching expression="reac4,2.0,2.0,1.0,0.0,1.0,3.0,2.0" n="1"/>
        </assert_contents>
      </output>
    </test>
    <test>
      <param name="inputPath" value="toy_model.xml"/>
      <param name="undirected" value="true"/>
      <param name="rExclude" value="rexclude.txt"/>
      <output ftype="csv" name="outputPath">
        <assert_contents>
          <has_n_lines n="6"/>
          <has_line_matching expression="id,reac1,reac2,reac3,reac4,reac5" n="1"/>
          <has_line_matching expression="reac1,0.0,1.0,1.0,2.0,3.0" n="1"/>
          <has_line_matching expression="reac2,1.0,0.0,1.0,1.0,2.0" n="1"/>
          <has_line_matching expression="reac3,1.0,1.0,0.0,1.0,2.0" n="1"/>
          <has_line_matching expression="reac4,2.0,1.0,1.0,0.0,1.0" n="1"/>
          <has_line_matching expression="reac5,3.0,2.0,2.0,1.0,0.0" n="1"/>
        </assert_contents>
      </output>
    </test>
    <test>
      <param name="inputPath" value="toy_model.xml"/>
      <param name="undirected" value="true"/>
      <param name="sideCompoundFile" value="sides.txt"/>
      <param name="rExclude" value="rexclude.txt"/>
      <output ftype="csv" name="outputPath">
        <assert_contents>
          <has_n_lines n="6"/>
          <has_line_matching expression="id,reac1,reac2,reac3,reac4,reac5" n="1"/>
          <has_line_matching expression="reac1,0.0,1.0,1.0,2.0,3.0" n="1"/>
          <has_line_matching expression="reac2,1.0,0.0,1.0,2.0,3.0" n="1"/>
          <has_line_matching expression="reac3,1.0,1.0,0.0,1.0,2.0" n="1"/>
          <has_line_matching expression="reac4,2.0,2.0,1.0,0.0,1.0" n="1"/>
          <has_line_matching expression="reac5,3.0,3.0,2.0,1.0,0.0" n="1"/>
        </assert_contents>
      </output>
    </test>
    <test>
      <param name="inputPath" value="toy_model.xml"/>
      <param name="sideCompoundFile" value="sides.txt"/>
      <param name="rExclude" value="rexclude.txt"/>
      <output ftype="csv" name="outputPath">
        <assert_contents>
          <has_n_lines n="6"/>
          <has_line_matching expression="id,reac1,reac2,reac3,reac4,reac5" n="1"/>
          <has_line_matching expression="reac1,0.0,1.0,1.0,2.0,3.0" n="1"/>
          <has_line_matching expression="reac2,Infinity,0.0,1.0,2.0,3.0" n="1"/>
          <has_line_matching expression="reac3,Infinity,Infinity,0.0,1.0,2.0" n="1"/>
          <has_line_matching expression="reac4,Infinity,Infinity,Infinity,0.0,1.0" n="1"/>
          <has_line_matching expression="reac5,Infinity,Infinity,Infinity,Infinity,0.0" n="1"/>
        </assert_contents>
      </output>
    </test>
  </tests>
  <help><![CDATA[Create a reaction to reaction distance matrix.
The distance between two reactions is computed as the length of the shortest path connecting the two in the reaction graph, where two reactions are linked if they produce a metabolite consumed by the other or the other way around.
An optional edge weighting can be used, turning the distances into the sum of edge weights in the lightest path, rather than the length of the shortest path.The default weighting use target's degree squared. Alternatively, custom weighting can be provided in a file. In that case, edges without weight are ignored during path search.
If no edge weighting is set, it is recommended to provide a list of side compounds to ignore during network traversal.
@ATTRIBUTION@]]></help>
  <citations/>
</tool>