Skip to content
Snippets Groups Projects
Commit cc8dfec3 authored by Busson Loic's avatar Busson Loic
Browse files

rottable lien

parent 043b1c32
No related branches found
No related tags found
No related merge requests found
......@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment