Пример #1
0
          <body>
          <p class="info">We are checking your model now...</p>
          <img class="img-centre" src="http://mimoza.bordeaux.inria.fr/lib/modelmap/loader.gif" id="img" />
          <div id="hidden" style="visibility:hidden;height:0px;">''')
sys.stdout.flush()

result, args = upload_file()
url = MIMOZA_UPLOAD_ERROR_URL

if OK == result:
    (m_id, m_name, m_dir_id) = args
    create_thanks_for_uploading_html(m_id,
                                     m_name,
                                     '../html',
                                     m_dir_id,
                                     MIMOZA_URL,
                                     'comp.html',
                                     groups_suffix='')
    url = '%s/%s/index.html' % (MIMOZA_URL, m_dir_id)
elif ALREADY_EXISTS == result:
    model_id, m_dir_id = args
    url = '%s/%s/index.html' % (MIMOZA_URL, m_dir_id)
elif ALREADY_GENERALIZED == result:
    (m_id, m_name, m_dir_id) = args
    create_thanks_for_uploading_html(m_id, m_name, '../html', m_dir_id,
                                     MIMOZA_URL, 'comp.html',
                                     generate_uploaded_generalized_sbml_html)
    url = '%s/%s/index.html' % (MIMOZA_URL, m_dir_id)

print('''</div>
Пример #2
0
    logging.info('calling model_generalisation library')
    reader = libsbml.SBMLReader()
    input_document = reader.readSBML(sbml)
    input_model = input_document.getModel()
    m_id = input_model.getId()

    sbml_directory = dirname(abspath(sbml))
    groups_sbml = os.path.join(sbml_directory, '%s_with_groups.xml' % m_id)

    if not os.path.exists(groups_sbml):
        chebi = parse_simple(get_chebi())
        gen_sbml = os.path.join(sbml_directory, '%s_generalized.xml' % m_id)
        r_id2g_id, s_id2gr_id, species_id2chebi_id, ub_sps = generalize_model(
            sbml, chebi, groups_sbml, gen_sbml)
    create_thanks_for_uploading_html(m_id, input_model.getName(), '../html',
                                     m_dir_id, MIMOZA_URL, 'comp.html',
                                     generate_generalization_finished_html)

except Exception as e:
    logging.info(e)
    url = MIMOZA_ERROR_URL

sys.stdout.flush()

print('''</div>
          </body>
          <script type="text/javascript">
                window.location = "%s"
          </script>
        </html>''' % url)
sys.stdout.flush()
Пример #3
0
            <title>Checking...</title>
          </head>

          <body>
          <p class="info">We are checking your model now...</p>
          <img class="img-centre" src="http://mimoza.bordeaux.inria.fr/lib/modelmap/loader.gif" id="img" />
          <div id="hidden" style="visibility:hidden;height:0px;">"""
)
sys.stdout.flush()

result, args = upload_file()
url = MIMOZA_UPLOAD_ERROR_URL

if OK == result:
    (m_id, m_name, m_dir_id) = args
    create_thanks_for_uploading_html(m_id, m_name, "../html", m_dir_id, MIMOZA_URL, "comp.html", groups_suffix="")
    url = "%s/%s/index.html" % (MIMOZA_URL, m_dir_id)
elif ALREADY_EXISTS == result:
    model_id, m_dir_id = args
    url = "%s/%s/index.html" % (MIMOZA_URL, m_dir_id)
elif ALREADY_GENERALIZED == result:
    (m_id, m_name, m_dir_id) = args
    create_thanks_for_uploading_html(
        m_id, m_name, "../html", m_dir_id, MIMOZA_URL, "comp.html", generate_uploaded_generalized_sbml_html
    )
    url = "%s/%s/index.html" % (MIMOZA_URL, m_dir_id)


print(
    """</div>
          </body>
Пример #4
0
try:
    logging.info('calling model_generalisation library')
    reader = libsbml.SBMLReader()
    input_document = reader.readSBML(sbml)
    input_model = input_document.getModel()
    m_id = input_model.getId()

    sbml_directory = dirname(abspath(sbml))
    groups_sbml = os.path.join(sbml_directory, '%s_with_groups.xml' % m_id)

    if not os.path.exists(groups_sbml):
        chebi = parse_simple(get_chebi())
        gen_sbml = os.path.join(sbml_directory, '%s_generalized.xml' % m_id)
        r_id2g_id, s_id2gr_id, species_id2chebi_id, ub_sps = generalize_model(sbml, chebi, groups_sbml, gen_sbml)
    create_thanks_for_uploading_html(m_id, input_model.getName(), '../html', m_dir_id,
                                     MIMOZA_URL, 'comp.html', generate_generalization_finished_html)

except Exception as e:
    logging.info(e)
    url = MIMOZA_ERROR_URL

sys.stdout.flush()

print('''</div>
          </body>
          <script type="text/javascript">
                window.location = "%s"
          </script>
        </html>''' % url)
sys.stdout.flush()