Commit ad8b2af2 authored by Thonier Florian's avatar Thonier Florian

fuse.py, compute new axis values for distributions

link to #3944
parent 289dfa74
......@@ -204,6 +204,20 @@ class Window:
if axe == "lenJunction":
return self.get_values("junction_stop") - self.get_values("junction_start")
if axe == "GCContent":
return self.getGCcontent()
# FIXME: need to get the rigth position value
# If the clone have multiple sample, need to select the current.
# Should not apply if executed from the vidjil server
if axe == "lenSeqConsensus":
return self.d["_average_read_length"][0]/ self.get_values("lenSeq")
if axe == "lenSeqAverage":
return self.d["_average_read_length"][0]
if axe == "coverage":
return round(self.d["_coverage"][0]*100, 2)
### Positions
if axe == "seg5_stop":
return self.d["seg"]["5"]["stop"]
......@@ -301,7 +315,7 @@ class Window:
### print essential info about Window
def __str__(self):
return "<window : %s %s %s>" % ( self.d["reads"], '*' if self.d["top"] == sys.maxsize else self.d["top"], self.d["id"])
class Samples:
def __init__(self):
......@@ -540,11 +554,10 @@ class ListWindows(VidjilJson):
for clone in self:
for i, s in enumerate(clone.d["reads"]):
if self.d['reads'].d['segmented'][i] > 0:
for r in range(len(ranges)):
if s*1. / self.d['reads'].d['segmented'][i] >= ranges[r]:
break
result[r][i] += s
for r in range(len(ranges)):
if s*1. / self.d['reads'].d['segmented'][i] >= ranges[r]:
break
result[r][i] += s
for r in range(len(ranges)):
ratio_in_string = '{0:.10f}'.format(ranges[r]).rstrip('0')
......@@ -1098,6 +1111,7 @@ def main():
LISTE_D = []
LIST_AXES = ["germline", # "top", # "name"
"seg5", "seg4", "seg3",
"lenSeqConsensus", "lenSeqAverage", "GCContent", "coverage",
"lenSeq", # "evalue", l'arrondir ?
"seg5_delRight", "seg3_delLeft", "seg4_delRight", "seg3_delLeft",
"insert_53", "insert_54", "insert_43",
......
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