efmlrs.postprocessing package

Submodules

efmlrs.postprocessing.decompressing module

efmlrs.postprocessing.decompressing.build_reverse_mapping(infofile, counter)[source]

Reads compression information form infofile and builds a mapping for deompressions which is in reversed order of the previously applied compressions.

Parameters:
  • infofile – file automatically created during compressions, containing all information for decompressions
  • counter (int) – number of compression rounds
Returns:

mappings - list of different tuple with compression information for each compression step

efmlrs.postprocessing.decompressing.decompressing(compressed_efms, outputfile, mappings, bound_info)[source]

Iteratively decompresses one efm after another by applying decompressions according to decompression information stored in mappings. If model had additional boundaries: removes lambda vector entry and additional boundary reactions from current efm and normalizes it. Writes final decompressed efm to user specified output file.

Parameters:
  • compressed_efms (list) – list of lists containing compressed efms
  • outputfile – user specified filed to write decompressed files in
  • mappings – list of different tuples with compression information for each compression step
  • bound_info (int) – number of additional bounds
Returns:

None

efmlrs.postprocessing.decompressing.find_counter(infofile)[source]

Parses compression info and stores information on how many compression rounds were done during preprocessing and how many additional bounds have been applied.

Parameters:infofile – file automatically created during compressions, containing all information for decompressions
Returns:
  • round_counter - int number of compression rounds
  • bounds - int number of bounds
efmlrs.postprocessing.decompressing.normalize_efms(decompressed, bound_info)[source]

Only called if model had additional boundaries. Removes lambda vector entry and additional boundary reactions from current efm and normalizes it.

Parameters:
  • decompressed (list) – current efm as list
  • bound_info (int) – number of additional bounds
Returns:

decompressed: current efm as list

efmlrs.postprocessing.decompressing.run(compressed_efms, infofile, outputfile)[source]

Entry point for decompressing. Reads compression information form infofile and builds a mapping for deompressions which is in reversed order of the previously applied compressions. Iteratively decompresses one efm after another by applying decompressions according to decompression information stored in mappings. If model had additional boundaries: removes lambda vector entry and additional boundary reactions from current efm and normalizes it. Writes final decompressed efm to user specified output file.

Parameters:
  • infofile – file automatically created during compressions, containing all information for decompressions
  • compressed_efms (list) – compressed efms
  • compression_infos – info file created during preprocessing
  • outputfile – path to output file
Returns:

None

efmlrs.postprocessing.decompressing.write_decompressed_efms(decompressed, outputfile)[source]

Writes final decompressed efm to user specified output file.

Parameters:
  • decompressed – current efm as list
  • outputfile – user specified filed to write decompressed files in
Returns:

None

efmlrs.postprocessing.get_data module

efmlrs.postprocessing.get_data.get_efmtool_efms(inputfile)[source]

Entry point for get_data for efmtool. Reads efmtool output file and stores compressed efms in a list of lists.

Parameters:inputfile – efmtool output file
Returns:list compressed_efms
efmlrs.postprocessing.get_data.get_mplrs_efms(inputfile, infofile)[source]

Entry poitn for get_data for mplrs. Parses mplrs output file, merges splitted reactions, removes rows containing only zeros and stores compressed efms in a list of lists.

Parameters:
  • inputfile – mplrs output file
  • infofile – info file created during preprocessing
Returns:

list compressed_efms

efmlrs.postprocessing.get_data.get_rev_info(infofile)[source]

Reads info file and stores reaction reversibility information in a list.

Parameters:infofile – info file created during preprocessing
Returns:list rev_info
efmlrs.postprocessing.get_data.parse_lrs(inputfile, reversibilities)[source]

Parses mplrs output file, merges splitted reactions, removes rows containing only zeros and stores compressed efms in a list of lists.

Parameters:
  • inputfile – mplrs output file
  • reversibilities (list) – list of reaction reversibilities
Returns:

list compressed_efms - list of lists with compressed efms

efmlrs.postprocessing.get_data.remove_zeros(row)[source]

Checks if extracted efm (row) contains only zeros.

Parameters:row (list) – extracted efm
Returns:row or None

Module contents