Maintenance - Mise à jour mensuelle Lundi 6 Avril 2020 entre 7h00 et 9h00

Commit b7bf85c2 authored by Penom Nom's avatar Penom Nom

update doc. remove add_input_directory from component

parent 8a4761c6
......@@ -481,135 +481,6 @@ class MyComponent (Analysis):
<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>
<h3>add_input_directory()</h3>
<p>
The add input directory allow the user to select a list of files inside a specific directory. The created parameter has a method <code>get_files()</code>
which must then be used to retrieve the files. By default, the <code>get_files()</code> method will retrieve all files of the given directory.
</p>
<h4>Example</h4>
<p>
In the following example, the <code>add_input_directory()</code> method is used to parse a CASAVA directory.
</p>
<div>
<pre class="pre-hl "><code class="python">self.add_input_directory("casava_directory",
"Path to the CASAVA directory to use", required=True,
get_files_fn=get_files_from_casava, group="Sample description")
# to retrieve the files
self.casava_directory.get_files( *args)</code></pre>
</div>
<h4>Options</h4>
<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">
<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>string</td>
<td>true</td>
<td>None</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>
<td>help</td>
<td>string</td>
<td>true</td>
<td>None</td>
<td>The parameter help message.</td>
</tr>
<tr>
<td>default</td>
<td>string</td>
<td>false</td>
<td>None</td>
<td>The default path value.</td>
</tr>
<tr>
<td>get_files_fn</td>
<td>function</td>
<td>false</td>
<td>-</td>
<td>
get_files_fn will be the method called when executing <code>param.get_files()</code>. All argument from get_files()
will be used as arguments in get_files_fn
</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 command line flag (if the value is None, the flag will be <code>--name</code>).</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>
</div>
<div id="output_parameters" class="subgroup">
......
......@@ -82,8 +82,6 @@
</ul>
</li>
<li><a href="#process">NG6Workflow.process()</a></li>
<li><a href="#add_component">NG6Workflow.add_component()</a></li>
<li><a href="#get_resource">NG6Workflow.get_ressource()</a></li>
</ul>
</nav>
......@@ -991,40 +989,29 @@ self.add_exclution_rule("fasta_file", "fastq")</code></pre>
<p>The <code>process()</code> method is in charge of building the workflow by adding analyses and components (using the method <code>add_component()</code>) and
linking their inputs and their outputs. A analaysis and a component are classes representing a workflow step. See the
<a href="./core-component.html">analyses</a> documentation for more information.</p>
<h2>Example</h2>
<div>
<pre class="pre-hl "><code class="python">def process(self):
# index the reference genome
bwaindex = self.add_component("BWAIndex", [self.reference_genome])
# align reads against the indexed genome
bwamem = self.add_component("BWAmem", [bwaindex.databank, self.reads])</code></pre>
</div>
<h2>Options</h2>
<p>No options</p>
</section>
<section id="add_component" class="group">
<h1 class="page-header">NG6Workflow.add_component()</h1>
<h2>add_component()</h2>
<p>The <code>add_component()</code> method add an analysis or a component to the workflow by building respectively a <code>ng6.analysis.Analysis</code>
or a <code>jflow.component.Component</code> object and returning it. All attributs defined within this object, such as the outputs,
are then available from the workflow and can be used as inputs of other components.</p>
<h2>Example</h2>
<h3>Example</h3>
<p>In the following example, the first component <code>BWAIndex</code> is built and returned in the <code>bwaindex</code> object.
The output <code>bwaindex.databank</code> is accessible as an object attribut and can be used as input of the <code>BWAmem</code>
component.</p>
<div>
<pre class="pre-hl "><code class="python"># index the reference genome
bwaindex = self.add_component("BWAIndex", [self.reference_genome])
# align reads against the indexed genome
bwamem = self.add_component("BWAmem", [bwaindex.databank, self.reads])</code></pre>
<div>
<pre class="pre-hl "><code class="python">def process(self):
# index the reference genome
bwaindex = self.add_component("BWAIndex", [self.reference_genome])
# align reads against the indexed genome
bwamem = self.add_component("BWAmem", [bwaindex.databank, self.reads])</code></pre>
</div>
<h2>Options</h2>
<h3>Options</h3>
<p>There is one positional argument : component_name. All other options are keyword options.</p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
......@@ -1071,14 +1058,7 @@ bwamem = self.add_component("BWAmem", [bwaindex.databank, self.reads])</code></p
</table>
</div>
</section>
<section id="get_resource" class="group">
<h1 class="page-header">NG6Workflow.get_resource()</h1>
<h2>get_resource()</h2>
<p>The method <code>get_resource()</code>, giving a specific resource, returns the defined value within the <code>resource</code>
section of the jflow configuration file.</p>
<h3>Options</h3>
......
......@@ -68,18 +68,6 @@ class Component(object):
outputs[os.path.basename(attribute_value)] = attribute_value
return outputs
def add_input_directory(self, name, help, default=None, required=False, flag=None,
group="default",
display_name=None, cmd_format="", argpos=-1):
new_param = InputDirectory(name, help, flag=flag, default=default, required=required, group=group,
display_name=display_name, cmd_format=cmd_format, argpos=argpos)
# store where the parameter is coming from
new_param.linkTrace_nameid = self.get_nameid()
if issubclass( default.__class__, LinkTraceback ):
new_param.parent_linkTrace_nameid = [default.linkTrace_nameid]
# add it to the class itself
self.params_order.append(name)
self.__setattr__(name, new_param)
def add_input_file(self, name, help, file_format="any", default=None, type="inputfile",
required=False, flag=None, group="default", display_name=None,
......
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