microberx.MetabolitePredictor
This is a module that provides the main classes to predicted metabolites using MicrobeRX.
The module contains the following classes:
MetabolitePredictor: A class for predicting metabolites using reaction rules.
RunPredictionRule: A class for predicting metabolites based on a single reaction rule.
Classes
A class for predicting metabolites using reaction rules. |
|
A class for predicting reactions based on reaction rules. |
Module Contents
- class microberx.MetabolitePredictor.MetabolitePredictor(query, query_name='metabolite', cut_off=0.6, biosystem='all')[source]
A class for predicting metabolites using reaction rules.
- Parameters:
rules_table (str) – The path to a table containing reaction rules and associated information.
query (rdkit.Chem.Mol) –
query_name (str) –
cut_off (float) –
biosystem (str) –
- predicted_metabolites[source]
A DataFrame to store predicted metabolites and associated information.
- Type:
pd.DataFrame
- reacting_atoms_in_unique_metabolites[source]
A list to store reacting atom indices in unique metabolites.
- Type:
list
- run_prediction(query: Chem.Mol, name: str = 'metabolite')[source]
Run the metabolite prediction using the provided query molecule and name.
- run_prediction()[source]
This method performs metabolite prediction using reaction rules from the rules table. It calculates confidence scores for predicted metabolites and stores the results in the ‘predicted_metabolites’ attribute.
- Parameters:
query (Chem.Mol) – The query molecule for metabolite prediction.
query_name (str, optional) – The name associated with the query molecule. Default is “metabolite”.
- Return type:
None
Example
>>> predictor = MetabolitePredictor(rules_table) >>> query_molecule = Chem.MolFromSmiles("CC(=O)O") >>> predictor.run_prediction(query_molecule, "acetate") >>> predicted_metabolites_df = predictor.predicted_metabolites
- class microberx.MetabolitePredictor.RunPredictionRule(query, rule_smarts, real_product, real_substrate)[source]
A class for predicting reactions based on reaction rules.
- Parameters:
query (Chem.Mol) – The query molecule for prediction.
rule_smarts (str) – The reaction rule in SMARTS format.
real_product (str) – The SMILES representation of the real product.
real_substrate (str) – The SMILES representation of the real substrate.
- unique_products
A dictionary to store information about unique predicted products.
- Type:
dict
- predict()[source]
This method predicts reaction products based on the provided query molecule, reaction rule, real product, and real substrate. It calculates various properties and stores the results in the ‘unique_products’ dictionary.
- Return type:
None
- __get_mol_substructure(mol_target, atom_indexes_to_keep)[source]
Get the reaction substructure from the input molecule. :return: The reaction substructure
- Parameters:
mol_target (rdkit.Chem.Mol) –
- __get_substructure_neighbors(mol_target, atom_indexes_to_keep)[source]
Get the substructure neighbors of the input molecule. :return: The substructure neighbors
- Parameters:
mol_target (rdkit.Chem.Mol) –