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

Commit e9b55e34 authored by Jerome Mariette's avatar Jerome Mariette

No commit message

No commit message
parent 09d0f4d1
......@@ -50,7 +50,7 @@
<li><a href="./core-analysis.html">Add an analysis</a></li>
<li><a href="./type.html">Add a data type</a></li>
<li><a href="./format.html">Add a file format</a></li>
<li><a href="./advanced-configuration.html">Advanced configuration</a></li>
<li class="active"><a href="./advanced-configuration.html">Advanced configuration</a></li>
</ul>
</li>
<li><a target="_blank" href="https://mulcyber.toulouse.inra.fr/plugins/mediawiki/wiki/ng6/index.php/Accueil">Sources</a></li>
......
......@@ -47,7 +47,7 @@
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="./core-workflow.html">Add a workflow</a></li>
<li><a href="./core-analysis.html">Add an analysis</a></li>
<li class="active"><a href="./core-analysis.html">Add an analysis</a></li>
<li><a href="./type.html">Add a data type</a></li>
<li><a href="./format.html">Add a file format</a></li>
<li><a href="./advanced-configuration.html">Advanced configuration</a></li>
......
......@@ -46,7 +46,7 @@
<li class="dropdown active">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="./core-workflow.html">Add a workflow</a></li>
<li class="active"><a href="./core-workflow.html">Add a workflow</a></li>
<li><a href="./core-analysis.html">Add an analysis</a></li>
<li><a href="./type.html">Add a data type</a></li>
<li><a href="./format.html">Add a file format</a></li>
......
......@@ -49,7 +49,7 @@
<li><a href="./core-workflow.html">Add a workflow</a></li>
<li><a href="./core-analysis.html">Add an analysis</a></li>
<li><a href="./type.html">Add a data type</a></li>
<li><a href="./format.html">Add a file format</a></li>
<li class="active"><a href="./format.html">Add a file format</a></li>
<li><a href="./advanced-configuration.html">Advanced configuration</a></li>
</ul>
</li>
......@@ -62,9 +62,24 @@
<div class="container">
<h1>Where to add a new format</h1>
<p>In the <code>workflows/</code> directory, ng6 provides a <code>formats.py</code> file where new formats can be added.</p>
<pre class="pre-hl "><code class="ini">ng6/
<div class="row">
<!--Nav Bar -->
<nav class="col-xs-3 bs-docs-sidebar">
<ul id="sidebar" class="nav nav-stacked fixed">
<li><a href="#where" class="active">Where to add a new format</a></li>
<li><a href="#how" >How to add a new format</a></li>
<li><a href="#howuse" >How to use a new format</a></li>
</ul>
</nav>
<div class="col-xs-12 col-sm-9">
<section id="where" class="group">
<h1>Where to add a new format</h1>
<p>In the <code>workflows/</code> directory, ng6 provides a <code>formats.py</code> file where new formats can be added.</p>
<pre class="pre-hl "><code class="ini">ng6/
├── bin/
├── docs/
├── src/
......@@ -77,16 +92,20 @@
├── applications.properties
└── README</code></pre>
<h1>How to add a new format</h1>
<p>In ng6 a format is represented by a function named by the desired format name. The function should take only
one argument, whose value is the file path given by the user. The function is in charge of opening and checking the
content of the file. If an error occurres or if the value does not meet the expected criteria, a
<code>jflow.InvalidFormatError</code> should be raised with the suitable error message. This message will
be used by ng6 to inform the final user of the error.</p>
<p>In the following example, the <code>fasta</code> function checks if the 10 first lines of the input file are in
a fasta format:</p>
</section>
<section id="how" class="group">
<pre class="pre-hl "><code class="python">def fasta(ifile):
<h1>How to add a new format</h1>
<p>In ng6 a format is represented by a function named by the desired format name. The function should take only
one argument, whose value is the file path given by the user. The function is in charge of opening and checking the
content of the file. If an error occurres or if the value does not meet the expected criteria, a
<code>jflow.InvalidFormatError</code> should be raised with the suitable error message. This message will
be used by ng6 to inform the final user of the error.</p>
<p>In the following example, the <code>fasta</code> function checks if the 10 first lines of the input file are in
a fasta format:</p>
<pre class="pre-hl "><code class="python">def fasta(ifile):
try:
reader = seqio.FastaReader(ifile, wholefile=True)
nb_seq = 0
......@@ -96,9 +115,14 @@
if nb_seq == 10: break
except:
raise jflow.InvalidFormatError("The provided file '" + ifile + "' is not a fasta file!")</code></pre>
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
Jflow provides <code>jflow.seqio</code> and <code>jflow.featureio</code> libraries where several file formats handler are available.
<div class="alert alert-info" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
Jflow provides <code>jflow.seqio</code> and <code>jflow.featureio</code> libraries where several file formats handler are available.
</div>
</section>
<section id="howuse" class="group">
<h1>How to use a new format</h1>
......@@ -109,7 +133,10 @@
def define_parameters(self, function="process"):
self.add_input_file("reference_genome", "Which genome should the read be align on", file_format="fasta", required=True)
[...]</code></pre>
</section>
</div>
</div>
<hr>
<footer>
<div class="container" style="text-align: center;">
......
......@@ -48,7 +48,7 @@
<ul class="dropdown-menu" role="menu">
<li><a href="./core-workflow.html">Add a workflow</a></li>
<li><a href="./core-analysis.html">Add an analysis</a></li>
<li><a href="./type.html">Add a data type</a></li>
<li class="active"><a href="./type.html">Add a data type</a></li>
<li><a href="./format.html">Add a file format</a></li>
<li><a href="./advanced-configuration.html">Advanced configuration</a></li>
</ul>
......@@ -62,9 +62,24 @@
<div class="container">
<h1>Where to add a new type</h1>
<p>In the <code>workflows/</code> directory, ng6 provides a <code>types.py</code> file where new types can be added.</p>
<pre class="pre-hl"><code class="ini">ng6/
<div class="row">
<!--Nav Bar -->
<nav class="col-xs-3 bs-docs-sidebar">
<ul id="sidebar" class="nav nav-stacked fixed">
<li><a href="#where" class="active">Where to add a new type</a></li>
<li><a href="#how" >How to add a new type</a></li>
<li><a href="#howuse" >How to use a new type</a></li>
</ul>
</nav>
<div class="col-xs-12 col-sm-9">
<section id="where" class="group">
<h1>Where to add a new type</h1>
<p>In the <code>workflows/</code> directory, ng6 provides a <code>types.py</code> file where new types can be added.</p>
<pre class="pre-hl"><code class="ini">ng6/
├── bin/
├── docs/
├── src/
......@@ -77,14 +92,18 @@
├── applications.properties
└── README</code></pre>
<h1>How to add a new type</h1>
<p>In ng6 a type is represented by a function named by the desired type name. The function should take only
one argument, whose value is given by the user. The function is in charge to check and/or modify
the given value. If an error occurred or if the value does not meet the expected criteria, an
<code>argparse.ArgumentTypeError</code> should be raised with the suitable error message. This message will
be used by ng6 to inform the final user of the error.</p>
<p>In the following example, the <code>intBetween1and100</code> function checks if the input value is in between
1 and 100:</p>
</section>
<section id="how" class="group">
<h1>How to add a new type</h1>
<p>In ng6 a type is represented by a function named by the desired type name. The function should take only
one argument, whose value is given by the user. The function is in charge to check and/or modify
the given value. If an error occurred or if the value does not meet the expected criteria, an
<code>argparse.ArgumentTypeError</code> should be raised with the suitable error message. This message will
be used by ng6 to inform the final user of the error.</p>
<p>In the following example, the <code>intBetween1and100</code> function checks if the input value is in between
1 and 100:</p>
<pre class="pre-hl "><code class="python">def intBetween1and100(myint):
# the input argument type is allways a string
......@@ -97,17 +116,23 @@
else:
raise argparse.ArgumentTypeError("'"+str(myint)+"' is not between 1 and 100!")</code></pre>
<h1>How to use a new type</h1>
<p>The new created type can then be used in both <code>add_parameter</code> and <code>add_parameter_list</code> of
classes <code>jflow.workflow.Workflow</code>, <code>ng6.ng6workflow.NG6Workflow</code>,
<code>ng6.ng6workflow.CASAVANG6Workflow</code>, <code>ng6.analysis.Analysis</code> and <code>jflow.component.Component</code> as following:</p>
</section>
<section id="howuse" class="group">
<pre class="pre-hl "><code class="python">[...]
<h1>How to use a new type</h1>
<p>The new created type can then be used in both <code>add_parameter</code> and <code>add_parameter_list</code> of
classes <code>jflow.workflow.Workflow</code>, <code>ng6.ng6workflow.NG6Workflow</code>,
<code>ng6.ng6workflow.CASAVANG6Workflow</code>, <code>ng6.analysis.Analysis</code> and <code>jflow.component.Component</code> as following:</p>
<pre class="pre-hl "><code class="python">[...]
def define_parameters(self, function="process"):
self.add_parameter("my_param", "A value in between 1 and 100", type="intBetween1and100")
[...]</code></pre>
</section>
</div>
</div>
<hr>
<footer>
<div class="container" style="text-align: center;">
......
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