Exemplo n.º 1
0
 def make_welcome_page(self, mailaddr, filename):
     db = Database()
     try:
         prob = db.get_properties('maildata')
         user_name = prob[mailaddr]
         writer = HtmlWriter(open(filename, mode='w'))
         writer.title('Welcome to ' + user_name + 'is page!')
         writer.paragraph(user_name + 'のページへようこそ。')
         writer.paragraph('メール待っていますね。')
         writer.mailto(mailaddr, user_name)
         writer.close()
         print(filename + ' ' + 'is created for' + ' ' + mailaddr + ' ' + '(' + user_name + ')')
     except IOError as e:
         logging.exception(e)
Exemplo n.º 2
0
 def make_welcome_page(self, mailaddr, filename):
     db = Database()
     try:
         prob = db.get_properties('maildata')
         user_name = prob[mailaddr]
         writer = HtmlWriter(open(filename, mode='w'))
         writer.title('Welcome to ' + user_name + 'is page!')
         writer.paragraph(user_name + 'のページへようこそ。')
         writer.paragraph('メール待っていますね。')
         writer.mailto(mailaddr, user_name)
         writer.close()
         print(filename + ' ' + 'is created for' + mailaddr + ' ' + '(' +
               user_name + ')')
     except IOError as e:
         logging.exception(e)
ax_met = fig2.add_subplot(1, 2, 2, xscale="log", yscale="log")
ax_met.set_title("eCF(1SP) Metabolite concentrations")

model.ValidateMetaboliteConcentrations(lnC_ECM, ax_met)
model.ValidateEnzymeConcentrations(lnC_ECM, ax_enz)
fig2.show()

html.write("<p>\n")
html.write("<b>Experiment name:</b> %s</br>\n" % exp_name)
html.embed_matplotlib_figure(fig1)
html.write("</p><p>\n")
html.embed_matplotlib_figure(fig2)
html.write("</p><p>\n")
model.WriteHtmlTables(lnC_ECM, html)
html.write("</p>\n")

html.close()


# make plots also in linear scale just for fun
fig3 = plt.figure(figsize=(14, 6))
fig3.suptitle("Valdiation")
ax_enz = fig3.add_subplot(1, 2, 1, xscale="linear", yscale="linear")
ax_enz.set_title("eCF3(1SP) Enzyme concentrations")
ax_met = fig3.add_subplot(1, 2, 2, xscale="linear", yscale="linear")
ax_met.set_title("eCF3(1SP) Metabolite concentrations")

model.ValidateMetaboliteConcentrations(lnC_ECM, ax_met, scale="linear")
model.ValidateEnzymeConcentrations(lnC_ECM, ax_enz, scale="linear")
fig3.show()
Exemplo n.º 4
0
from cobra.io.sbml import create_cobra_model_from_sbml_file
from html_writer import HtmlWriter
import analysis_toolbox

main_html = HtmlWriter('res/fba.html')
main_html.write('<title>FBA</title>')
main_html.write('<h1>FBA</h1>\n')

model = create_cobra_model_from_sbml_file('data/iJO1366.xml')

main_html.write('</ul>\n')

print("Running standard FBA...")
solution = model.optimize()

if solution.status is not None:
    # write the flux summary for the knockout model as HTML
    analysis_toolbox.model_summary(model, solution, main_html)

main_html.close()