microbetag.seed_complementarity¶
Classes¶
Computes seed and non-seed sets and then exports complementarities. |
Functions¶
|
Check if KEGG MODULE related |
|
Load map file with KEGG modules and their terms and return a set with all the KOs there |
|
Progress bar updater. |
|
Generate and return two lists: one with the fixed item in the first position and one with it in the second. |
|
|
|
Loads mapping files to be used for the building of the cx2 network. |
|
|
|
|
|
Module Contents¶
- class microbetag.seed_complementarity.ExportSeedComplementarities(config: microbetag.config.Config)[source]¶
Computes seed and non-seed sets and then exports complementarities.
It saves corresponding sets to json files.
Invokes edited version PhyloMInt modules as edited from microbetag team to support parallel calculation of the seed and non seed sets, and to consider reaction reversibility.
- Cite:
Lam TJ, Stamboulian M, Han W, Ye Y. Model-based and phylogenetically adjusted quantification of metabolic interaction between microbial species. PLoS computational biology. 2020 Oct 30;16(10):e1007951.
Note
Thanks to the prev_conf and the prev_nonseeds attributes of the
Configclass,ExportSeedComplementaritiesis able to use pre-calculated seed and non-seed sets. This is how the on-the-fly version of microbetag runs the seed complementarity step.- get_scores_and_compls() Tuple[pandas.DataFrame, dict] | None[source]¶
Based on the seed and non-seed sets calculated, get all pairwise competition and cooperation scores, and the seed complementarities between the models under study.
Returns the a dictionary in case of the API or builds the the seed_complements.pckl file in the stand-alone.
- species_scores_compls(species: str) Tuple[set, dict] | Dict[source]¶
Get scores and complements for a specific model (species). In the stand-alone version, it writes the seed scores file.
Note
Since, we get all pairwise combinations, we do not care of using the as_donor case for a species, since it’s gonna be calculated when the other species is the beneficiary
- process_sbml(sbml_path: str, maxcc: int = 2)[source]¶
For each SBML model file (.xml) extract seeds, non-seeds and confidence scores using the PhyloMint adapted/refined approach of ours, i.e. building a directed graph with only the cytosol reactions, considering for the reversibility of a reaction.
Check if KEGG MODULE related
Load map file with KEGG modules and their terms and return a set with all the KOs there
- microbetag.seed_complementarity.generate_fixed_pairwise_comparisons(fixed_item, reconstruction_filenames)[source]¶
Generate and return two lists: one with the fixed item in the first position and one with it in the second.
- microbetag.seed_complementarity.load_seed_complement_files(path_to_kegg_seed_mappings)[source]¶
Loads mapping files to be used for the building of the cx2 network.