IO

plaintext contains the functions to read and write stoichiometric models in plaintext. stoic contains a function to generate a list of reaction strings, ready to be written in plaintext, given a stoichiometric matrix.

Plaintext

This module implements methods for reading and writing models using a plain text format. Adapted from https://github.com/cdanielmachado/framed

Author: Daniel Machado

set_up_grasp_models.io.plaintext.import_model_from_plaintext(filename)

Reads a model from a file.

Parameters

filename (str) – file path.

Return type

Model

Returns

A Model object (or respective subclass).

set_up_grasp_models.io.plaintext.write_to_plaintext(rxn_strings, file_out, print_instructions=True)

Writes a model to a file.

Parameters
  • rxn_strings (list) – list of string reactions.

  • file_out (str) – file path.

  • print_instructions (bool) – print plain text format instructions as header.

Returns

None

Stoic

set_up_grasp_models.io.stoic.import_stoic(file_in)

Gets the reaction strings from the stoichiometry matrix defined in the GRASP input models.

Parameters

file_in (str) – path to file containing the model.

Return type

tuple

Returns

A metabolite list, a reaction list, and a reaction strings list.