Commit 48c71870 authored by Ibouniyamine Nabihoudine's avatar Ibouniyamine Nabihoudine
Browse files

reorder parameters definition paragraphs

parent 64916978
......@@ -73,9 +73,9 @@
<li><a href="#component" >Component definition</a></li>
<li><a href="#define_parameters">Defining parameters</a>
<ul class="nav nav-stacked">
<li><a href="#simple_parameters">Simple parameters</a></li>
<li><a href="#parameter_list">Parameter list</a></li>
<li><a href="#inputs_and_outputs">Inputs and Outputs</a></li>
<li><a href="#parameters">Parameters</a></li>
<li><a href="#input_parameters">Input parameters</a></li>
<li><a href="#output_parameters">Output parameters</a></li>
</ul>
</li>
<li><a href="#external_components" >External components</a>
......@@ -189,11 +189,12 @@ self.add_output_file_list("sais", "sai files",
pattern="{basename_woext}.sai", items=self.input_files)</code></pre>
</div>
<div id="simple_parameters" class="subgroup">
<h2>Simple parameters</h2>
<li><a href="#parameters">Parameters</a></li>
<div id="parameters" class="subgroup">
<h2>Parameters</h2>
<p>The methods used to add simple parameters are <code>add_parameter()</code>, <code>add_input_file()</code> and <code>add_output_file()</code>.</p>
<h3>add_parameter() method</h3>
<p>
This method is the basic one used to add parameters. In the next example, a parameter named <code>sequencer</code>
......@@ -317,224 +318,227 @@ self.add_output_file_list("sais", "sai files",
</tbody>
</table>
</div>
<h3>add_input_file() method</h3>
<p>To add an input file to the component, use the <code>add_input_file()</code> method. Like <code>add_parameter()</code> it adds a single parameter
to the component.</p>
<h3>add_parameter_list()</h3>
<p>This method description and options are the same as <code>add_parameter()</code>. See the previous
method for a description of available options.</p>
</div>
<div id="input_parameters" class="subgroup">
<h2>Input parameters</h2>
<h3>add_input_file() method</h3>
<p>To add an input file to the component, use the <code>add_input_file()</code> method. Like <code>add_parameter()</code> it adds a single parameter
to the component.</p>
<h4>Options</h4>
<h4>Options</h4>
<p>The two positional arguments <code>name</code> and <code>help</code> are always present.
Keyword arguments are not the same as <code>add_parameter()</code> </p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr style="white-space:nowrap">
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Default value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>str</td>
<td>true</td>
<td>None</td>
<td>The name of the parameter</td>
</tr>
<tr>
<td>help</td>
<td>str</td>
<td>true</td>
<td>None</td>
<td>The help message prompted to the user.</td>
</tr>
<tr>
<td>default</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The path to the input file</td>
</tr>
<p>The two positional arguments <code>name</code> and <code>help</code> are always present.
Keyword arguments are not the same as <code>add_parameter()</code> </p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr style="white-space:nowrap">
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Default value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>str</td>
<td>true</td>
<td>None</td>
<td>The name of the parameter</td>
</tr>
<tr>
<td>file_format</td>
<td>string</td>
<td>false</td>
<td>"any"</td>
<td>This describe the format of the inputfile. New file format can be defined in <code>formats.py</code> </td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>false</td>
<td>"inputfile"</td>
<td>The type of our file. It must be a value in ("inputfile", "localfile", "urlfile", "browsefile") </td>
</tr>
<tr>
<td>required</td>
<td>boolean</td>
<td>false</td>
<td>false</td>
<td>Wether or not the parameter can be ommitted.</td>
</tr>
<tr>
<td>flag</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The parameter command line flag (default is <em>"--name"</em>).</td>
</tr>
<tr>
<td>group</td>
<td>string</td>
<td>false</td>
<td>"default"</td>
<td>This is used to regroup a list of parameters in the command line and the GUI.</td>
</tr>
<tr>
<td>display_name</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The display name of the parameter.</td>
</tr>
<tr>
<td>cmd_format</td>
<td>string</td>
<td>false</td>
<td>""</td>
<td>The command format is the flag used in the command line for our parameter.</td>
</tr>
<tr>
<td>argpos</td>
<td>integer</td>
<td>false</td>
<td>-1</td>
<td>The position of the parameter in the command line.</td>
</tr>
</tbody>
</table>
</div>
<h3>add_out_file() method</h3>
<p>To add an output file, use the <code>add_input_file()</code> method. Like <code>add_parameter()</code> it adds a single parameter
to the component.</p>
<h4>Options</h4>
<p>The two positional arguments <code>name</code> and <code>help</code> are always present </p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr style="white-space:nowrap">
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Default value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>str</td>
<td>true</td>
<td>None</td>
<td>The name of the parameter</td>
</tr>
<tr>
<td>help</td>
<td>str</td>
<td>true</td>
<td>None</td>
<td>The help message prompted to the user.</td>
</tr>
<tr>
<td>filename</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The expected name of the output file.</td>
</tr>
<tr>
<td>help</td>
<td>str</td>
<td>true</td>
<td>None</td>
<td>The help message prompted to the user.</td>
</tr>
<tr>
<td>file_format</td>
<td>string</td>
<td>false</td>
<td>"any"</td>
<td>This describe the format of the inputfile. New file format can be defined in <code>formats.py</code> </td>
</tr>
<tr>
<td>group</td>
<td>string</td>
<td>false</td>
<td>"default"</td>
<td>This is used to regroup a list of parameters in the command line and the GUI.</td>
</tr>
<tr>
<td>display_name</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The display name of the parameter.</td>
</tr>
<tr>
<td>cmd_format</td>
<td>string</td>
<td>false</td>
<td>""</td>
<td>The command format is the flag used in the command line for our parameter.</td>
</tr>
<tr>
<td>argpos</td>
<td>integer</td>
<td>false</td>
<td>-1</td>
<td>The position of the parameter in the command line.</td>
</tr>
</tbody>
</table>
</div>
<tr>
<td>default</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The path to the input file</td>
</tr>
<tr>
<td>file_format</td>
<td>string</td>
<td>false</td>
<td>"any"</td>
<td>This describe the format of the inputfile. New file format can be defined in <code>formats.py</code> </td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>false</td>
<td>"inputfile"</td>
<td>The type of our file. It must be a value in ("inputfile", "localfile", "urlfile", "browsefile") </td>
</tr>
<tr>
<td>required</td>
<td>boolean</td>
<td>false</td>
<td>false</td>
<td>Wether or not the parameter can be ommitted.</td>
</tr>
<tr>
<td>flag</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The parameter command line flag (default is <em>"--name"</em>).</td>
</tr>
<tr>
<td>group</td>
<td>string</td>
<td>false</td>
<td>"default"</td>
<td>This is used to regroup a list of parameters in the command line and the GUI.</td>
</tr>
<tr>
<td>display_name</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The display name of the parameter.</td>
</tr>
<tr>
<td>cmd_format</td>
<td>string</td>
<td>false</td>
<td>""</td>
<td>The command format is the flag used in the command line for our parameter.</td>
</tr>
<tr>
<td>argpos</td>
<td>integer</td>
<td>false</td>
<td>-1</td>
<td>The position of the parameter in the command line.</td>
</tr>
</tbody>
</table>
</div>
<h3>add_input_file_list()</h3>
<p>This method description and options are the same as <code>add_input_file()</code>. See the previous
method for a description of available options.</p>
</div>
<div id="parameter_list" class="subgroup">
<h2>Parameter list</h2>
<p>A parameter list is a container which contains a list of values. The methods used to add a parameter list are
<code>add_parameter_list()</code> and <code>add_input_file_list()</code>.</p>
<div id="output_parameters" class="subgroup">
<h2>Output parameters</h2>
<h3>add_parameter_list()</h3>
<p>This method description and options are the same as <code>add_parameter()</code>. See the previous
method for a description of available options.</p>
<h3>add_input_file_list()</h3>
<p>This method description and options are the same as <code>add_input_file()</code>. See the previous
method for a description of available options.</p>
<h3>add_out_file() method</h3>
<p>To add an output file, use the <code>add_input_file()</code> method. Like <code>add_parameter()</code> it adds a single parameter
to the component.</p>
<h3>add_output_file_list()</h3>
<h4>Options</h4>
<p>The two positional arguments <code>name</code> and <code>help</code> are always present </p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr style="white-space:nowrap">
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Default value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>str</td>
<td>true</td>
<td>None</td>
<td>The name of the parameter</td>
</tr>
<tr>
<td>help</td>
<td>str</td>
<td>true</td>
<td>None</td>
<td>The help message prompted to the user.</td>
</tr>
<tr>
<td>filename</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The expected name of the output file.</td>
</tr>
<tr>
<td>file_format</td>
<td>string</td>
<td>false</td>
<td>"any"</td>
<td>This describe the format of the inputfile. New file format can be defined in <code>formats.py</code> </td>
</tr>
<tr>
<td>group</td>
<td>string</td>
<td>false</td>
<td>"default"</td>
<td>This is used to regroup a list of parameters in the command line and the GUI.</td>
</tr>
<tr>
<td>display_name</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The display name of the parameter.</td>
</tr>
<tr>
<td>cmd_format</td>
<td>string</td>
<td>false</td>
<td>""</td>
<td>The command format is the flag used in the command line for our parameter.</td>
</tr>
<tr>
<td>argpos</td>
<td>integer</td>
<td>false</td>
<td>-1</td>
<td>The position of the parameter in the command line.</td>
</tr>
</tbody>
</table>
</div>
<h3>add_output_file_list()</h3>
<p>This method adds a list of output file to the component. It has two positional options <code>name</code>
and <code>help</code> and keyword options.</p>
......@@ -762,19 +766,8 @@ self.add_output_file_list("sais", "sai files",
</tbody>
</table>
</div>
</div>
<div id="inputs_and_outputs" class="subgroup">
<h2>Inputs and outputs</h2>
<p>
The link between two components in a workflow is made using input and output files.
</p>
</div>
</section>
<section id="external_components" class="group">
......
......@@ -72,8 +72,8 @@
<li><a href="#workflow" >The Workflow class</a></li>
<li><a href="#define_parameters">Define parameters</a>
<ul class="nav nav-stacked">
<li><a href="#simple_parameters">Simple parameters</a></li>
<li><a href="#parameter_list">Parameter list</a></li>
<li><a href="#parameters">Parameters</a></li>
<li><a href="#input_parameters">Input parameters</a></li>
<li><a href="#multiple_parameters">Multiple parameters</a></li>
<li><a href="#exclusion_rules">Exclusion rules</a></li>
</ul>
......@@ -158,257 +158,271 @@ class MyWorkflow (Workflow):
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
The operator <code>is</code> is not supported to evaluate a parameter, the operator <code>==</code> must be prefered.
<div id="simple_parameters" class="subgroup">
<h2>Simple parameters</h2>
<div id="parameters" class="subgroup">
<h2>Parameters</h2>
<p>The methods used to add simple parameters are <code>add_parameter()</code> and <code>add_input_file()</code>.</p>
<h3>add_parameter() method</h3>
<p>
This method is the basic one used to add parameters. In the next example, a parameter named <code>sequencer</code>
is added to the workflow. It has a list of choices and the default value is "HiSeq2000".
</p>
<div>
<pre class="pre-hl "><code class="python">def define_parameters(self, function="process"):
<p>Each parameter can be added as a sigle element or as list of parameters. Use <code>add_parameter()</code> method to add a single
parameter, and <code>add_parameter_list()</code> to add a list of parameters.</p>
<h3>add_parameter()</h3>
<p>
This method is the basic method used to add parameters. In the next example, a parameter named <code>sequencer</code>
is added to the workflow. It has a list of choices and the default value is "HiSeq2000".
</p>
<div>
<pre class="pre-hl "><code class="python">def define_parameters(self, function="process"):
self.add_parameter("sequencer",
"The sequencer type.",
choices = ["HiSeq2000", "ILLUMINA","SLX","SOLEXA","454","UNKNOWN"],
default="HiSeq2000")</code></pre>
</div>
<h4>Options</h4>
"The sequencer type.",
choices = ["HiSeq2000", "ILLUMINA","SLX","SOLEXA","454","UNKNOWN"],
default="HiSeq2000")</code></pre>
</div>
<h4>Options</h4>
<p>There are two positional argument : name and help. All other options are keyword options</p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
<th>Default value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>str</td>
<td>true</td>
<td>None</td>
<td>The name of the parameter. The parameter will then be available
in the workflow as <code>self.parameter_name</code>.</td>
</tr>
<tr>
<td>help</td>
<td>str</td>
<td>true</td>
<td>None</td>
<td>The help message pronpted to the user.</td>
</tr>
<tr>
<td>default</td>
<td>-</td>
<td>false</td>
<td>None</td>
<td>This is the default value of our parameter.</td>
</tr>
<tr>
<td>type</td>
<td> * </td>
<td>false</td>
<td>"str"</td>
<td> The type to which our argument will be converted. All default python types are available (int, str, float, bool). User can define new
types in <em>types.py</em> file.</td>
</tr>
<tr>
<td>choices</td>
<td>list</td>
<td>false</td>
<td>false</td>
<td>A container of the allowable values for the argument.</td>
</tr>
<tr>
<td>required</td>
<td>boolean</td>
<td>false</td>
<td>false</td>
<td>Wether or not the parameter can be ommitted.</td>
</tr>
<tr>
<td>flag</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The parameter command line flag (default is <em>"--name"</em>).</td>
</tr>
<tr>
<td>group</td>
<td>string</td>
<td>false</td>
<td>"default"</td>
<td>This is used to regroup a list of parameters in the command line and the GUI.</td>
</tr>
<tr>
<td>display_name</td>
<td>string</td>