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

test

parent d9bd5e5e
No related branches found
No related tags found
No related merge requests found
{
"python.pythonPath": "D:\\Programmes\\Anaconda3\\python.exe"
}
\ No newline at end of file
......@@ -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
......@@ -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"])
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