diff --git a/RotTable.py b/RotTable.py index 9f841efe35b5e7de98443db1b6948ec1a040ef33..cb1f75b7c481272149b5618d7f4f98757e4a4df2 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)