<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<tool id="met4j_BipartiteDistanceMatrix" name="BipartiteDistanceMatrix" version="2.0.0">
  <description>Create a compound to reactions distance matrix.</description>
  <xrefs>
    <xref type="bio.tools">met4j</xref>
  </xrefs>
  <requirements>
    <container type="singularity">oras://registry.forgemia.inra.fr/metexplore/met4j/met4j-singularity:2.0.0</container>
  </requirements>
  <command detect_errors="exit_code"><![CDATA[sh /usr/bin/met4j.sh networkAnalysis.BipartiteDistanceMatrix -i "$inputPath"
#if str($sideCompoundFile) != 'None':
 -sc "$sideCompoundFile"
#end if
#if str($rExclude) != 'None':
 -re "$rExclude"
#end if
#if str($metFile) != 'None':
 -m "$metFile"
#end if
#if str($rxnFile) != 'None':
 -r "$rxnFile"
#end if
#if str($weightFile) != 'None':
 -w "$weightFile"
#end if
 $undirected
 $full
 -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="-re" format="txt" label="an optional file containing list of reactions to ignore" name="rExclude" optional="true" type="data" value=""/>
    <param argument="-m" format="txt" label="an optional file containing list of compounds of interest." name="metFile" optional="true" type="data" value=""/>
    <param argument="-r" 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"/>
    <param argument="-f" checked="false" falsevalue="" label="compute full pairwise matrix from both reactions and compounds lists" name="full" truevalue="-f" type="boolean" value="false"/>
  </inputs>
  <outputs>
    <data format="csv" name="outputPath"/>
  </outputs>
  <tests/>
  <help><![CDATA[Create a compound to reactions distance matrix.
The distance between two nodes (metabolite or reaction) is computed as the length of the shortest path connecting the two in the bipartite graph, Bipartite graphs are composed of two distinct sets of nodes and two nodes can be linked only if they are from distinct sets.
Therefore a metabolite node can be linked to a reaction node if the metabolite is a substrate or product of the reaction.
An optional custom 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.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.]]></help>
  <citations/>
</tool>
