diff --git a/RotTable.py b/RotTable.py index 37762b4121d2412f728194a4da8245389cc6a30a..093082020f0c1b6b344c9818f438c90b37f82d32 100644 --- a/RotTable.py +++ b/RotTable.py @@ -40,9 +40,21 @@ class RotTable: "TA": "TA",\ "TC": "GA",\ "TG": "CA",\ - "TT": "AA",\ + "TT": "AA"\ } + __SOUS_CORRESPONDANCE = {\ + "AA": "TT",\ + "AC": "GT",\ + "AG": "CT",\ + "AT": "AT",\ + "CA": "TG",\ + "CC": "GG",\ + "CG": "CG",\ + "GA": "TC",\ + "GC": "GC",\ + "TA": "TA"\ + } # get the angles in each axis (x, y, z), considering the deviation def __init__(self): self.rot_table = {} @@ -53,9 +65,11 @@ class RotTable: # get a random deviation, considering the "limits" given in the last 3 columns # of __ORIGINAL_ROT_TABLE def alea(self): - for dinucleotide in RotTable.__ORIGINAL_ROT_TABLE: + for dinucleotide in RotTable.__SOUS_CORRESPONDANCE: for i in range(2): - self.rot_table[dinucleotide][i] += 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[RotTable.__SOUS_CORRESPONDANCE[dinucleotide]][i] += delta # return __ORIGINAL_ROT_TABLE def orta(self): @@ -86,6 +100,5 @@ class RotTable: ################### table1 = RotTable() -print(table1.orta()) -print(table1.rot_table["AA"]) +print(table1.rot_table)