efmlrs.preprocessing.compressions package

Submodules

efmlrs.preprocessing.compressions.deadend module

efmlrs.preprocessing.compressions.deadend.check_reactions(smatrix, i, reversibilities)[source]

Checks if corresponding reactions to a deadend metabolite are irreversible. Returns list of corresponding irreversible reactions to be removed.

Parameters:
  • smatrix – sympy matrix that contains the stoichiometric matrix
  • i (int) – index of deadend metabolite
  • reversibilities (list) – list of reaction reversibilities
Returns:

list of reaction names to be removed from stoichiometric matrix

efmlrs.preprocessing.compressions.deadend.check_row(row)[source]

Checks if rows qualifies as deadend metabolite. If row consists of only zeros and either positive or negative entries, it is a deadend metabolite and functions returns true.

Parameters:row – row of stoichiometric matrix
Returns:bool
efmlrs.preprocessing.compressions.deadend.find_deadends(smatrix, reversibilities)[source]

Checks all rows of stoichiometric matrix if they are deadend metabolites. Checks if corresponding reactions are irreversible.

Parameters:
  • smatrix – sympy matrix that contains the stoichiometric matrix
  • reversibilities (list) – list of reaction reversibilities
Returns:

  • remove_reactions - list of reaction names that will be removed
  • remove_metabolites - list of metabolite names that will be removed

efmlrs.preprocessing.compressions.deadend.run(smatrix, reactions, reversibilities, metabolites, core_name, outer_counter)[source]

Entry point for deadend compression. Finds and removes deadend metabolites and corresponding reaction that only contain zeros after a deadend metabolite is removed. This is done iteratively as long as deadend metabolites or corresponding reactions are found in the stoichiometric matrix. Writes information on removed reactions and metabolites to compression log.

Parameters:
  • smatrix – sympy matrix that contains the stoichiometric matrix
  • reactions (list) – list of reaction names
  • reversibilities (list) – list of reaction reversibilities
  • metabolites (list) – list of metabolite names
  • core_name (str) – string that consists of path to and name of the input file excluding file extension
  • outer_counter (int) – int that counts how many iterative steps with all compressions have been performed
Returns:

  • smatrix - sympy matrix reduced stoichiometric matrix
  • reactions - list of reduced reactions names
  • reversibilities - list of reduced reaction reversibilities
  • metabolites - list of reduced metabolite names

efmlrs.preprocessing.compressions.deadend.write_deadend_info(core_name, outer_counter, removedReactions)[source]

Writes compression information to *.info file for decompression during post-processing.

Parameters:
  • core_name (str) – string that consists of path to and name of the input file excluding file extension
  • outer_counter (int) – int that counts how many iterative steps with all compressions have been performed
  • removedReactions (list) – list of removed reaction indices
Returns:

None

efmlrs.preprocessing.compressions.echelon module

efmlrs.preprocessing.compressions.echelon.find_redundant_metabolites(smatrix, inner_counter)[source]

Calculates the reduced row echelon form of the stoichiometric matrix. Finds metabolites that are redundant due to conservation relations.

Parameters:
  • smatrix – sympy matrix that contains the stoichiometric matrix
  • inner_counter (int) – integer that counts iterative steps of nullspace compression
Returns:

list redundant_metas: list of metabolites to be removed

efmlrs.preprocessing.compressions.echelon.remove_redundant_metabolites(smatrix, metabolites, redundant_metas)[source]

Removes redundant metabolites from stoichiometric matrix and from list of metabolite names. Writes compression information to log file. (https://academic.oup.com/bioinformatics/article/24/19/2229/246674)

Parameters:
  • smatrix – sympy matrix that contains the stoichiometric matrix
  • metabolites (list) – list of metabolite names
  • redundant_metas (list) – list of metabolites to be removed
Returns:

  • smatrix - sympy matrix reduced stoichiometric matrix
  • metabolites - list of reduced metabolite names

efmlrs.preprocessing.compressions.echelon.run(smatrix, metabolites)[source]

Entry point for echelon compression. Iteratively finds inconsistencies due to conservation relations of metabolites in the reduced row echelon form of the stoichiometric matrix and removes them.

Parameters:
  • smatrix – sympy matrix that contains the stoichiometric matrix
  • metabolites (list) – list of metabolite names
Returns:

  • smatrix - sympy matrix reduced stoichiometric matrix
  • metabolites - list of reduced metabolite names

efmlrs.preprocessing.compressions.null_space module

efmlrs.preprocessing.compressions.one2many module

Module contents