Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Maintenance - Mise à jour mensuelle Lundi 6 Février entre 7h00 et 9h00
Open sidebar
genotoul-bioinfo
jflow
Commits
5d4dbfeb
Commit
5d4dbfeb
authored
Feb 27, 2015
by
Jerome Mariette
Browse files
multi parameter ok
parent
e3221d3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/jflow-core-workflow.html
View file @
5d4dbfeb
...
...
@@ -171,11 +171,10 @@ class MyWorkflow (Workflow):
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>
<pre
class=
"pre-hl "
><code
class=
"python"
>
self.add_parameter("sequencer",
"The sequencer type.",
choices = ["HiSeq2000", "ILLUMINA","SLX","SOLEXA","454","UNKNOWN"],
default="HiSeq2000")
</code></pre>
</div>
<h4>
Options
</h4>
...
...
@@ -250,7 +249,7 @@ class MyWorkflow (Workflow):
<td>
string
</td>
<td>
false
</td>
<td>
None
</td>
<td>
The command line flag (if the value is None, the flag will be
<
em>
"
--name
"
</e
m
>
).
</td>
<td>
The command line flag (if the value is None, the flag will be
<
code>
--name
</
cod
e>
).
</td>
</tr>
<tr>
...
...
@@ -305,11 +304,10 @@ class MyWorkflow (Workflow):
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"
>
def define_parameters(self, function="process"):
self.add_input_file_list("reads",
"Which read files should be used",
file_format="fastq",
required=True)
</code></pre>
<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>
...
...
@@ -388,7 +386,7 @@ class MyWorkflow (Workflow):
<td>
string
</td>
<td>
false
</td>
<td>
None
</td>
<td>
The command line flag (if the value is None, the flag will be
<
em>
"
--name
"
</e
m
>
).
</td>
<td>
The command line flag (if the value is None, the flag will be
<
code>
--name
</
cod
e>
).
</td>
</tr>
<tr>
...
...
@@ -440,9 +438,19 @@ class MyWorkflow (Workflow):
<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>
<p>
Jflow offers, to the developper, the possibility to structure the input data by using the notion of multiple parameters. A multi
parameter is a collection of parameters linked together. Just like for parameters and inputs, it can be added to handle a single collection or a
list of collections. Thus, the
<code>
add_multiple_parameter()
</code>
method can be used to force the final user to provide one and only one
collection, where the
<code>
add_multiple_parameter_list()
</code>
method allows the final user to give as many collection he wants. To add a
parameter within the multiple parameter, it only requires to set the option
<code>
add_to
</code>
of any methods previously described.
The accessible object attribut
<code>
self.multi_parameter_name
</code>
is then a Python dictionary gathering all the values of the different
parameters under the format
<code>
{"sub_parameter1":value}
</code></p>
<h3>
add_multiple_parameter()
</h3>
<h4>
Example
</h4>
The following 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)
...
...
@@ -451,15 +459,9 @@ 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>
<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"
>
...
...
@@ -478,7 +480,9 @@ self.add_parameter("sequencer", "The sequencer type.", choices=["HiSeq2000",
<td>
string
</td>
<td>
true
</td>
<td>
None
</td>
<td>
The name of the parameter.
</td>
<td>
The name of the multi parameter. The parameter value is accessible
within the workflow object through the attribute named
<code>
self.multi_parameter_name
</code>
. And its sub parameters
using
<code>
self.multi_parameter_name["sub_parameter_name"]
</code>
.
</td>
</tr>
<tr>
...
...
@@ -486,7 +490,7 @@ self.add_parameter("sequencer", "The sequencer type.", choices=["HiSeq2000",
<td>
string
</td>
<td>
true
</td>
<td>
None
</td>
<td>
The help message
pronpted to the user
.
</td>
<td>
The
parameter
help message.
</td>
</tr>
<tr>
...
...
@@ -502,7 +506,8 @@ self.add_parameter("sequencer", "The sequencer type.", choices=["HiSeq2000",
<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>
). The sub parameters can be set as following
<code>
--name sub1=... sub2=...
</code></td>
</tr>
<tr>
...
...
@@ -510,7 +515,7 @@ self.add_parameter("sequencer", "The sequencer type.", choices=["HiSeq2000",
<td>
string
</td>
<td>
false
</td>
<td>
"default"
</td>
<td>
Th
is
is used to
re
group a list of parameters in th
e
command line and
the
GUI.
</td>
<td>
Th
e value
is used to group a list of parameters in
sections. The group is used in bo
th command line and GUI.
</td>
</tr>
<tr>
...
...
@@ -518,24 +523,35 @@ self.add_parameter("sequencer", "The sequencer type.", choices=["HiSeq2000",
<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>
</tbody>
</table>
</div>
<h3>
add_multiple_parameter_list()
</h3>
<p>
This method takes the same arguments as
<code>
add_multiple_parameter()
</code>
. However, adding this parameter,
the final user will be allowed to provide multiple collection and the object attribut
<code>
self.multi_parameter_name
</code>
will be
settled as a Python list of Python dictionary.
</p>
<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>
Exclusion rules
</h2>
<p>
An exclusion rules allows to set parameters as excluded from each other. T
he method
<code>
add_exclusion_rule()
</code>
is
used
.
</p>
<p>
Jflow offers the possibility to exclude some rules from each otehrs. To do so, t
he method
<code>
add_exclusion_rule()
</code>
is
available
.
</p>
<h3>
add_exclution_rule()
</h3>
<h4>
Example
</h4>
<p>
In the following example, the final user will not be allowed to provide both
<code>
fasta_file
</code>
and
<code>
fastq_file
</code>
parameters.
</p>
<div>
<pre
class=
"pre-hl "
><code
class=
"python"
>
self.add_input_file("fasta_file", "Path to the fasta file.", format="fasta")
self.add_input_file("fastq_file", "Path to the fastq file.", format="fastq")
self.add_exclution_rule("fasta_file", "fastq")
</code></pre>
</div>
<h4>
Options
</h4>
<p>
The method accept the following options
</p>
<div
class=
"table-responsive"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment