-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtree_compressor.py
66 lines (50 loc) · 1.49 KB
/
tree_compressor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
__author__ = 'Sandesh'
from CustomClasses.Chromosome import *
import glob
from bokeh.plotting import figure, output_file, show
from mpl_toolkits.mplot3d import Axes3D
import matplotlib as mpl
import matplotlib.pyplot as plt
from numpy.random import rand
from multiprocessing import Pool, Process, Manager
filelist = []
y_val_imag = []
y_val_real = []
y_val = []
x_val = []
x1_val = [x for x in range(22)]
def plot1():
mpl.rcParams['legend.fontsize'] = 10
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(y_val_real, y_val_imag, x_val, c='r', marker='o')
ax.set_xlabel("Real")
ax.set_ylabel("Imaginary")
ax.set_zlabel("Chromosome")
ax.set_zlim3d(1, 22)
s = 50
fig, ax = plt.subplots()
ax.scatter(y_val_real, y_val_imag, s, 'r', marker='o')
ax.set_xlabel("Real")
ax.set_ylabel("Imaginary")
plt.show()
for name in glob.glob('GenomeDataset/Processing/*pChromosome'):
filelist.append(name)
if len(filelist) == 0:
for name in glob.glob('GenomeDataset/Processing/*pTREE'):
filelist.append(name)
i = 1
for infile in filelist:
if "pChromosome" not in infile:
ch = Chromosome()
ch.analyze(infile)
else:
with open(infile, 'rb') as in_fh:
ch = Chromosome()
ch = pickle.load(in_fh)
y_val = ch.calculate_eigen_values()
y_val_real.append(list(y_val.real))
y_val_imag.append(list(y_val.imag))
x_val.append([i for _ in range(len(y_val))])
i += 1
plot1()