Skip to content
Snippets Groups Projects
Commit c1b3f780 authored by Gauthier Roy's avatar Gauthier Roy
Browse files

add of the distance

parent db399e5d
Branches
No related tags found
No related merge requests found
......@@ -49,6 +49,7 @@ def main(N,tmax,pmutation, proportion):
S2=[individu.score for individu in People.indiv]
print("Score final: ",best.score)
print("Avg:", sum(S2)/len(S2))
print("Distance final: ",best.distance)
plt.subplot(224)
plt.hist(S2, range = (0,maximum+10), bins = 20, color = 'blue')
......@@ -59,7 +60,7 @@ def main(N,tmax,pmutation, proportion):
lineList = [line.rstrip('\n') for line in open("plasmid_8k.fasta")]
brin = ''.join(lineList[1:])
best,People = main(50,20,0.05,25)
best,People = main(100,10,0.05,10)
test = Traj3D()
test.compute(brin, best.table)
test.draw("first_plot")
......
first_plot.png

2.35 KiB | W: | H:

first_plot.png

2.36 KiB | W: | H:

first_plot.png
first_plot.png
first_plot.png
first_plot.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -16,6 +16,7 @@ class Individu():
self.brin = ''.join(lineList[1:])
#self.brin = "AAAGGATCTTCTTGAGATCCTTTTTTTCTGCGCGTAATCTGCTGCCAGTAAACGAAAAAACCGCCTGGGGAGGCGGTTTAGTCGAA"
self.score = None
self.distance = None
def evaluate(self):
''' Evalue le score d'un individu sur un nombre numb_ajout de points'''
......@@ -23,7 +24,7 @@ class Individu():
traj = Traj3D()
numb_ajout = 6
numb_ajout = 100
fisrt_seq = self.brin[0:numb_ajout]
last_seq = self.brin[-numb_ajout:]
......@@ -42,10 +43,10 @@ class Individu():
nuc_coordonate_end = end[i]
distance_nuc = np.linalg.norm(nuc_coordonate_beg - nuc_coordonate_end, ord=2)
list_distance += [distance_nuc]
self.score = max(list_distance)
self.distance = np.linalg.norm(traj_array[numb_ajout] - traj_array[-(numb_ajout+1)], ord=2)
#return max(list_distance)
......@@ -116,10 +117,10 @@ class Individu():
# print(individu1.table.rot_table)
# individu1.mutation()
table = RotTable()
test = Individu(table)
test.evaluate()
print(test.score)
#table = RotTable()
#test = Individu(table)
#test.evaluate()
#print(test.score)
# qqun=Individu(RotTable())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment