MultiProcess
- pycomo.helper.multiprocess.fva(pycomo_model, reactions, fraction_of_optimum=None, verbose=False, processes=None, time_out=30, max_time_out=300, restart_on_timeout=False)
Performs flux variability analysis.
- Parameters:
pycomo_model – A pycomo community metabolic model
reactions – A list of reactions that should be analysed
fraction_of_optimum – The fraction of the optimal objective flux that needs to be reached
use_loop_reactions_for_ko – Find loops in the model and use these reactions as ko_candidates. Overwrites value in ko_candidates
ko_candidate_ids – Reactions to be constrained and used in the objective (as set of reaction ids)
verbose – Prints progress messages
processes – The number of processes to use for the calculation
time_out – The time in seconds to wait for a result (default=30)
max_time_out – The maximum time in seconds to wait for a result (default=300)
restart_on_timeout – If set True, the process pool restarts all unfinished jobs and increases the time_out (up to a max_time_out). Default is False
- Returns:
A dataframe of reaction flux solution ranges. Contains the columns minimum and maximum with index of reaction IDs
- pycomo.helper.multiprocess.log_call_by_verbosity(verbosity)
Function to log a message with specified verbosity.
- Parameters:
verbosity – Log level (info, warning, error, debug)
- Returns:
Logger function of specified level
- pycomo.helper.multiprocess.log_or_queue_message(verbosity, status, target=None)
Handle decision of logging a message or writing it to the status queue. If a status queue is present, the function writes to the queue, otherwise to the logger.
- Parameters:
verbosity – Log level
status – The message to be written
target – For fva steps only, set the current reaction, defaults to None
- pycomo.helper.multiprocess.loopless_fva(pycomo_model, reactions, fraction_of_optimum=None, use_loop_reactions_for_ko=False, ko_candidate_ids=None, verbose=False, processes=None, time_out=30, max_time_out=300, restart_on_timeout=False)
Performs flux variability analysis and removes futile cycles from the solutions. This is achieved by fixing the direction of reactions as found in the solution, fixing the fluxes of exchange reactions and minimizing the remaining flux values. This approach is adapted from CycleFreeFLux and its implementation in COBRApy.
- Parameters:
pycomo_model – A pycomo community metabolic model
reactions – A list of reactions that should be analysed
fraction_of_optimum – The fraction of the optimal objective flux that needs to be reached
use_loop_reactions_for_ko – Find loops in the model and use these reactions as ko_candidates. Overwrites value in ko_candidates
ko_candidate_ids – Reactions to be constrained and used in the objective (as set of reaction ids)
verbose – Prints progress messages
processes – The number of processes to use for the calculation
time_out – The time in seconds to wait for a result (default=30)
max_time_out – The maximum time in seconds to wait for a result (default=300)
restart_on_timeout – If set True, the process pool restarts all unfinished jobs and increases the time_out (up to a max_time_out). Default is False
- Returns:
A dataframe of reaction flux solution ranges. Contains the columns minimum and maximum with index of reaction IDs