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

Commit 96bd7da2 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

go a bit further

parent 48c71870
......@@ -73,7 +73,7 @@
<li><a href="#define_parameters">Define parameters</a>
<ul class="nav nav-stacked">
<li><a href="#parameters">Parameters</a></li>
<li><a href="#input_parameters">Input parameters</a></li>
<li><a href="#input_parameters">Inputs</a></li>
<li><a href="#multiple_parameters">Multiple parameters</a></li>
<li><a href="#exclusion_rules">Exclusion rules</a></li>
</ul>
......@@ -145,29 +145,28 @@ class MyWorkflow (Workflow):
<section id="define_parameters" class="group">
<h1 class="page-header">Define parameters</h1>
<p>
The <code>define_parameters()</code> method is used to add workflow inputs and outputs. Several methods are available to add different
types of parameters. The added parameter, once defined, is available as an object attibut, thus it is accessible through
<code>self.param_name</code>.
The <code>define_parameters()</code> method is used to add workflow parameters, inputs and outputs. To do so, several methods are available.
Once defined, the new parameters, are available as object attibuts, thus they are accessible through <code>self.parameter_name</code>.
</p>
<p>
Several types of parameters can be added, all described in the following sections. All have two required positional
arguments: <code>name</code> and <code>help</code>. The other arguments are optional and can be provided by using the
keywords argument.
arguments: <code>name</code> and <code>help</code>. The other arguments are optional and can be given to the method by using their
keywords.
</p>
<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="parameters" class="subgroup">
<h2>Parameters</h2>
<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>
<p>Each parameter can be added to handle a single element or a list of elements. Thus, the <code>add_parameter()</code> method can be used to force
the final user to provide one and only one value, where the <code>add_parameter_list()</code> method allows the final user to give as many values he
wants.</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>
In the following 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>
......@@ -199,8 +198,8 @@ class MyWorkflow (Workflow):
<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>
<td>The name of the parameter. The parameter value is accessible
within the workflow object through the attribute named <code>self.parameter_name</code>.</td>
</tr>
<tr>
......@@ -208,7 +207,7 @@ class MyWorkflow (Workflow):
<td>str</td>
<td>true</td>
<td>None</td>
<td>The help message pronpted to the user.</td>
<td>The parameter help message.</td>
</tr>
<tr>
......@@ -216,24 +215,25 @@ class MyWorkflow (Workflow):
<td>-</td>
<td>false</td>
<td>None</td>
<td>This is the default value of our parameter.</td>
<td>The default parameter value. It's type is depending on the parameter type.</td>
</tr>
<tr>
<td>type</td>
<td> * </td>
<td>str</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>
<td>The parameter type. The value provided by the final user will be casted and checked against this type.
All built-in Python types are available "int", "str", "float", "bool", "date", ... To create customized types,
refere to the <a href="./jflow-type.html">Add a data type</a> documentation.</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>
<td>[]</td>
<td>A list of the allowed values.</td>
</tr>
<tr>
......@@ -249,7 +249,7 @@ class MyWorkflow (Workflow):
<td>string</td>
<td>false</td>
<td>None</td>
<td>The parameter command line flag (default is <em>"--name"</em>).</td>
<td>The command line flag (default is <em>"--name"</em>).</td>
</tr>
<tr>
......@@ -257,7 +257,7 @@ class MyWorkflow (Workflow):
<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>
<td>The value is used to group a list of parameters in sections. The group is used in both command line and GUI.</td>
</tr>
<tr>
......@@ -265,7 +265,7 @@ class MyWorkflow (Workflow):
<td>string</td>
<td>false</td>
<td>None</td>
<td>The display name of the parameter.</td>
<td>The parameter name that should be displayed on the final form.</td>
</tr>
<tr>
......@@ -273,7 +273,8 @@ class MyWorkflow (Workflow):
<td>string</td>
<td>false</td>
<td>None</td>
<td>This parameter is a subparameter of add_to.</td>
<td>If this parameter is part of a multiple parameter, <code>add_to</code> allows to define to which "parent" parameter it should be
linked to.</td>
</tr>
</tbody>
......@@ -282,31 +283,17 @@ class MyWorkflow (Workflow):
<h3>add_parameter_list()</h3>
<p>The <code>add_parameter_list()</code> method has the exact same definition as <code>add_parameter()</code>, the only difference is that it
adds a container of parameters insteaed of a single paremeter element</p>
<div>
<pre class="pre-hl "><code class="python">def define_parameters(self, function="process"):
self.add_parameter_list("sequencers",
"The sequencer type.",
choices = ["HiSeq2000", "ILLUMINA","SLX","SOLEXA","454","UNKNOWN"],
default=["HiSeq2000"])
[ ... ]
def process(self) :
for sequencer in self.sequencers :
# do something
</code></pre>
</div>
<p>The <code>add_parameter_list()</code> method takes the same arguments as <code>add_parameter()</code>. However, adding this parameter,
the final user will be allowed to enter multiple values for this parameter and the object attribut <code>self.parameter_name</code> will be
settled as a Python list.</p>
</div>
<div id="input_parameters" class="subgroup">
<h2>Input parameters</h2>
<h2>Inputs</h2>
<h3>add_input_file() method</h3>
<h3>add_input_file()</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>
......
......@@ -149,10 +149,10 @@
<thead>
<tr>
<th>Name</th>
<th>type</th>
<th>required</th>
<th>default</th>
<th>description</th>
<th>Type</th>
<th>Required</th>
<th>Default value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
......@@ -197,7 +197,7 @@
<thead>
<tr>
<th>Event Type</th>
<th>description</th>
<th>Description</th>
</tr>
</thead>
<tbody>
......@@ -238,10 +238,10 @@
<thead>
<tr>
<th>Name</th>
<th>type</th>
<th>required</th>
<th>default</th>
<th>description</th>
<th>Type</th>
<th>Required</th>
<th>Default value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
......@@ -286,7 +286,7 @@
<thead>
<tr>
<th>Event Type</th>
<th>description</th>
<th>Description</th>
</tr>
</thead>
<tbody>
......@@ -328,10 +328,10 @@
<thead>
<tr>
<th>Name</th>
<th>type</th>
<th>required</th>
<th>default</th>
<th>description</th>
<th>Type</th>
<th>Required</th>
<th>Default value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
......@@ -424,7 +424,7 @@
<thead>
<tr>
<th>Event Type</th>
<th>description</th>
<th>Description</th>
</tr>
</thead>
<tbody>
......@@ -476,10 +476,10 @@
<thead>
<tr>
<th>Name</th>
<th>type</th>
<th>required</th>
<th>default</th>
<th>description</th>
<th>Type</th>
<th>Required</th>
<th>Default value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
......@@ -573,10 +573,10 @@
<thead>
<tr>
<th>Name</th>
<th>type</th>
<th>required</th>
<th>default</th>
<th>description</th>
<th>Type</th>
<th>Required</th>
<th>Default value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
......
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