Skip to content
Snippets Groups Projects
Commit f77e72f7 authored by Kappes Marques Rodrigo's avatar Kappes Marques Rodrigo
Browse files

Cleaned RotTable

parent b8f9daa5
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ class RotTable: ...@@ -24,6 +24,7 @@ class RotTable:
"TT": [35.62, 7.2, 154, 0.06, 0.6, 0]\ "TT": [35.62, 7.2, 154, 0.06, 0.6, 0]\
} }
#The table that indicates what dinucleotides have dependent angles
__CORRESPONDANCE = {\ __CORRESPONDANCE = {\
"AA": "TT",\ "AA": "TT",\
"AC": "GT",\ "AC": "GT",\
...@@ -55,6 +56,11 @@ class RotTable: ...@@ -55,6 +56,11 @@ class RotTable:
"GC": "GC",\ "GC": "GC",\
"TA": "TA"\ "TA": "TA"\
} }
###################
# WRITING METHODS #
###################
# get the angles in each axis (x, y, z), considering the deviation # get the angles in each axis (x, y, z), considering the deviation
def __init__(self): def __init__(self):
self.rot_table = {} self.rot_table = {}
...@@ -67,6 +73,7 @@ class RotTable: ...@@ -67,6 +73,7 @@ class RotTable:
def alea(self): def alea(self):
for dinucleotide in RotTable.__SOUS_CORRESPONDANCE: for dinucleotide in RotTable.__SOUS_CORRESPONDANCE:
for i in range(2): 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]) 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[dinucleotide][i] += delta
self.rot_table[RotTable.__SOUS_CORRESPONDANCE[dinucleotide]][i] += delta self.rot_table[RotTable.__SOUS_CORRESPONDANCE[dinucleotide]][i] += delta
...@@ -78,9 +85,6 @@ class RotTable: ...@@ -78,9 +85,6 @@ class RotTable:
def corr(self): def corr(self):
return self.__CORRESPONDANCE return self.__CORRESPONDANCE
###################
# WRITING METHODS #
###################
#table = RotTable() #table = RotTable()
#table.rot_table["AA"] --> [35.62, 7.2, -154] #table.rot_table["AA"] --> [35.62, 7.2, -154]
...@@ -99,7 +103,3 @@ class RotTable: ...@@ -99,7 +103,3 @@ class RotTable:
################### ###################
#table1 = RotTable()
#print(table1.orta())
# print(table1.rot_table)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment