pygecko.reaction package

Submodules

pygecko.reaction.layout module

class pygecko.reaction.layout.Combinatorial_Layout(layout_file: Path | str, meta_data_file: Path | str, transformation: Transformation)

Bases: object

A class for storing information about a combinatorial reaction layout.

layout

DataFrame containing the combinatorial dimensions of the layout.

Type:

pd.DataFrame

transformation

Transformation object.

Type:

Transformation

meta_data

Dictionary containing the metadata of the layout.

Type:

dict

shape

Shape of the layout.

Type:

tuple

array

A numpy array containing the layout.

Type:

np.ndarray

array: ndarray
layout: DataFrame
meta_data: dict
shape: tuple
transformation: Transformation
class pygecko.reaction.layout.Product_Layout(layout_file: Path | str)

Bases: object

A class for storing information about a product layout.

layout

DataFrame containing the product layout.

Type:

pd.DataFrame

shape

Shape of the layout.

Type:

tuple

array

A numpy array containing the layout.

Type:

np.ndarray

array: ndarray
layout: DataFrame
shape: tuple

pygecko.reaction.reaction_parser module

class pygecko.reaction.reaction_parser.Reaction_Parser

Bases: object

A class wrapping the functionality of the ord-schema library of the open reaction database to create a dataset from a combinatorial reaction layout.

classmethod build_dataset(layout: Reaction_Array, yield_array: ndarray, path: str | None = None) Dataset

Returns a ORD dataset created from a combinatorial reaction layout and writes it to a file if a path is given.

Parameters:
  • layout (Reaction_Array) – Well_Plate object containing the combinatorial reaction layout.

  • yield_array (np.ndarray) – Numpy array containing the yields of the reactions.

  • path (str|None, optional) – Path to write the dataset to. Defaults to None.

Returns:

ORD dataset created from the combinatorial reaction layout.

Return type:

dataset_pb2.Dataset

classmethod create_dataset_from_layout(layout: Reaction_Array, yield_array: ndarray) Dataset

Returns a ORD dataset created from a combinatorial reaction layout.

Parameters:
  • layout (Reaction_Array) – Well_Plate object containing the combinatorial reaction layout.

  • yield_array (np.ndarray) – Numpy array containing the yields of the reactions.

Returns:

ORD dataset created from the combinatorial reaction layout.

Return type:

dataset_pb2.Dataset

pygecko.reaction.transformation module

class pygecko.reaction.transformation.Transformation(rxn_smarts: str)

Bases: object

A class for storing information about a chemical transformation.

rxn_smarts

Reaction SMARTS string.

Type:

str

transform

RDKit ChemicalReaction object.

Type:

rdkit ChemicalReaction object

rxn_smarts: str
transform: ChemicalReaction

pygecko.reaction.utilities module

pygecko.reaction.utilities.get_num_substrates(rxn_smarts: str) int

Returns the number of substrates in a reaction SMARTS string.

Parameters:

rxn_smarts (str) – Reaction SMARTS string.

Returns:

Number of substrates in the reaction.

Return type:

int

pygecko.reaction.utilities.read_json(filename: Path | str) dict

Takes a filename of a JSON file and returns the contents of the file as a dictionary.

pygecko.reaction.well_plate module

Module contents