Commit ce861266 authored by Maxime Manno's avatar Maxime Manno 🍜
Browse files

Merge branch 'ontqc_updatestats' into 'master'

Ontqc updatestats

See merge request !26
parents 485bc0db 68d08772
......@@ -169,6 +169,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{foreach from=$rawdata_headers key=k item=head}
{assign var="headQ7" value=$head|cat:"_Q7"}
{assign var="headQ9" value=$head|cat:"_Q9"}
{assign var="count_longread" value=1}
{assign var="corresp_num" value=['1' => 'First', '2' => 'Second', '3' => 'Third', '4' => 'Fourth', '5' => 'Fifth']}
<tr>
{if ($head == 'mean_read_quality')}
<td><label>{$head|replace:'_':' '}</label></td>
......@@ -185,6 +187,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<td>{($rawdata.$head)|number_format:0:',':' '}</td>
<td>{($Q7.$headQ7)|number_format:0:',':' '} ({($Q7.$headQ7 / $rawdata.total_bases*100)|number_format:2:',':' '}%)</td>
<td>{($Q9.$headQ9)|number_format:0:',':' '} ({($Q9.$headQ9 / $rawdata.total_bases*100)|number_format:2:',':' '}%)</td>
{elseif ($head|strstr:"longread")}
{assign var="corresp" value=$head|replace:'longread':''}
<td><label>{$corresp_num[$corresp]} longest read</label></td>
<td>{($rawdata.$head)|number_format:0:',':' '}</td>
<td>{($Q7.$headQ7)|number_format:0:',':' '}</td>
<td>{($Q9.$headQ9)|number_format:0:',':' '}</td>
{else}
<td><label>{$head|replace:'_':' '}</label></td>
<td>{($rawdata.$head)|number_format:0:',':' '}</td>
......@@ -374,6 +382,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</li>
<li><strong>N50 read length</strong> :
50% of all bases come from reads longer than this value.
</li>
<li><strong>N90 read length</strong> :
90% of all bases come from reads longer than this value.
</li>
<li><strong>Mean read quality</strong> :
The mean quality (qscore ONT) for this Flow Cell.
......
......@@ -72,22 +72,40 @@ class Run_stats (Analysis):
if parts[0] == "total_bases": stats["total_bases"] = parts[1]
if parts[0] == "mean_read_length": stats["mean_read_length"] = parts[1]
if parts[0] == "N50_read_length": stats["N50_read_length"] = parts[1]
if parts[0] == "N90_read_length": stats["N90_read_length"] = parts[1]
if parts[0] == "mean_read_quality": stats["mean_read_quality"] = parts[1]
if parts[0] == "mean_yield_per_sec": stats["mean_yield_per_sec"] = parts[1]
if parts[0] == "longread1": stats["longread1"] = parts[1]
if parts[0] == "longread2": stats["longread2"] = parts[1]
if parts[0] == "longread3": stats["longread3"] = parts[1]
if parts[0] == "longread4": stats["longread4"] = parts[1]
if parts[0] == "longread5": stats["longread5"] = parts[1]
if parts[0] == "nb_reads_Q7": stats["nb_reads_Q7"] = parts[1]
if parts[0] == "total_bases_Q7": stats["total_bases_Q7"] = parts[1]
if parts[0] == "mean_read_length_Q7": stats["mean_read_length_Q7"] = parts[1]
if parts[0] == "N50_read_length_Q7": stats["N50_read_length_Q7"] = parts[1]
if parts[0] == "N90_read_length_Q7": stats["N90_read_length_Q7"] = parts[1]
if parts[0] == "mean_read_quality_Q7": stats["mean_read_quality_Q7"] = parts[1]
if parts[0] == "mean_yield_per_sec_Q7": stats["mean_yield_per_sec_Q7"] = parts[1]
if parts[0] == "longread1_Q7": stats["longread1_Q7"] = parts[1]
if parts[0] == "longread2_Q7": stats["longread2_Q7"] = parts[1]
if parts[0] == "longread3_Q7": stats["longread3_Q7"] = parts[1]
if parts[0] == "longread4_Q7": stats["longread4_Q7"] = parts[1]
if parts[0] == "longread5_Q7": stats["longread5_Q7"] = parts[1]
if parts[0] == "nb_reads_Q9": stats["nb_reads_Q9"] = parts[1]
if parts[0] == "total_bases_Q9": stats["total_bases_Q9"] = parts[1]
if parts[0] == "mean_read_length_Q9": stats["mean_read_length_Q9"] = parts[1]
if parts[0] == "N50_read_length_Q9": stats["N50_read_length_Q9"] = parts[1]
if parts[0] == "N90_read_length_Q9": stats["N90_read_length_Q9"] = parts[1]
if parts[0] == "mean_read_quality_Q9": stats["mean_read_quality_Q9"] = parts[1]
if parts[0] == "mean_yield_per_sec_Q9": stats["mean_yield_per_sec_Q9"] = parts[1]
if parts[0] == "longread1_Q9": stats["longread1_Q9"] = parts[1]
if parts[0] == "longread2_Q9": stats["longread2_Q9"] = parts[1]
if parts[0] == "longread3_Q9": stats["longread3_Q9"] = parts[1]
if parts[0] == "longread4_Q9": stats["longread4_Q9"] = parts[1]
if parts[0] == "longread5_Q9": stats["longread5_Q9"] = parts[1]
#print(stats)
return stats
......@@ -142,36 +160,57 @@ class Run_stats (Analysis):
group = 'rawdata'
metrics.append(group)
self._add_result_element("metrics", "headers", ','.join(["nb_reads", "total_bases", "mean_read_length","N50_read_length", "mean_read_quality", "mean_yield_per_sec"]), group)
self._add_result_element(sample, "nb_reads", str(stat_info["nb_reads"]),group),
self._add_result_element(sample, "total_bases", str(stat_info["total_bases"]),group),
self._add_result_element(sample, "mean_read_length", str(stat_info["mean_read_length"]),group),
self._add_result_element(sample, "N50_read_length", str(stat_info["N50_read_length"]),group),
self._add_result_element(sample, "mean_read_quality", str(stat_info["mean_read_quality"]),group),
self._add_result_element(sample, "mean_yield_per_sec", str(stat_info["mean_yield_per_sec"]),group),
metrics_names = ["nb_reads",
"total_bases",
"mean_read_length",
"N50_read_length",
"N90_read_length",
"mean_read_quality",
"mean_yield_per_sec",
"longread1",
"longread2",
"longread3",
"longread4",
"longread5"]
self._add_result_element("metrics", "headers", ','.join(metrics_names), group)
for item in metrics_names:
self._add_result_element(sample, item, str(stat_info[item]),group)
group = 'Q7'
metrics.append(group)
self._add_result_element("metrics", "headers", ','.join(["nb_reads_Q7", "total_bases_Q7", "mean_read_length_Q7","N50_read_length_Q7", "mean_read_quality_Q7", "mean_yield_per_sec_Q7"]), group)
self._add_result_element(sample, "nb_reads_Q7", str(stat_info["nb_reads_Q7"]),group),
self._add_result_element(sample, "total_bases_Q7", str(stat_info["total_bases_Q7"]),group),
self._add_result_element(sample, "mean_read_length_Q7", str(stat_info["mean_read_length_Q7"]),group),
self._add_result_element(sample, "N50_read_length_Q7", str(stat_info["N50_read_length_Q7"]),group),
self._add_result_element(sample, "mean_read_quality_Q7", str(stat_info["mean_read_quality_Q7"]),group),
self._add_result_element(sample, "mean_yield_per_sec_Q7", str(stat_info["mean_yield_per_sec_Q7"]),group),
metrics_names = ["nb_reads_Q7",
"total_bases_Q7",
"mean_read_length_Q7",
"N50_read_length_Q7",
"N90_read_length_Q7",
"mean_read_quality_Q7",
"mean_yield_per_sec_Q7",
"longread1_Q7",
"longread2_Q7",
"longread3_Q7",
"longread4_Q7",
"longread5_Q7"]
self._add_result_element("metrics", "headers", ','.join(metrics_names), group)
for item in metrics_names:
self._add_result_element(sample, item, str(stat_info[item]),group)
group = 'Q9'
metrics.append(group)
self._add_result_element("metrics", "headers", ','.join(["nb_reads_Q9", "total_bases_Q9", "mean_read_length_Q9","N50_read_length_Q9", "mean_read_quality_Q9", "mean_yield_per_sec_Q9"]), group)
self._add_result_element(sample, "nb_reads_Q9", str(stat_info["nb_reads_Q9"]),group),
self._add_result_element(sample, "total_bases_Q9", str(stat_info["total_bases_Q9"]),group),
self._add_result_element(sample, "mean_read_length_Q9", str(stat_info["mean_read_length_Q9"]),group),
self._add_result_element(sample, "N50_read_length_Q9", str(stat_info["N50_read_length_Q9"]),group),
self._add_result_element(sample, "mean_read_quality_Q9", str(stat_info["mean_read_quality_Q9"]),group),
self._add_result_element(sample, "mean_yield_per_sec_Q9", str(stat_info["mean_yield_per_sec_Q9"]),group),
metrics_names = ["nb_reads_Q9",
"total_bases_Q9",
"mean_read_length_Q9",
"N50_read_length_Q9",
"N90_read_length_Q9",
"mean_read_quality_Q9",
"mean_yield_per_sec_Q9",
"longread1_Q9",
"longread2_Q9",
"longread3_Q9",
"longread4_Q9",
"longread5_Q9"]
self._add_result_element("metrics", "headers", ','.join(metrics_names), group)
for item in metrics_names:
self._add_result_element(sample, item, str(stat_info[item]),group)
group = 'plots'
metrics.append(group)
......
......@@ -16,7 +16,7 @@
#
--date
31/07/2017
23/07/2019
--data-nature
DNA
--sequencer
......@@ -28,10 +28,14 @@ Unknown
--species
arabido
--description
ont demo workflow
"ont demo workflow, Minknow 1.10 and Albacore 2.0.2"
--project-name
test-dev
REPDEV
--summary-file
/save/ng6-test/src/ng6-git-mmanno/workflows/ont_qc/data/sequencing_summary_barcoded_test.txt
--barcoded
no
--sample
sample-name=ONT_sample
read1=/MinION/20170308_arab1D_LSK108_MN19767/20170308_arab1D_LSK108_MN19767_albacorev1.2.4/20170308_arab1D_LSK108_MN19767_albacorev1.2.4.fastq
read1=/save/ng6-test/src/ng6-git-mmanno/workflows/ont_qc/data/test.fastq
This diff is collapsed.
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