Skip to content
Snippets Groups Projects
Commit 514105da authored by Muller Sacha's avatar Muller Sacha
Browse files

Rajout de la correspondance entre les nucleotides opposes dans RotTable et...

Rajout de la correspondance entre les nucleotides opposes dans RotTable et application de cette correspondance pour mutation dans individu.py
parent ea595ada
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,26 @@ class RotTable:
"TA": [36, 0.9, 0, 1.1, 2, 0],\
"TC": [36.9, 5.3, -120, 0.9, 6, 0],\
"TG": [34.5, 3.5, 64, 0.9, 34, 0],\
"TT": [35.62, 7.2, -154, 0.06, 0.6, 0]\
"TT": [35.62, 7.2, 154, 0.06, 0.6, 0]\
}
__CORRESPONDANCE = {\
"AA": "TT"
"AC": "TG"
"AG": "TC"
"AT": "TA"
"CA": "GT"
"CC": "GG"
"CG": "GC"
"CT": "GA"
"GA": "CT"
"GC": "CG"
"GG": "CC"
"GT": "CA"
"TA": "AT"
"TC": "AG"
"TG": "AC"
"TT": "AA"
}
# get the angles in each axis (x, y, z), considering the deviation
......@@ -41,6 +60,9 @@ class RotTable:
# return __ORIGINAL_ROT_TABLE
def orta(self):
return self.__ORIGINAL_ROT_TABLE
def corr(self):
return self.__CORRESPONDANCE
###################
# WRITING METHODS #
......
from RotTable import RotTable
from Traj3D import *
from Traj3D import Traj3D
import numpy as np
from math import sqrt
from random import random
......@@ -8,6 +8,8 @@ P1 = 0.015
class Individu():
def __init__(self, table):
self.table = table
self.score = None
......@@ -39,10 +41,13 @@ class Individu():
for coord in range(3):
tir = random()
if tir < proba :
# print("mutation", doublet, coord)
# print("table", table_rotations[doublet][coord])
table_rotations[doublet][coord] =np.random.uniform(low = self.table.orta()[doublet][coord] - self.table.orta()[doublet][coord + 3], high = self.table.orta()[doublet][coord] + self.table.orta()[doublet][coord + 3])
# print("table", table_rotations[doublet][coord])
doublet2 = self.table.corr()[doublet]
if coord = 0 or coord = 1 :
table_rotations[doublet2][coord] = table_rotations[doublet][coord]
else :
#sur l'axe z il y a un moins
table_rotations[doublet2][coord] = - table_rotations[doublet][coord]
# individu1 = Individu(RotTable())
# print(individu1.table.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