Exemplo n.º 1
0
def convert_file(filename, arguments):
  """Parse in a Bio-PEPA file, translate to SBML and create an
     SBML file which should be the translated Bio-PEPA model.
  """
  model_file = open(filename, "r")
  parse_result = biopepa_parser.parse_model_file_exit_on_error(model_file)
  model_file.close()

  document = translate_biopepa_model(parse_result)
  sbml_ast.output_to_sbml_file(filename, arguments, document)
Exemplo n.º 2
0
def translate_file(filename, arguments):
  """Translate a facile file into sbml"""
  model_file = open(filename, "r")
  try:
    facile_model = facile_parser.parse_model_file(model_file)
  except parcon.ParseException as parse_except:
    print parse_except
    sys.exit(1)
  model_file.close()

  document = translate_facile_model(facile_model, arguments)
  if not arguments.no_static_analysis:
    static_analyser_sbml.analyse_document(document, arguments)
  sbml_ast.output_to_sbml_file(filename, arguments, document)