diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..395ba2d31e295f66eef5e2bd3db334975a462037 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "D:\\Programmes\\Anaconda3\\python.exe" +} \ No newline at end of file diff --git a/Initialisation.py b/Initialisation.py index bd0905909b9d848cdd238dfdbd4b8a9f1245eca6..1a2947e5d6d776eaab4c42387fcd36f075272bea 100644 --- a/Initialisation.py +++ b/Initialisation.py @@ -25,3 +25,14 @@ class rotation: self.y = numpy.random.uniform(low = ORIGINAL_ROT_TABLE[doublet][1] - ORIGINAL_ROT_TABLE[doublet][4], high = ORIGINAL_ROT_TABLE[doublet][1] + ORIGINAL_ROT_TABLE[doublet][4]) self.z = ORIGINAL_ROT_TABLE[doublet][2] self.doublet = doublet + +class table_rotation(rotation): + def __init__(self): + self.dict = {doublet : rotation(doublet) for doublet in ORIGINAL_ROT_TABLE} + +table1 = table_rotation() +print(table1.dict["AA"].x) + +#table1.dict --> {'AA': <__main__.rotation object at 0x000001A722E1BAC8>, 'AC': <__main__.rotation object at 0x000001A722E1BB00>, 'AG': <__main__.rotation object at 0x000001A729A66A58>, 'AT': <__main__.rotation object at 0x000001A729A66A20>, 'CA': <__main__.rotation object at 0x000001A729A669E8>, 'CC': <__main__.rotation object at 0x000001A729A66A90>, 'CG': <__main__.rotation object at 0x000001A729A66B00>, 'CT': <__main__.rotation object at 0x000001A729A66B70>, 'GA': <__main__.rotation object at 0x000001A729B88D68>, 'GC': <__main__.rotation object at 0x000001A729B88DA0>, 'GG': <__main__.rotation object at 0x000001A729B88DD8>, 'GT': <__main__.rotation object at 0x000001A729B88E10>, 'TA': <__main__.rotation object at 0x000001A729B88E48>, 'TC': <__main__.rotation object at 0x000001A729B88E80>, 'TG': <__main__.rotation object at 0x000001A729B88EB8>, 'TT': <__main__.rotation object at 0x000001A729B88EF0>} +#table1.dict["AA"] ---> <__main__.rotation object at 0x000001A722E1BAC8> (qui est l'object rotation) +#table1.dict["AA"].x ---> 35.67097790545279 (rotation selon x de AA) \ No newline at end of file diff --git a/RotTable.py b/RotTable.py index ca025dc7c2e05d0be7acb66136e2b950afd584fb..ede2d0b23bf9732b51548a14e9e5b4f5fd1bdaca 100644 --- a/RotTable.py +++ b/RotTable.py @@ -27,13 +27,21 @@ class RotTable: self.__Rot_Table = {} for dinucleotide in RotTable.__ORIGINAL_ROT_TABLE: self.__Rot_Table[dinucleotide] = RotTable.__ORIGINAL_ROT_TABLE[dinucleotide][:3] + self.alea() + + + def alea(self): + for dinucleotide in RotTable.__ORIGINAL_ROT_TABLE: + 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]) ################### # WRITING METHODS # ################### - +#table = RotTable() +#table.__Rot_Table["AA"] --> [35.62, 7.2, -154] ################### # READING METHODS # @@ -49,3 +57,6 @@ class RotTable: return RotTable.__ORIGINAL_ROT_TABLE[dinucleotide][2] ################### + + table1 = RotTable() + print(table1.__Rot_Table["AA"])