Commit 2a351ae7 authored by Thonier Florian's avatar Thonier Florian

fuse.py; add computing of gc content distribution

link to #3944 and 3902
parent ba6c57d0
......@@ -204,6 +204,10 @@ class Window:
if axe == "lenJunction":
return self.get_values("junction_stop") - self.get_values("junction_start")
if axe == "GCContent":
return self.getGCcontent()
### Positions
if axe == "seg5_stop":
return self.d["seg"]["5"]["stop"]
......@@ -243,6 +247,20 @@ class Window:
except:
return "?"
def getGCcontent(self):
if len(self.d["sequence"]) == 0:
return "?"
gc = 0
for nt in self.d["sequence"]:
if nt in "GgCc":
gc += 1
GCContent = gc / len(self.d["sequence"])
# return round for better association of clones
return round( GCContent, 3)
def get_reagmt( self):
""" hard coded function to define the rearangement type of this clone """
complete = self.get_values("complete")
......@@ -287,7 +305,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):
......
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