Commit 18c2e936 authored by Thonier Florian's avatar Thonier Florian

fuse.py; add a function to construct distributions structure

Prefill the distributions, but doesn't compute values
link to #3902
parent 69963d1e
......@@ -720,6 +720,26 @@ class ListWindows(VidjilJson):
return self.d["samples"].d["original_names"].index(filename)
# ========================= #
# Distributions computing #
# ========================= #
def init_distrib(self, list_distrib):
""" Create distributions structures """
self.d["distributions"] = {}
self.d["distributions"]["repertoires"] = defaultdict(lambda:[])
self.d["distributions"]["keys"] = ["clones", "reads"]
self.d["distributions"]["filter"] = []
self.d["distributions"]["categories"] = {}
nb_sample = self.d["samples"].d["number"]
# prefill distribution for each file of jlist
for filename in self.d["samples"].d["original_names"]:
for distrib in list_distrib:
self.d["distributions"]["repertoires"][filename].append({"axes":distrib,"values":defaultdict(lambda: False)})
return
### some data used for test
w1 = Window(1)
......
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