API¶
-
class
scenario.
Rule
(rulename, probability, smarts)¶ Class to contain a metabolic rule
Parameters: - rulename – A string containing a unique name of the rule
- probability – A probability value between 0 and 1 indicating the empirical success rate of the rule
- smarts – A reaction smarts describing the chemical transformation of the rule
-
class
scenario.
Scenario
(scenario)¶ Class to read and process metabolic scenario
Parameters: scenario – A list of lists, each representing a metabolic phase as [name_of_file_containing_rules, number_of_cycles_to_apply] -
run
(parentmol)¶ Parameters: parentmol – An RDKit molecule Returns: A sygma.Tree object
-
-
class
tree.
Tree
(parentmol=None)¶ Class to build and analyse a metabolic tree
Parameters: parentmol – An RDKit molecule -
add_coordinates
()¶ Add missing atomic coordinates to all metabolites
-
calc_scores
()¶ Calculate probability scores for all metabolites
-
metabolize_all_nodes
(rules, cycles=1)¶ Metabolize all nodes according to [rules], for [cycles] number of cycles
Parameters: - rules – List of rules
- cycles – Integer indicating the number of subsequent steps to apply the rules
-
to_list
(filter_small_fragments=True, parent_column='parent')¶ Generate a list of metabolites
Parameters: - filter_small_fragments – Boolean to activate filtering all metabolites with less then 15% of original atoms (of the parent)
- parent_column – String containing the name for the column with the parent molecule
Returns: A list of dictionaries for each metabolites, containing the SyGMa_metabolite (an RDKit Molecule), SyGMa_pathway and SyGMa_score, sorted by decreasing probability.
-
to_smiles
(filter_small_fragments=True)¶ Generate a smiles list of metabolites
Parameters: filter_small_fragments – Boolean to activate filtering all metabolites with less then 15% of original atoms (of the parent) Returns: A list of metabolites as list [[SyGMa_metabolite as smiles, SyGMa_score]]
sorted by decreasing probability score.
-
write_sdf
(file=<open file '<stdout>', mode 'w'>, filter_small_fragments=True)¶ Generate an SDFile with metabolites including the SyGMa_pathway and the SyGMa score as properties
Parameters: - file – The SDF file to write to
- filter_small_fragments – Boolean to activate filtering all metabolites with less then 15% of original atoms (of the parent)
-
-
class
treenode.
TreeNode
(mol, parent='', rule=None, score=None, pathway='')¶ Class containing a node of the SyGMa tree
Key mol: RDKit Molecule Key parents: Dictonary {inchikey_of_parent: rulename_transforming_parent_to_self} Key children: List of inchikeys of the child nodes Key score: Value between 0 and 1 Key pathway: String describing the pathway from parent to self Key n_original_atoms: Integer, number of atoms originating from parent or None if not yet determined -
gen_coords
()¶ Calculate 2D positions for atoms in self.mol without coordinates
-