Commit 2b3ec5cc authored by maxime mano's avatar maxime mano
Browse files

Correction : limitation du nombres d'échantillons indéterminés dans la BDD

parent c31e4210
......@@ -18,6 +18,7 @@
from weaver.function import PythonFunction
from ng6.analysis import Analysis
from operator import __getitem__
def write_indices_stats(reads_file, stat_file, state , expected_index_seq = None):
import re
......@@ -102,14 +103,13 @@ class DemultiplexStats (Analysis):
max_nbindexsaved = 100
# Sort undetermined index on number of sequences
indices_stat_sorted = sorted(indices_stat, reverse=True, key=indices_stat.__getitem__)
indices_stat_sorted = sorted(indices_stat, key=lambda x: indices_stat[x]['number'], reverse=True)
nbindexsaved = 0
for index_seq in indices_stat_sorted:
if indices_stat[index_seq]["number"] >= self.index_count_threshold*min_determined and nbindexsaved <= max_nbindexsaved :
self._add_result_element(index_seq, "number", str(indices_stat[index_seq]["number"]), "undetermined")
self._add_result_element(index_seq, "passing_filter", str(indices_stat[index_seq]["passing_filter"]), "undetermined")
nbindexsaved =+ 1
nbindexsaved = nbindexsaved + 1
else:
other["number"] += indices_stat[index_seq]["number"]
other["passing_filter"] += indices_stat[index_seq]["passing_filter"]
......@@ -117,19 +117,6 @@ class DemultiplexStats (Analysis):
self._add_result_element("All others", "passing_filter", str(other["passing_filter"]), "undetermined")
# if float(overmin) / float(len(list(indices_stat.values()))) >= self.undetermined_threshold :
# raise Exception("More than %s percent of undetermined indexes are higher than the minimum determined index count %s"%(self.undetermined_threshold, min_determined))
#
# for index_seq in indices_stat.keys():
# if indices_stat[index_seq]["number"] >= self.index_count_threshold*min_determined:
# self._add_result_element(index_seq, "number", str(indices_stat[index_seq]["number"]), "undetermined")
# self._add_result_element(index_seq, "passing_filter", str(indices_stat[index_seq]["passing_filter"]), "undetermined")
# else:
# other["number"] += indices_stat[index_seq]["number"]
# other["passing_filter"] += indices_stat[index_seq]["passing_filter"]
# self._add_result_element("All others", "number", str(other["number"]), "undetermined")
# self._add_result_element("All others", "passing_filter", str(other["passing_filter"]), "undetermined")
def get_version(self):
return "-"
......
Supports Markdown
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