Commit 82d05c7c authored by Maxime Manno's avatar Maxime Manno 🍜

Merge branch 'nG6_ont-qc_improvement' into 'master'

Ng6 ont qc improvement

See merge request !17
parents a4bbb772 d19568f9
......@@ -109,7 +109,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{if ($head == 'median_read_quality') or ($head == 'mean_read_quality')}
<td><label>{$head}</label></td>
<td>{($quality.$head)|number_format:2:',':' '}</td>
{elseif $head|strstr:"nb_read_Q"}
{elseif $head|strstr:"nb_read"}
<td><label>{$head}</label></td>
<td>{($quality.$head)|number_format:0:',':' '} ({($quality.$head / $basic.nb_reads*100)|number_format:2:',':' '}%)</td>
{else}
......@@ -178,8 +178,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<th class = "numeric-sort" id="th_id_{$th_id}">Median read_quality</th>
{elseif $head == 'N50_read_length'}
<th class = "numeric-sort" id="th_id_{$th_id}">N50 read_length</th>
{elseif $head == 'L50_read_length'}
<th class = "numeric-sort" id="th_id_{$th_id}">L50 read_length</th>
{elseif $head == 'barcode_score'}
<th class = "numeric-sort" id="th_id_{$th_id}">Barcode_score</th>
{elseif $head == 'nb_read_Q>10'}
......@@ -190,6 +188,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<th class = "numeric-sort" id="th_id_{$th_id}">Median yield_per_sec</th>
{elseif $head == 'nb_actif_channel'}
<th class = "numeric-sort" id="th_id_{$th_id}">Nb actif_channel</th>
{elseif $head == 'nb_reads_utils'}
<th class = "numeric-sort" id="th_id_{$th_id}">Nb actif_channel</th>
{elseif $head == 'nb_bases_utils'}
<th class = "numeric-sort" id="th_id_{$th_id}">Nb actif_channel</th>
{/if}
{$th_id = $th_id +1}
{/foreach}
......@@ -217,8 +219,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:1:',':' '}</th>
{elseif $head == 'N50_read_length'}
<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
{elseif $head == 'L50_read_length'}
<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
{elseif $head == 'barcode_score'}
<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:1:',':' '}</th>
{elseif $head == 'nb_read_Q>10'}
......@@ -229,6 +229,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
{elseif $head == 'nb_actif_channel'}
<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
{elseif $head == 'nb_reads_utils'}
<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
{elseif $head == 'nb_bases_utils'}
<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
{/if}
{$col_id = $col_id + 1}
......@@ -328,6 +332,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<li><strong>total_bases_Q>N</strong> :
The total number of bases for the reads that have a quality > N.
</li>
<li><strong>nb_read/bases_utils</strong> :
The total number of reads/bases for the reads that have a quality > 7 and a length > 3000bp.
</li>
</ul>
</span>
</div>
......
......@@ -72,18 +72,19 @@ class Run_stats (Analysis):
if parts[0] == "median_read_length": stats["median_read_length"] = 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] == "L50_read_length": stats["L50_read_length"] = parts[1]
if parts[0] == "median_read_quality": stats["median_read_quality"] = parts[1]
if parts[0] == "mean_read_quality": stats["mean_read_quality"] = parts[1]
if parts[0] == "nb_read_Q>5": stats["nb_read_Q>5"] = parts[1]
if parts[0] == "total_bases_Q>5": stats["total_bases_Q>5"] = parts[1]
if parts[0] == "nb_read_Q>10": stats["nb_read_Q>10"] = parts[1]
if parts[0] == "total_bases_Q>10": stats["total_bases_Q>10"] = parts[1]
if parts[0] == "nb_read_Q>15": stats["nb_read_Q>15"] = parts[1]
if parts[0] == "total_bases_Q>15": stats["total_bases_Q>15"] = parts[1]
if parts[0] == "nb_read_Q>7": stats["nb_read_Q>7"] = parts[1]
if parts[0] == "total_bases_Q>7": stats["total_bases_Q>7"] = parts[1]
if parts[0] == "nb_read_Q>9": stats["nb_read_Q>9"] = parts[1]
if parts[0] == "total_bases_Q>9": stats["total_bases_Q>9"] = parts[1]
if parts[0] == "nb_read_Q>12": stats["nb_read_Q>12"] = parts[1]
if parts[0] == "total_bases_Q>12": stats["total_bases_Q>12"] = parts[1]
if parts[0] == "median_yield_per_sec": stats["median_yield_per_sec"] = parts[1]
if parts[0] == "mean_yield_per_sec": stats["mean_yield_per_sec"] = parts[1]
if parts[0] == "nb_actif_channel": stats["nb_actif_channel"] = parts[1]
if parts[0] == "nb_read_utils": stats["nb_read_utils"] = parts[1]
if parts[0] == "total_bases_utils": stats["total_bases_utils"] = parts[1]
#print(stats)
return stats
......@@ -134,29 +135,29 @@ class Run_stats (Analysis):
group = 'basic'
metrics.append(group)
self._add_result_element("metrics", "headers", ','.join(["nb_reads", "total_bases", "median_read_length", "N50_read_length", "L50_read_length", "median_yield_per_sec", "nb_actif_channel"]), group)
self._add_result_element("metrics", "headers", ','.join(["nb_reads", "total_bases", "median_read_length", "N50_read_length", "median_yield_per_sec", "nb_actif_channel"]), 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, "median_read_length", str(stat_info["median_read_length"]),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, "L50_read_length", str(stat_info["L50_read_length"]),group),
self._add_result_element(sample, "median_yield_per_sec", str(stat_info["median_yield_per_sec"]),group),
self._add_result_element(sample, "mean_yield_per_sec", str(stat_info["mean_yield_per_sec"]),group),
self._add_result_element(sample, "nb_actif_channel", str(stat_info["nb_actif_channel"]),group)
group = 'quality'
metrics.append(group)
self._add_result_element("metrics", "headers", ','.join(["median_read_quality", "nb_read_Q>5", "nb_read_Q>10", "total_bases_Q>10", "nb_read_Q>15"]), group)
self._add_result_element("metrics", "headers", ','.join(["median_read_quality", "nb_read_Q>9", "total_bases_Q>9", "nb_read_utils", "total_bases_utils"]), group)
self._add_result_element(sample, "median_read_quality", str(stat_info["median_read_quality"]),group),
self._add_result_element(sample, "mean_read_quality", str(stat_info["mean_read_quality"]),group),
self._add_result_element(sample, "nb_read_Q>5", str(stat_info["nb_read_Q>5"]),group),
self._add_result_element(sample, "total_bases_Q>5", str(stat_info["total_bases_Q>5"]),group),
self._add_result_element(sample, "nb_read_Q>10", str(stat_info["nb_read_Q>10"]),group),
self._add_result_element(sample, "total_bases_Q>10", str(stat_info["total_bases_Q>10"]),group),
self._add_result_element(sample, "nb_read_Q>15", str(stat_info["nb_read_Q>15"]),group),
self._add_result_element(sample, "total_bases_Q>15", str(stat_info["total_bases_Q>15"]),group),
group = 'basic'
self._add_result_element(sample, "median_yield_per_sec", str(stat_info["median_yield_per_sec"]),group),
self._add_result_element(sample, "mean_yield_per_sec", str(stat_info["mean_yield_per_sec"]),group),
self._add_result_element(sample, "nb_actif_channel", str(stat_info["nb_actif_channel"]),group)
self._add_result_element(sample, "nb_read_Q>7", str(stat_info["nb_read_Q>7"]),group),
self._add_result_element(sample, "total_bases_Q>7", str(stat_info["total_bases_Q>7"]),group),
self._add_result_element(sample, "nb_read_Q>9", str(stat_info["nb_read_Q>9"]),group),
self._add_result_element(sample, "total_bases_Q>9", str(stat_info["total_bases_Q>9"]),group),
self._add_result_element(sample, "nb_read_Q>12", str(stat_info["nb_read_Q>12"]),group),
self._add_result_element(sample, "total_bases_Q>12", str(stat_info["total_bases_Q>12"]),group),
self._add_result_element(sample, "nb_read_utils", str(stat_info["nb_read_utils"]),group),
self._add_result_element(sample, "total_bases_utils", str(stat_info["total_bases_utils"]),group),
group = 'plots'
metrics.append(group)
......@@ -177,10 +178,6 @@ class Run_stats (Analysis):
self._add_result_element(sample, "outrm_lengthvsqscore_density", self._save_file(os.path.join(self.output_directory, "plot_outrm_lengthvsqscore_density.png"),
sample + ".outrm_lengthvsqscore_density.png"), group)
results_files.append(os.path.join(self.output_directory, "plot_outrm_lengthvsqscore_density.png"))
if os.path.isfile(os.path.join(self.output_directory, "plot_poreactivity.png")):
self._add_result_element(sample, "poreactivity", self._save_file(os.path.join(self.output_directory, "plot_poreactivity.png"),
sample + ".poreactivity.png"), group)
results_files.append(os.path.join(self.output_directory, "plot_poreactivity.png"))
if self.barcoded == "yes":
barcodefile = os.path.join(self.output_directory,"plot_barcoded_statsbarcodes.txt")
......@@ -189,7 +186,7 @@ class Run_stats (Analysis):
group = 'barcode'
metrics.append(group)
self._add_result_element("metrics", "headers", ','.join(["barcode_score","nb_reads","total_bases","median_read_length","N50_read_length","L50_read_length","median_read_quality","nb_read_Q>10","total_bases_Q>10","median_yield_per_sec","nb_actif_channel"]), group)
self._add_result_element("metrics", "headers", ','.join(["barcode_score","nb_reads","total_bases","median_read_length","N50_read_length","median_read_quality","nb_read_Q>9","total_bases_Q>9","median_yield_per_sec","nb_actif_channel","nb_read_utils","total_bases_utils"]), group)
self._add_result_element("metrics", "names", ','.join(barcode_names),group)
for barcode in barcode_names :
......@@ -200,12 +197,13 @@ class Run_stats (Analysis):
self._add_result_element(sample, "total_bases", str(barcode_info[barcode][3]),group),
self._add_result_element(sample, "median_read_length", str(barcode_info[barcode][4]),group),
self._add_result_element(sample, "N50_read_length", str(barcode_info[barcode][6]),group),
self._add_result_element(sample, "L50_read_length", str(barcode_info[barcode][7]),group),
self._add_result_element(sample, "median_read_quality", str(barcode_info[barcode][8]),group),
self._add_result_element(sample, "nb_read_Q>10", str(barcode_info[barcode][12]),group),
self._add_result_element(sample, "total_bases_Q>10", str(barcode_info[barcode][13]),group),
self._add_result_element(sample, "median_yield_per_sec", str(barcode_info[barcode][16]),group),
self._add_result_element(sample, "nb_actif_channel", str(barcode_info[barcode][18]),group),
self._add_result_element(sample, "median_read_quality", str(barcode_info[barcode][7]),group),
self._add_result_element(sample, "nb_read_Q>9", str(barcode_info[barcode][11]),group),
self._add_result_element(sample, "total_bases_Q>9", str(barcode_info[barcode][12]),group),
self._add_result_element(sample, "median_yield_per_sec", str(barcode_info[barcode][15]),group),
self._add_result_element(sample, "nb_actif_channel", str(barcode_info[barcode][17]),group),
self._add_result_element(sample, "nb_read_utils", str(barcode_info[barcode][18]),group),
self._add_result_element(sample, "total_bases_utils", str(barcode_info[barcode][19]),group),
group = 'plots_barcode'
metrics.append(group)
......
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