From f77e72f7c0c6aa99a52494f9c1f9e6e7f38664a0 Mon Sep 17 00:00:00 2001 From: Kappes Marques Rodrigo <rodrigo.kappes@student-cs.fr> Date: Thu, 30 Jan 2020 09:28:24 +0100 Subject: [PATCH] Cleaned RotTable --- RotTable.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/RotTable.py b/RotTable.py index 9f841ef..cb1f75b 100644 --- a/RotTable.py +++ b/RotTable.py @@ -24,6 +24,7 @@ class RotTable: "TT": [35.62, 7.2, 154, 0.06, 0.6, 0]\ } + #The table that indicates what dinucleotides have dependent angles __CORRESPONDANCE = {\ "AA": "TT",\ "AC": "GT",\ @@ -55,6 +56,11 @@ class RotTable: "GC": "GC",\ "TA": "TA"\ } + + ################### + # WRITING METHODS # + ################### + # get the angles in each axis (x, y, z), considering the deviation def __init__(self): self.rot_table = {} @@ -67,6 +73,7 @@ class RotTable: def alea(self): for dinucleotide in RotTable.__SOUS_CORRESPONDANCE: for i in range(2): + #We use a unifor distribution along the desired values delta = numpy.random.uniform(low = -RotTable.__ORIGINAL_ROT_TABLE[dinucleotide][i+3], high= RotTable.__ORIGINAL_ROT_TABLE[dinucleotide][i+3]) self.rot_table[dinucleotide][i] += delta self.rot_table[RotTable.__SOUS_CORRESPONDANCE[dinucleotide]][i] += delta @@ -78,9 +85,6 @@ class RotTable: def corr(self): return self.__CORRESPONDANCE - ################### - # WRITING METHODS # - ################### #table = RotTable() #table.rot_table["AA"] --> [35.62, 7.2, -154] @@ -99,7 +103,3 @@ class RotTable: ################### -#table1 = RotTable() -#print(table1.orta()) - -# print(table1.rot_table) -- GitLab