Exemplo n.º 1
0
    def test_number_reactions(self):
        plotter = FBAPlotter(self._filenames, 'E:\\Chrome Download\\FBA\\FBA\\iPRAE34_plot_test.xls')
        self.assertEqual(plotter.active_exchange_count[0], 1)
        self.assertEqual(plotter.active_exchange_count[1], 2)

        fig = plt.figure()
        ax = fig.add_subplot(111)
        ind = np.arange(len(plotter.unique))
        width = 0.35
        ax.bar(ind, plotter.active_exchange_count, width)
        ax.set_xticks(ind + width/ 2)
        ax.set_xticklabels(plotter.unique)
        plt.show()
Exemplo n.º 2
0
import os
import matplotlib.pyplot as plt
import numpy as np
import csv
from FBA_Evolver import FBAPlotter, FBAEvolver

filenames = list()
for f_file in os.listdir('./27-5-17'):
    filenames.append('./27-5-17/' + f_file)
plotter= FBAPlotter(filenames, 'E:\\Chrome Download\\FBA\\FBA\\iPRAE34_ppc_knockout.xls')

evolver = FBAEvolver('E:\\Chrome Download\\FBA\\FBA\\iPRAE34_ppc_knockout.xls')

filtered_name, filtered_count = plotter.filter_reactions(0)


for phenotype in plotter.phenotypes:
    print(phenotype)
    evolver.set_exchanges(phenotype)
    growth = evolver.run_fba('E:\\Chrome Download\\FBA\\FBA\\iPRAE34_ppc_knockout.xls', 'E:\\Chrome Download\\FBA\\FBA\\iPRAE34_ppc_knockout.xls')
    print(growth)

fig = plt.figure()
ax = fig.add_subplot(111)

ind = np.arange(len(filtered_name))
width = 0.5
ax.bar(ind, filtered_count, width)
ax.set_xticks(ind + width / 2)
ax.set_xticklabels(filtered_name, rotation='vertical')
plt.gcf().subplots_adjust(bottom=0.3)
Exemplo n.º 3
0
import csv
from FBA_Evolver import FBAPlotter

#igure = plt.figure()
#ax = figure.add_subplot(111)
fig2 = plt.figure()
ax2 = fig2.add_subplot(111)
phenotype_filenames = list()
fitness_filenames = list()
for p_file, f_file in zip(os.listdir('./Results_21_5_17/Phenotype'),
                          os.listdir('./Results_21_5_17/Fitness')):

    phenotype_filenames.append('./Results_21_5_17/Phenotype/' + p_file)
    fitness_filenames.append('./Results_21_5_17/Fitness/' + f_file)

plotter = FBAPlotter(phenotype_filenames,
                     'E:\\Chrome Download\\FBA\\FBA\\iPRAE34_plot_test.xls')
filtered_name, filtered_count = plotter.filter_reactions(1)

for file in fitness_filenames:
    with open(file, 'r') as csvfile:
        reader = csv.reader(csvfile, delimiter=',')
        ax2.plot(np.asarray(next(reader)))

fig = plt.figure()
ax = fig.add_subplot(111)
ind = np.arange(len(filtered_name))
width = 0.5
ax.bar(ind, filtered_count, width)
ax.set_xticks(ind + width / 2)
ax.set_xticklabels(filtered_name, rotation='vertical')
ax2.set_xlabel('Generation')
Exemplo n.º 4
0
 def test_get_set_reactions(self):
     plotter = FBAPlotter(self._filenames, 'E:\\Chrome Download\\FBA\\FBA\\iPRAE34_plot_test.xls')
     self.assertEqual(len(plotter.unique), 2)
     self.assertEqual(plotter.unique[0], 'EX_12ppd_R(e)')
Exemplo n.º 5
0
    def test_number_of_files(self):
        plotter_one = FBAPlotter(self._filename, 'E:\\Chrome Download\\FBA\\FBA\\iPRAE34_plot_test.xls')
        plotter_two = FBAPlotter(self._filenames, 'E:\\Chrome Download\\FBA\\FBA\\iPRAE34_plot_test.xls')

        self.assertEqual(plotter_one.num_files, 1)
        self.assertEqual(plotter_two.num_files, 2)
Exemplo n.º 6
0
 def test_read_files(self):
     filenames = list()
     for f_file in os.listdir('./26-5-17'):
         filenames.append('./26-5-17/' + f_file)
     plotter_one = FBAPlotter(filenames, 'E:\\Chrome Download\\FBA\\FBA\\iPRAE34_plot_test.xls')
     self.assertEqual(len(plotter_one.fitnesses), 5)
Exemplo n.º 7
0
 def test_filter_reaction_count(self):
     plotter = FBAPlotter(self._filenames, 'E:\\Chrome Download\\FBA\\FBA\\iPRAE34_plot_test.xls')
     filtered_name, filtered_count = plotter.filter_reactions(1)
     self.assertEqual(len(filtered_name), 1)