Synleth Reference
API Documentation for the synleth submodule
Fast Essentiality
Functions for performing fast gene and reaction essentiality analysis
- metworkpy.synleth.fastess.fast_ess_genes(model: Model, essentiality_threshold=0.1, pfba_tolerance: float = 1e-07, **kwargs) list[str]
Find which genes are essential for the model to grow
- Parameters:
model (cobra.Model) – The genome scale metabolic model for which to find essential genes
essentiality_threshold (float) – The proportion of optimal growth, below which a gene knockout is considered essential (default 0.1)
pfba_tolerance (1e-7) – Value below which reaction fluxes are considered 0 (default 1e-7)
**kwargs – Keyword arguments passed to COBRApy’s single_gene_deletion function
- Returns:
List of reactions which are essential for the model to be able to grow
- Return type:
unknown
Notes
Uses parsimonious flux balance analysis filter out non-essential genes, then iterates through remaining genes to check if they are essential.
- metworkpy.synleth.fastess.fast_ess_rxn(model: Model, essentiality_threshold=0.1, pfba_tolerance: float = 1e-07, **kwargs) list[str]
Find which reactions are essential for the model to grow
- Parameters:
model (cobra.Model) – The genome scale metabolic model for which to find essential reactions
essentiality_threshold (float) – The proportion of optimal growth, below which a reaction knockout is considered essential (default 0.1)
pfba_tolerance (1e-7) – Value below which reaction fluxes are considered 0 (default 1e-7)
**kwargs – Keyword arguments passed to COBRApy’s single_reaction_deletion
- Returns:
List of reactions which are essential for the model to be able to grow
- Return type:
unknown
Notes
Uses parsimonious flux balance analysis filter out non-essential reactions, then iterates through remaining reactions to check if they are essential.
Fast Synthetic Lethality
Module for finding Synthetic Lethality Gene Groups in Cobra Models
- metworkpy.synleth.fastsl.find_synthetic_lethal_genes(model: Model, max_depth: int = 3, genes_of_interest: None | Iterable = None, active_cutoff: float = 1e-07, pfba_fraction_of_optimum: float = 0.95, essential_proportion: float = 0.01, processes: int | None = None, show_queue_size: bool = False) list[set[str]]
Find groups of genes whose combined knockout leads to growth inhibition
- Parameters:
model (cobra.Model) – Cobra model to find synthetic lethal groups of genes for
max_depth (int) – Maximum number of genes in a synthetic lethal group
genes_of_interest (None | Iterable) – Set of genes of interest, this method will only find synthetic lethal groups which include at least one of these genes. Should be an iterable (list, set, etc.) of gene id strings, which match the gene ids in the model. If None, will default to all genes in the model. This filtering is done after the synthetic lethal sets are already found (see note for reason) and so is for convenience rather than speed.
active_cutoff (float) – Minimum (absolute value of) flux through a reaction to be considered active. All reactions found to have a flux below this during pFBA will be ignored when finding essential genes.
pfba_fraction_of_optimum (float) – Proportion of maximum objective maximum required to be maintained during pFBA. The original objective function is constrained to be greater than the maximum objective multiplied by pfba_fraction_of_optimum
essential_proportion (float) – Proportion of maximum objective value, below which a gene knock out is considered growth inhibitory. A value of 0.01 indicates that if the maximum objective value after a gene knock out is less than 1% of the value before the knockout, the gene is essential.
processes (int | None) – Number of processes to use during calculations, if None will use all available
show_queue_size (bool) – If True will print the approximate current queue size each time a job is taken from the queue during calculations. Default False.
- Returns:
List of synthetically lethal groups of genes, recorded as sets of gene ids
- Return type:
list[set[str]]
Notes
For parallel operation, 3 processes is a recommended minimum. Currently, the parallel implementation requires a manager process (which handles the queue of gene sets to be processed), and so if processes=2 this will end up using only 1 core to do most of the calculation, with overhead from parallel processing causing this to likely be slower than serial operation. Currently, setting processes=2 will result in this function using 2 processes, but in future this might be changed so that it just uses the faster serial implementation in this case. Further, due to the relatively high overhead in the parallel implementation, the actual speedup granted by the parallel implementation may be relatively small (especially on smaller models).
For the genes_of_interest argument, this function still needs to check all synthetic lethal groups exhaustively, so it will actually take longer than if this is not provided. The reason all groups have to be checked exhaustively is to ensure that no subsets of the group are already synthetically lethal. Take for example a set of genes A, B, C, D, E, F. If A and B together are essential, and you are interested in the gene set D,E,F, then the knock out of A,B,D would be essential. Even though you are interested in D, the essentiality of this gene set is caused by A and B alone. To ensure that all synthetic lethal gene sets are actually synthetically lethal (rather than a superset including irrelevant genes), the gene sets are filtered for any sets that are supersets of other sets. This means that it is impossible to only check sets that include genes of interest, since (like in the example), the genes causing the essentiality maybe outside the genes of interest.