Commit 3b7bc561 authored by Thonier Florian's avatar Thonier Florian

fuse.py; remove previous function to compute distributions

link to #3902
parent 6741af65
......@@ -439,23 +439,8 @@ class ListWindows(VidjilJson):
self.id_lengths = defaultdict(int)
print("%%")
nb_sample = self.d["samples"].d["number"]
self.d["distribution"] = {}
for filename in self.d["samples"].d["original_names"]:
self.d["distribution"][filename] = [{"axes":["lenNt"],"values":[defaultdict(lambda:[0,0])] * nb_sample}]
for clone in self:
self.id_lengths[len(clone.d['id'])] += 1
try:
lenNt = len(clone.d["sequence"])
except:
lenNt = 0
for t in range(nb_sample):
filename = self.d["samples"].d["original_names"][t]
# print( filename )
nb_reads = clone.d["reads"][t]
self.d["distribution"][filename][0]["values"][t][lenNt][0] += 1
self.d["distribution"][filename][0]["values"][t][lenNt][1] += nb_reads
print ("%% lengths .vidjil -> ", self.id_lengths)
try:
......@@ -533,11 +518,6 @@ class ListWindows(VidjilJson):
obj.d["samples"] = self.d["samples"] + other.d["samples"]
obj.d["reads"] = self.d["reads"] + other.d["reads"]
obj.d["diversity"] = self.d["diversity"] + other.d["diversity"]
obj.d["distribution"] = {}
for filename in self.d["distribution"].keys():
obj.d["distribution"][filename] = self.d["distribution"][filename]
for filename in other.d["distribution"].keys():
obj.d["distribution"][filename] = other.d["distribution"][filename]
return obj
......
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