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

Commit e35922ca authored by Penom Nom's avatar Penom Nom

update documentation for quickstart

parent bb78b04a
This diff is collapsed.
{extends file='AnalysisTemplate.tpl'}
{block name=results_title} Reads and quality statistics {/block}
{block name=results}
<table class="table table-striped table-bordered dataTable analysis-result-table">
<thead>
<tr>
<th class="string-sort" >Sample</th>
<th class="string-sort" >Per base quality</th>
<th class="string-sort" >Per base sequence content</th>
</tr>
</thead>
{assign var="analyse_results_sorted" value=$analyse_results|@ksort}
<tbody>
{foreach from=$analyse_results_sorted key=sample item=sample_results}
<tr>
<td class="sample_name">{$sample|get_description:$descriptions}</td>
<td><a class="imglink" href="{$sample_results["pbqpng"].img}"> {$sample_results["pbqpng"].result} </a></td>
<td><a class="imglink" href="{$sample_results["pbspng"].img}"> {$sample_results["pbspng"].result} </a></td>
</tr>
{/foreach}
</tbody>
</table>
{/block}
{*
Copyright (C) 2009 INRA
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
{extends file='AnalysisTemplate.tpl'}
{block name=results_title} Filtering results {/block}
{block name=results}
<table class="table table-striped table-bordered dataTable analysis-result-table">
<thead>
<tr>
<th class="string-sort">Samples</th>
<th class="numeric-sort">Before filtering</th>
<th class="numeric-sort">After filtering</th>
<th class="numeric-sort">Filtered</th>
</tr>
</thead>
{assign var="analyse_results_sorted" value=$analyse_results|@ksort}
<tbody>
{foreach from=$analyse_results_sorted key=sample item=sample_results}
<tr>
<td>{$sample|get_description:$descriptions}</td>
<td>{$sample_results["default"].input|number_format:0:' ':' '}</td>
<td>{$sample_results["default"].output|number_format:0:' ':' '}</td>
<td>{($sample_results["default"].input-$sample_results["default"].output)|number_format:0:' ':' '}</td>
</tr>
{/foreach}
</tbody>
</table>
{/block}
{block name=download}{/block}
from ng6.ng6workflow import NG6Workflow
from workflows.pacbio_smrt.lib.pbseqio import BasH5Reader
class QuickStart(NG6Workflow):
def get_name(self):
return 'quickstart'
def get_description(self):
return "Quick start pipeline"
def define_parameters(self, function="process"):
self.add_parameter( "keep", "keep option for fastq_illumina_filter", default="N", choices=["N", "Y"])
def process(self):
illumina_filter = self.add_component("QIlluminaFilter", [self.get_all_reads()])
fastqc = self.add_component("QFastQC", [illumina_filter.fastq_files_filtered], parent = illumina_filter)
\ No newline at end of file
import subprocess
import os
import re
from weaver.function import ShellFunction
from jflow.abstraction import MultiMap
from ng6.analysis import Analysis
class QFastQC (Analysis):
def define_parameters(self, input_files):
self.add_input_file_list("input_files", "Fastq file", default=input_files, required=True)
self.add_output_file_list( "output_fastqc", "outputs", pattern='{basename_woext}_fastqc', items=input_files)
self.add_output_file_list( "stdouts", "stdout", pattern='{basename_woext}.stdout', items=input_files)
self.add_output_file_list( "stderrs", "stderr", pattern='{basename_woext}.stderr', items=input_files)
def get_version(self):
p = subprocess.Popen([self.get_exec_path("fastqc"), "--version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
return stdout.split()[1]
def define_analysis(self):
self.name = "QFastQC"
self.description = "Statistics on reads and their qualities"
self.software = "fastqc"
self.options = ""
def __parse_summary_file (self, summary_file):
per_base_quality = ""
per_base_sequence_content = ""
for line in open(summary_file, 'r').readlines():
parts = line.strip().split("\t")
if parts[1] == "Per base sequence quality": per_base_quality = parts[0]
if parts[1] == "Per base sequence content": per_base_sequence_content = parts[0]
return per_base_quality, per_base_sequence_content
def process(self):
fastqc = ShellFunction( self.get_exec_path("fastqc") + ' --extract --outdir ' + self.output_directory + ' $1 > $2 2>> $3 ', cmd_format='{EXE} {IN} {OUT}')
MultiMap(fastqc, inputs=[self.input_files], outputs=[self.stdouts, self.stderrs, self.output_fastqc])
def post_process(self):
for output_fastqc_dir in self.output_fastqc :
sample = re.sub( "_fastqc$", "", os.path.basename(output_fastqc_dir))
per_base_quality, per_base_sequence_content = self.__parse_summary_file (os.path.join( output_fastqc_dir, "summary.txt" ))
self._add_result_element(sample, "img", self._save_file(os.path.join(output_fastqc_dir, "Images", "per_base_quality.png"), sample + ".per_base_quality.png"), "pbqpng")
self._add_result_element(sample, "result", str(per_base_quality), "pbqpng")
self._add_result_element(sample, "img", self._save_file(os.path.join(output_fastqc_dir, "Images", "per_base_sequence_content.png"), sample + ".per_base_sequence_content.png"), "pbspng")
self._add_result_element(sample, "result", str(per_base_sequence_content), "pbspng")
\ No newline at end of file
#
# Copyright (C) 2012 INRA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import re, os
from subprocess import Popen, PIPE
from jflow.abstraction import MultiMap
from ng6.analysis import Analysis
from weaver.function import ShellFunction
class QIlluminaFilter (Analysis):
def define_parameters(self, input_fastqs, keep="N"):
self.add_parameter( "keep", "keep option for fastq_illumina_filter", default=keep, choices=["N", "Y"])
self.add_input_file_list( "input_fastqs", "Input fastq files", default=input_fastqs, required=True, file_format = 'fastq')
self.add_output_file_list( "fastq_files_filtered", "fastq_files_filtered", pattern='{basename}', items=self.input_fastqs, file_format = 'fastq')
self.add_output_file_list( "stdout", "stdout", pattern='{basename_woext}.stdout', items=self.input_fastqs)
def define_analysis(self):
self.name = "QIlluminaFilter"
self.description = "Filters FASTQ file generated by CASAVA 1.8"
self.software = "fastq_illumina_filter"
self.options = "--keep " + self.keep + " -v"
def get_version(self):
cmd = [self.get_exec_path("fastq_illumina_filter"), "-help"]
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate()
return stdout.split()[2][:-1]
def process(self):
if self.input_fastqs[0].endswith(".gz") :
fastq_illumina_filter = ShellFunction("gunzip -c $1 | " + self.get_exec_path("fastq_illumina_filter") + " -v --keep " + self.keep + " 2> $3 | gzip > $2", cmd_format='{EXE} {IN} {OUT}')
else :
fastq_illumina_filter = ShellFunction( self.get_exec_path("fastq_illumina_filter") + " --keep " + self.keep + " -v -o $2 > $3 $1", cmd_format='{EXE} {IN} {OUT}')
MultiMap(fastq_illumina_filter, inputs = self.input_fastqs, outputs = [self.fastq_files_filtered, self.stdout])
def post_process(self):
for file in self.stdout :
file_name = os.path.splitext(os.path.basename(file))[0]
input, output = self.__parse_stat_file(file)
self._add_result_element(file_name, "input", str(input))
self._add_result_element(file_name, "output", str(output))
def __parse_stat_file (self, stat_file):
input, output = 0, 0
for line in open(stat_file, "r").readlines():
line = line.strip()
input_reg = re.search("Input: (.*) reads", line)
output_reg = re.search("Output: (.*) reads \(.*\)", line)
if input_reg:
input = input_reg.group(1).replace(",", "")
if output_reg:
output = output_reg.group(1).replace(",", "")
return input, output
--date
08/01/2015
--data-nature
DNA
--sequencer
HiSeq 2000
--name
quickstart
--type
Unknown
--species
bovine
--description
Quickstart workflow
--project-name
Demo project
--sample
read1=workflows/quickstart/data/Demo_NoIndex_L001_R1_001.fastq.gz
read2=workflows/quickstart/data/Demo_NoIndex_L001_R2_001.fastq.gz
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