Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EI Jeux Evolutionnaires
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Santos Garcia Carlos
EI Jeux Evolutionnaires
Commits
bb698477
Commit
bb698477
authored
5 years ago
by
Gauthier Roy
Browse files
Options
Downloads
Plain Diff
Merge branch 'gauthier'
parents
f245c2af
7ef86a54
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
__pycache__/RotTable.cpython-36.pyc
+0
-0
0 additions, 0 deletions
__pycache__/RotTable.cpython-36.pyc
__pycache__/Traj3D.cpython-36.pyc
+0
-0
0 additions, 0 deletions
__pycache__/Traj3D.cpython-36.pyc
individu.py
+25
-21
25 additions, 21 deletions
individu.py
with
25 additions
and
21 deletions
__pycache__/RotTable.cpython-36.pyc
+
0
−
0
View file @
bb698477
No preview for this file type
This diff is collapsed.
Click to expand it.
__pycache__/Traj3D.cpython-36.pyc
+
0
−
0
View file @
bb698477
No preview for this file type
This diff is collapsed.
Click to expand it.
individu.py
+
25
−
21
View file @
bb698477
from
RotTable
import
RotTable
from
Traj3D
import
Traj3D
import
numpy
as
np
from
math
import
sqrt
from
math
import
sqrt
,
inf
from
random
import
random
P1
=
0.015
...
...
@@ -14,26 +14,30 @@ class Individu():
def
evaluate
(
self
,
brin
):
traj
=
Traj3D
()
traj
.
compute
(
brin
,
self
.
table
)
numb_ajout
=
3
fisrt_seq
=
brin
[
0
:
numb_ajout
]
last_seq
=
brin
[
-
numb_ajout
:]
traj
.
compute
(
last_seq
+
brin
+
fisrt_seq
,
self
.
table
)
traj_array
=
np
.
array
(
traj
.
getTraj
())
print
(
traj_array
)
first_nucleotide
=
traj_array
[
0
,
0
:
3
]
last_nucleotide
=
traj_array
[
-
1
,
0
:
3
]
print
(
first_nucleotide
)
print
(
last_nucleotide
)
distance
=
sqrt
(
sum
((
first_nucleotide
-
last_nucleotide
)
**
2
))
diff_ideal_distance
=
abs
(
3.38
-
distance
)
list_distance
=
[]
for
i
in
range
(
numb_ajout
):
first_nuc_coordonate
=
traj_array
[
numb_ajout
+
i
,
0
:
3
]
first_nuc_coordonate_compute
=
traj_array
[
-
(
numb_ajout
-
i
),
0
:
3
]
last_nuc_coordonate
=
traj_array
[
-
(
2
*
numb_ajout
-
i
),
0
:
3
]
last_nuc_coordonate_compute
=
traj_array
[
i
,
0
:
3
]
distance_first_nuc
=
np
.
linalg
.
norm
(
first_nuc_coordonate
-
first_nuc_coordonate_compute
,
ord
=
2
)
distance_last_nuc
=
np
.
linalg
.
norm
(
last_nuc_coordonate
-
last_nuc_coordonate_compute
,
ord
=
2
)
first_name
=
brin
[
0
]
last_name
=
brin
[
-
1
]
list_distance
+=
[
distance_first_nuc
,
distance_last_nuc
]
#rot_computed = self.table.rot_table[last_name+first_name]
#rot_traj = first_nucleotide - last_nucleotide
# print(rot_traj)
# print(rot_computed)
#diff_angle = sum(abs(rot_computed - rot_traj))
self
.
score
=
1
/
distance
self
.
score
=
1
/
max
(
list_
distance
)
def
mutation
(
self
,
proba
=
P1
):
...
...
@@ -61,7 +65,7 @@ class Individu():
# print(test.score)
qqun
=
Individu
(
RotTable
())
qqun
.
table
.
rot_table
=
{
'
AA
'
:
[
35.576558502141
,
7.433901511509349
,
-
154
],
'
AC
'
:
[
33.22048222654215
,
5.25191751302917
,
143
],
'
AG
'
:
[
26.446029097301288
,
6.052240462237622
,
-
2
],
'
AT
'
:
[
30.47045254036881
,
1.333716025628036
,
0
],
'
CA
'
:
[
34.00734209585039
,
33.70710613604862
,
-
64
],
'
CC
'
:
[
33.61019622767888
,
3.713127032109607
,
-
57
],
'
CG
'
:
[
29.664061041382677
,
6.725155507162601
,
0
],
'
CT
'
:
[
26.446029097301288
,
6.052240462237622
,
2
],
'
GA
'
:
[
36.655773481637176
,
10.45337581740701
,
120
],
'
GC
'
:
[
42.26984493493484
,
3.5310453395352823
,
180
],
'
GG
'
:
[
33.61019622767888
,
3.713127032109607
,
-
57
],
'
GT
'
:
[
33.22048222654215
,
5.25191751302917
,
143
],
'
TA
'
:
[
36.951508786388914
,
-
2.5174751178033303
,
0
],
'
TC
'
:
[
36.655773481637176
,
10.45337581740701
,
-
120
],
'
TG
'
:
[
34.00734209585039
,
33.70710613604862
,
-
64
],
'
TT
'
:
[
35.576558502141
,
7.433901511509349
,
-
154
]}
qqun
.
evaluate
(
"
AAAGGATCTTCTTGAGATCCTTTTTTTCTGCGCGTAATCTGCTGCCAGTAAACGAAAAAACCGCCTGGGGAGGCGGTTTAGTCGAA
"
)
print
(
qqun
.
score
)
#
qqun=Individu(RotTable())
#
qqun.table.rot_table={'AA': [35.576558502141, 7.433901511509349, -154], 'AC': [33.22048222654215, 5.25191751302917, 143], 'AG': [26.446029097301288, 6.052240462237622, -2], 'AT': [30.47045254036881, 1.333716025628036, 0], 'CA': [34.00734209585039, 33.70710613604862, -64], 'CC': [33.61019622767888, 3.713127032109607, -57], 'CG': [29.664061041382677, 6.725155507162601, 0], 'CT': [26.446029097301288, 6.052240462237622, 2], 'GA': [36.655773481637176, 10.45337581740701, 120], 'GC': [42.26984493493484, 3.5310453395352823, 180], 'GG': [33.61019622767888, 3.713127032109607, -57], 'GT': [33.22048222654215, 5.25191751302917, 143], 'TA': [36.951508786388914, -2.5174751178033303, 0], 'TC': [36.655773481637176, 10.45337581740701, -120], 'TG': [34.00734209585039, 33.70710613604862, -64], 'TT': [35.576558502141, 7.433901511509349, -154]}
#
qqun.evaluate("AAAGGATCTTCTTGAGATCCTTTTTTTCTGCGCGTAATCTGCTGCCAGTAAACGAAAAAACCGCCTGGGGAGGCGGTTTAGTCGAA")
#
print(qqun.score)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment