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

Commit f73efd5a authored by Jerome Mariette's avatar Jerome Mariette
Browse files

add_output_file_list ok

parent 765e700b
......@@ -285,15 +285,6 @@ class MyComponent (Component):
<td>The parameter name that should be displayed on the final form.</td>
</tr>
<tr>
<td>add_to</td>
<td>string</td>
<td>false</td>
<td>None</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>
<tr>
<td>cmd_format</td>
<td>string</td>
......@@ -323,14 +314,24 @@ class MyComponent (Component):
<div id="input_parameters" class="subgroup">
<h2>Inputs</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>
<p>Just like for parameters, inputs can be added to handle a single file or a list of files. Thus, the <code>add__input_file()</code> method can be used to force
the component to take one and only one file, where the <code>add__input_file_list()</code> method allows the component to take as many files as possible.</p>
<h3>add_input_file()</h3>
<h4>Example</h4>
<p>
In the following example, an input named <code>reads</code>
is added to the workflow. The provided file is required and should be in fastq format. No file size limitation is specified.
</p>
<div>
<pre class="pre-hl "><code class="python">self.add_input_file_list("reads",
"Which read files should be used",
file_format="fastq",
required=True)</code></pre>
</div>
<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>
<p>There are two positional argument : <code>name</code> and <code>help</code>. All other options are keyword options. </p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
......@@ -349,7 +350,8 @@ class MyComponent (Component):
<td>string</td>
<td>true</td>
<td>None</td>
<td>The name of the parameter</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>
......@@ -357,7 +359,7 @@ class MyComponent (Component):
<td>string</td>
<td>true</td>
<td>None</td>
<td>The help message prompted to the user.</td>
<td>The parameter help message.</td>
</tr>
<tr>
......@@ -365,7 +367,7 @@ class MyComponent (Component):
<td>string</td>
<td>false</td>
<td>None</td>
<td>The path to the input file</td>
<td>The default path value.</td>
</tr>
<tr>
......@@ -373,7 +375,8 @@ class MyComponent (Component):
<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>
<td>The file format is checked before running the workflow. To create customized format,
refere to the <a href="./jflow-format.html">Add a file format</a> documentation.</td>
</tr>
<tr>
......@@ -381,7 +384,12 @@ class MyComponent (Component):
<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>
<td>The type can be "inputfile", "localfile", "urlfile" or "browsefile". An "inputfile" allows the
final user to provide a "localfile" or an "urlfile" or a "browsefile". A "localfile" restricts the final
user to provide a path to a file visible by jflow. An "urlfile" only permits the final user to give an
URL as input, where a "browsefile" force the final user to upload a file from its own computer. This last
option is only available from the GUI and is considered as a "localfile" from the command line. All the
uploading process is handled by jflow.</td>
</tr>
<tr>
......@@ -397,7 +405,7 @@ class MyComponent (Component):
<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 (if the value is None, the flag will be <code>--name</code>).</td>
</tr>
<tr>
......@@ -405,7 +413,7 @@ class MyComponent (Component):
<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>
......@@ -413,24 +421,23 @@ class MyComponent (Component):
<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>
<td>The parameter name that should be displayed on the final form.</td>
</tr>
<tr>
<td>cmd_format</td>
<td>string</td>
<td>false</td>
<td>""</td>
<td>The command format is the parameter skeleton required to build the final command line.</td>
</tr>
<tr>
<td>argpos</td>
<td>integer</td>
<td>false</td>
<td>-1</td>
<td>The parameter position in the command line.</td>
</tr>
</tbody>
</table>
......@@ -438,8 +445,10 @@ class MyComponent (Component):
<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>
<p>This method takes the same arguments as <code>add_input_file()</code>. However, adding this parameter,
the component can take a list file files and the object attribut <code>self.parameter_name</code> will be
settled as a Python list.</p>
</div>
......@@ -447,10 +456,21 @@ class MyComponent (Component):
<div id="output_parameters" class="subgroup">
<h2>Outputs</h2>
<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>
<p>Just like for inputs, outputs can be added to handle a single file or a list of files. Thus, the <code>add__input_file()</code> method can be used to force
the component to produce one and only one file, where the <code>add__input_file_list()</code> method allows the component to produce as many files as possible.</p>
<h3>add_output_file()</h3>
<h4>Example</h4>
<p>
In the following example, an output named <code>databank</code>
is defined. The process have to produce the file, otherwise the workflow will failed. The file written on the disk will be named
with the same name as the one stored in the variable <code>input_fasta</code>.
</p>
<div>
<pre class="pre-hl "><code class="python">self.add_output_file("databank",
"The indexed databank",
filename=os.path.basename(input_fasta))</code></pre>
</div>
<h4>Options</h4>
<p>The two positional arguments <code>name</code> and <code>help</code> are always present </p>
......@@ -472,7 +492,8 @@ class MyComponent (Component):
<td>string</td>
<td>true</td>
<td>None</td>
<td>The name of the parameter</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>
......@@ -480,7 +501,7 @@ class MyComponent (Component):
<td>string</td>
<td>true</td>
<td>None</td>
<td>The help message prompted to the user.</td>
<td>The parameter help message.</td>
</tr>
<tr>
......@@ -496,7 +517,8 @@ class MyComponent (Component):
<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>
<td>The file format is checked before running the workflow. To create customized format,
refere to the <a href="./jflow-format.html">Add a file format</a> documentation.</td>
</tr>
<tr>
......@@ -504,7 +526,7 @@ class MyComponent (Component):
<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>
......@@ -512,30 +534,43 @@ class MyComponent (Component):
<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>
<td>The parameter name that should be displayed on the final form.</td>
</tr>
<tr>
<td>cmd_format</td>
<td>string</td>
<td>false</td>
<td>""</td>
<td>The command format is the parameter skeleton required to build the final command line.</td>
</tr>
<tr>
<td>argpos</td>
<td>integer</td>
<td>false</td>
<td>-1</td>
<td>The parameter position in the command line.</td>
</tr>
</tbody>
</table>
</div>
<h3>add_output_file_list()</h3>
<h4>Example</h4>
<p>
In the following example, an output named <code>sam_files</code>
is defined. The files written on the disk will all have the pattern <code>{basename_woext}.sam</code> defined by the
<code>self.reads</code> variable. The resulting list will gathers files with the same basename as <code>self.reads</code> but
with an extension substituted by ".sam".
</p>
<div>
<pre class="pre-hl "><code class="python">self.add_output_file_list("sam_files",
"The BWA output file",
pattern='{basename_woext}.sam',
items=self.reads)</code></pre>
</div>
<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>
......@@ -556,7 +591,8 @@ class MyComponent (Component):
<td>string</td>
<td>true</td>
<td>None</td>
<td>The name of the parameter</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>
......@@ -564,74 +600,75 @@ class MyComponent (Component):
<td>string</td>
<td>true</td>
<td>None</td>
<td>The help message prompted to the user.</td>
<td>The parameter help message.</td>
</tr>
<tr>
<td>items</td>
<td>liste</td>
<td>list</td>
<td>false</td>
<td>None</td>
<td>This is a list of string describing the names or paths of output files..</td>
<td>A list of element through which <code>add_output_file_list()</code> should iterate to produce the output
list.</td>
</tr>
<tr>
<td>pattern</td>
<td>string</td>
<td>false</td>
<td>'{basename_woext}.out'</td>
<td>The pattern represents the part of the paths in <code>items</code> option that will be considered to build the output file list.
The pattern accept special string :
<td>The pattern is used to produce the output list. <code>add_output_file_list()</code> maps the pattern on each <code>items</code>
to produce the final value.
The pattern can accepts these predefined values:
<ul>
<li>`{fullpath}`, `{FULL}` -- Full input file path.</li>
<li>`{basename}`, `{BASE}` -- Base input file name.</li>
<li>`{fullpath_woext}`, `{FULLWE}` -- Full input file path without extension</li>
<li>`{basename_woext}`, `{BASEWE}` -- Base input file name without extension</li>
<li><code>{fullpath}</code>, <code>{FULL}</code> for full input file path,</li>
<li><code>{basename}</code>, <code>{BASE}</code> for base input file name,</li>
<li><code>{fullpath_woext}</code>, <code>{FULLWE}</code> for full input file path without extension,</li>
<li><code>{basename_woext}</code>, <code>{BASEWE}</code> for base input file name without extension.</li>
</ul>
</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>
<tr>
<td>file_format</td>
<td>string</td>
<td>false</td>
<td>"any"</td>
<td>The file format is checked before running the workflow. To create customized format,
refere to the <a href="./jflow-format.html">Add a file format</a> documentation.</td>
</tr>
<tr>
<td>group</td>
<td>string</td>
<td>false</td>
<td>"default"</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>
<td>display_name</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The parameter name that should be displayed on the final form.</td>
</tr>
<tr>
<td>cmd_format</td>
<td>string</td>
<td>false</td>
<td>""</td>
<td>The command format is the parameter skeleton required to build the final command line.</td>
</tr>
<tr>
<td>argpos</td>
<td>integer</td>
<td>false</td>
<td>-1</td>
<td>The parameter position in the command line.</td>
</tr>
</tbody>
</table>
</div>
......
......@@ -321,7 +321,7 @@ class MyWorkflow (Workflow):
<h4>Options</h4>
<p>There are two positional argument : name and help. All other options are keyword options. </p>
<p>There are two positional argument : <code>name</code> and <code>help</code>. All other options are keyword options. </p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
......
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