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
9033d508
Commit
9033d508
authored
Feb 25, 2015
by
Jerome Mariette
Browse files
start workflow socs correction
parent
c84021d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/jflow-core-workflow.html
View file @
9033d508
...
...
@@ -69,7 +69,7 @@
<nav
class=
"col-xs-3 bs-docs-sidebar"
>
<ul
id=
"sidebar"
class=
"nav nav-stacked fixed"
>
<li><a
href=
"#workflow-architecture"
class=
"active"
>
Where to add a new workflow
</a></li>
<li><a
href=
"#workflow"
>
Workflow
definition
</a></li>
<li><a
href=
"#workflow"
>
The
Workflow
class
</a></li>
<li><a
href=
"#define_parameters"
>
Define parameters
</a>
<ul
class=
"nav nav-stacked"
>
<li><a
href=
"#simple_parameters"
>
Simple parameters
</a></li>
...
...
@@ -86,13 +86,12 @@
<div
class=
"col-xs-12 col-sm-9"
>
<section
id=
"workflow-architecture"
class=
"group"
>
<h1
class=
"page-header"
>
Where to add a new workflow
</h1>
<p>
The new wokflow must be added as a new python package in the
<code>
workflows
</code>
package. The definition of
the workflows must be written in
<code><a
href=
"#workflow"
>
__init__.py
</a></code>
.
</p>
<p>
User can optionaly add :
</p>
<p>
New wokflow must be added as a new python package in the
<code>
workflows
</code>
package. The implementation of
a workflows must be written in the package
<code>
__init__.py
</code>
file. The developper can also create:
</p>
<ul>
<li><code>
<a
href=
"./jflow-core-component.html"
>
components
</
a></
code>
package
to define
specific components
to this new workflow
</li>
<li><code>
lib
</code>
package to
define
specific libraries
</li>
<li><code>
bin
</code>
a
folder with binaries used in the workflow.
</li>
<li>
a
<code>
components
</code>
package
, where all the workflow
specific components
can be stored,
</li>
<li>
a
<code>
lib
</code>
package to
import
specific libraries
within its workflow,
</li>
<li>
a
<code>
bin
</code>
folder with
the
binaries used in the workflow.
</li>
</ul>
<pre
class=
"pre-hl "
><code
class=
"text"
>
jflow/
...
...
@@ -100,11 +99,11 @@
├── docs/
├── src/
├── workflows/
│ ├── my
W
orkflow
Name
/ ** workflow package
to add
**
│ │ ├── components/
** workflow
specific components **
│ │ ├── lib/
** workflow
specific libraries **
│ │ ├── bin/
** workflow
specific binairies **
│ │ └── __init__.py
** the workflow
code
**
│ ├── my
w
orkflow/
**
the new
workflow package **
│ │ ├── components/
**
specific components **
│ │ ├── lib/
**
specific libraries **
│ │ ├── bin/
**
specific binairies **
│ │ └── __init__.py ** the workflow
implementation
**
│ ├── components/
│ ├── extparsers/
│ ├── __init__.py
...
...
@@ -115,64 +114,49 @@
</section>
<section
id=
"workflow"
class=
"group"
>
<h1
class=
"page-header"
>
The
<i>
Workflow
</i>
definition
</h1>
<p>
The new
workflow is a class defined in
<code>
__init__.py
</code>
. In order to add workflow
you must
:
</p>
<h1
class=
"page-header"
>
The Workflow
class
</h1>
<p>
In jflow, a
workflow is a class defined in
the
<code>
__init__.py
</code>
file
. In order to add
a new
workflow
, the developper has to
:
</p>
<ul>
<li>
I
nherit from the
<code>
Workflow
</code>
class
</li>
<li>
Implement
the
<code>
get_description()
</code>
function to define the workflow description
</li>
<li>
Implement
the
<code>
define_parameters()
</code>
function
to add the workflow inputs and parameters
</li>
<li>
Implement
the
<code>
process()
</code>
function
by adding components and
provide the component
arguments
</li>
<li>
L
ink components inputs and outputs
(typing test is done)
</li>
<li>
implement a class i
nherit
ing
from the
<code>
Workflow
</code>
class
,
</li>
<li>
overload
the
<code>
get_description()
</code>
method to provide the final user a description of the workflow,
</li>
<li>
overload
the
<code>
define_parameters()
</code>
method
to add the workflow inputs and parameters
,
</li>
<li>
overload
the
<code>
process()
</code>
method
by adding components and
setting their
arguments
,
</li>
<li>
l
ink
the
components inputs and outputs
.
</li>
</ul>
<p>
The class skeleton is given by
</p>
<div>
<pre
class=
"pre-hl "
><code
class=
"python"
>
from jflow.workflow import Workflow
from jflow.parameter import InputFileList, InputFile
class
Alignment
(Workflow):
class
MyWorkflow
(Workflow):
def get_description(self):
return "
Align reads against a reference genome
"
return "
a description
"
def define_parameters(self, function="process"):
self.add_input_file_list("read_1", "Which read1 should be used",
file_format="fastq", required=True)
self.add_input_file_list("read_2", "Which read2 should be used",
file_format="fastq")
self.add_input_file("reference_genome", "Which genome should the read being align on",
file_format="fasta", required=True, )
# define the parameters
def process(self):
"""
Run the workflow
"""
# index the reference genome
bwaindex = self.add_component("BWAIndex", [self.refernce_genome])
# align reads against indexed genome
bwa = self.add_component("BWA", [bwaindex.databank, self.read_1, self.read_2])
</code></pre>
# add and link the components
</code></pre>
</div>
<p>
The
<code>
get_name()
</code>
method can be overwritted to change the command name of the workflows. By default
the workflows will be called as the class name in lower case.
</p>
</section>
<section
id=
"define_parameters"
class=
"group"
>
<h1
class=
"page-header"
>
Define parameters
</h1>
<p>
The define
parameters
function
is used to add workflow inputs and outputs. Several methods are available to add different
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
.
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>
.
</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.
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.
</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>
<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=
"simple_parameters"
class=
"subgroup"
>
<h2>
Simple parameters
</h2>
...
...
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