RAPPEL : Opération de maintenance > ForgeMIA indisponible le 20 Janvier entre 7h et 12h

Commit ca2f4a56 authored by Ibouniyamine Nabihoudine's avatar Ibouniyamine Nabihoudine
Browse files

wf doc

parent 18d23597
......@@ -71,14 +71,10 @@
<li><a href="#workflow" class="active">Workflow definition</a></li>
<li><a href="#define_parameters">Define parameters</a>
<ul class="nav nav-stacked">
<li><a href="#add_parameter">Add parameter</a></li>
<li><a href="#add_parameter_list">Add parameter list</a></li>
<li><a href="#add_input_directory">Add input directory</a></li>
<li><a href="#add_input_file">Add input file</a></li>
<li><a href="#add_input_file_list">Add input file list</a></li>
<li><a href="#add_multiple_parameter">Add multiple parameter</a></li>
<li><a href="#add_multiple_parameter_list">Add multiple parameter list</a></li>
<li><a href="#add_exclusion_rule">Add exclusion rule</a></li>
<li><a href="#simple_parameters">Simple parameters</a></li>
<li><a href="#parameter_list">Parameter list</a></li>
<li><a href="#multiple_parameters">Multiple parameters</a></li>
<li><a href="#exclusion_rules">Exclustion rules</a></li>
</ul>
</li>
<li><a href="#process">Process</a></li>
......@@ -178,137 +174,395 @@ class Alignment (Workflow):
types of parameters. The added parameter will be available as an object attibut, thus be accessible using <code>self.param_name</code>.
Each function defines hows the parameter will be described in the command line and in the interface.
</p>
<p>
Several types of parameters can be added, all described in the following sections. They all have two required positional
arguments name and help. All other arguments passed to those methods are keywords argument.
</p>
<div class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
Do not use the <code>is</code> operator to evaluate a parameter. Use instead <code>==</code>.
</div>
<div id="add_parameter" class="subgroup">
<h2>The add_parameter() method</h2>
<p>This method is the basic method used to add a parameter to our workflow.</p>
<p>Here, 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"):
<div id="simple_parameters" class="subgroup">
<h2>Simple 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"):
self.add_parameter("sequencer",
"The sequencer type.",
choices = ["HiSeq2000", "ILLUMINA","SLX","SOLEXA","454","UNKNOWN"],
default="HiSeq2000")</code></pre>
</div>
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>
<td>false</td>
<td>None</td>
<td>The display name of the parameter.</td>
</tr>
<tr>
<td>add_to</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>This parameter is a subparameter of add_to.</td>
</tr>
</tbody>
</table>
</div>
<h3>add_input_file() method</h3>
<p>To add an input file to your workflow, use the <code>add_input_file()</code> method. Like <code>add_parameter()</code> it adds a single parameter
to the workflow </p>
<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>
<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 pronpted 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>
<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>add_to</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>This parameter is a subparameter of add_to.</td>
</tr>
<tr>
<td>size_limit</td>
<td>string</td>
<td>false</td>
<td>"0"</td>
<td>This is the size limit for the file. Units notation must be in ("bytes", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb") </td>
</tr>
</tbody>
</table>
</div>
<h3>Options</h3>
</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>
<p>List of options that can be added to <code>add_parameter()</code></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>
<h3>add_input_file_list()</h3>
<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>types.StringType</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></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></td>
</tr>
<tr>
<td>display_name</td>
<td>string</td>
<td>false</td>
<td></td>
<td>The display name of the parameter</td>
</tr>
<tr>
<td>cmd_format</td>
<td>string</td>
<td></td>
<td></td>
<td></td>
</tr>
<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="multiple_parameters" class="subgroup">
<h2>Multiple parameters</h2>
<p>A multiple parameter can be viewed as python dictionary containing different type of parameter. The next example creates
a multiple parameter named <code>library</code> which contains two input files <code>R1</code> and <code>R2</code> and a <code>sequencer</code>
parameter. </p>
<div>
<pre class="pre-hl "><code class="python">self.add_multiple_parameter("library", "Library.", required=True)
self.add_input_file("R1", "Path to R1 file.", required=True, add_to="library")
self.add_input_file("R2", "Path to R2 file.", add_to="library")
self.add_parameter("sequencer", "The sequencer type.", choices=["HiSeq2000",
"ILLUMINA", "UNKNOWN"], default="HiSeq2000", add_to="library")
</code></pre>
</div>
<h3>how to populate a multiple parameter</h3>
<p>To add a parameter in the multiple parameter, use the option <code>add_to</code>. See the previous options.</p>
<h3>add_multiple_parameter()</h3>
<h4>Options</h4>
<p>There are two positional options name and help, other options can be added as keyword options.</p>
<tr>
<td>argpos</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<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</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>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>
</tbody>
</table>
</div>
<h3>add_multiple_parameter_list()</h3>
<p>This method adds a parameter which is a list of multiple parameter. The definition and options for this
method are the same as <code>add_multiple_parameter()</code> </p>
</div>
<div id="exclusion_rules" class="subgroup">
<h2>Exclustion rules</h2>
<p>An exclusion rules allows to set parameters as excluded from each other. The method <code>add_exclusion_rule()</code> is used. </p>
<h3>add_exclution_rule()</h3>
<p>The method accept the following 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>*args2exclude</td>
<td>str</td>
<td>true</td>
<td>None</td>
<td>The name of the parameter to exclude.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="add_parameter_list" class="subgroup"><h2>Add parameter list</h2></div>
<div id="add_input_directory" class="subgroup"><h2>Add input directory</h2></div>
<div id="add_input_file" class="subgroup"><h2>Add input file</h2></div>
<div id="add_input_file_list" class="subgroup"><h2>Add input file list</h2></div>
<div id="add_multiple_parameter" class="subgroup"><h2>Add multiple parameter</h2></div>
<div id="add_multiple_parameter_list" class="subgroup"><h2>Add multiple parameter list</h2></div>
<div id="add_exclusion_rule" class="subgroup"><h2>Add exclusion rule</h2></div>
</section>
<section id="process" class="group">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment