diff --git a/.buildinfo b/.buildinfo new file mode 100644 index 0000000..916da58 --- /dev/null +++ b/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 9b418115cf1b3c48f5834253c0b8aaee +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/_images/sample_reaction.PNG b/_images/sample_reaction.PNG new file mode 100644 index 0000000..9c32efe Binary files /dev/null and b/_images/sample_reaction.PNG differ diff --git a/_sources/index.rst.txt b/_sources/index.rst.txt new file mode 100644 index 0000000..9981c85 --- /dev/null +++ b/_sources/index.rst.txt @@ -0,0 +1,65 @@ +rxnutils documentation +============================ + +rxnutils is a collection of routines for working with reactions, reaction templates and template extraction + +Introduction +------------ + +The package is divided into (currently) three sub-packages: + +* `chem` - chemistry routines like template extraction or reaction cleaning +* `data` - routines for manipulating various reaction data sources +* `pipeline` - routines for building and executing simple pipelines for modifying and analyzing reactions +* `routes` - routines for handling synthesis routes + +Auto-generated API documentation is available, as well as guides for common tasks. See the menu to the left. + +Installation +------------ + +For most users it is as simple as + +.. code-block:: + + pip install reaction-utils + + +`For developers`, first clone the repository using Git. + +Then execute the following commands in the root of the repository + +.. code-block:: + + conda env create -f env-dev.yml + conda activate rxn-env + poetry install + + +the `rxnutils` package is now installed in editable mode. + +Lastly, make sure to install pre-commits that are run on every commit + +.. code-block:: + + pre-commit install + + +Limitations +----------- + +* Some old RDKit wheels on pypi did not include the `Contrib` folder, preventing the usage of the `rdkit_RxnRoleAssignment` action +* The pipeline for the Open reaction database requires some additional dependencies, see the documentation for this pipeline +* Using the data piplines for the USPTO and Open reaction database requires you to setup a second python environment +* The RInChI capabilities are not supported on MacOS + + +.. toctree:: + :hidden: + + templates + uspto + ord + pipeline + routes + rxnutils \ No newline at end of file diff --git a/_sources/modules.rst.txt b/_sources/modules.rst.txt new file mode 100644 index 0000000..bce038b --- /dev/null +++ b/_sources/modules.rst.txt @@ -0,0 +1,7 @@ +rxnutils +======== + +.. toctree:: + :maxdepth: 4 + + rxnutils diff --git a/_sources/ord.rst.txt b/_sources/ord.rst.txt new file mode 100644 index 0000000..c27b383 --- /dev/null +++ b/_sources/ord.rst.txt @@ -0,0 +1,106 @@ +Open reaction database +======================= + +``rxnutils`` contain two pipelines that together imports and prepares the reaction data from the `Open reaction database `_ so that it can be used on modelling. + +It is a complete end-to-end pipeline that is designed to be transparent and reproducible. + +Pre-requisites +-------------- + +The reason the pipeline is divided into two blocks is because the dependencies of the atom-mapper package (``rxnmapper``) is incompatible with +the dependencies ``rxnutils`` package. Therefore, to be able to use to full pipeline, you need to setup two python environment. + +1. Install ``rxnutils`` according to the instructions in the `README`-file + +2. Install the ``ord-schema`` package in the `` rxnutils`` environment + + conda activate rxn-env + python -m pip install ord-schema + +3. Download/Clone the ``ord-data`` repository according to the instructions here: https://github.com/Open-Reaction-Database/ord-data + + git clone https://github.com/open-reaction-database/ord-data.git . + +Note down the path to the repository as this needs to be given to the preparation pipeline + +4. Install ``rxnmapper`` according to the instructions in the repo: https://github.com/rxn4chemistry/rxnmapper + + +.. code-block:: + + conda create -n rxnmapper python=3.6 -y + conda activate rxnmapper + conda install -c rdkit rdkit=2020.03.3.0 + python -m pip install rxnmapper + + +5. Install ``Metaflow`` and ``rxnutils`` in the new environment + + +.. code-block:: + + python -m pip install metaflow + python -m pip install --no-deps --ignore-requires-python . + + +Usage +----- + +Create a folder for the ORD data and in that folder execute this command in the ``rxnutils`` environment + + +.. code-block:: + + conda activate rxn-env + python -m rxnutils.data.ord.preparation_pipeline run --nbatches 200 --max-workers 8 --max-num-splits 200 --ord-data ORD_DATA_REPO_PATH + + +and then in the environment with the ``rxnmapper`` run + + +.. code-block:: + + conda activate rxnmapper + python -m rxnutils.data.mapping_pipeline run --data-prefix ord --nbatches 200 --max-workers 8 --max-num-splits 200 + + +The ``-max-workers`` flag should be set to the number of CPUs available. + +On 8 CPUs and 1 GPU the pipeline takes a couple of hours. + + +Artifacts +--------- + +The pipelines creates a number of `tab-separated` CSV files: + + * `ord_data.csv` is the imported ORD data + * `ord_data_cleaned.csv` is the cleaned and filter data + * `ord_data_mapped.csv` is the atom-mapped, modelling-ready data + + +The cleaning is done to be able to atom-map the reactions and are performing the following tasks: + * Ignore extended SMILES information in the SMILES strings + * Remove molecules not sanitizable by RDKit + * Remove reactions without any reactants or products + * Move all reagents to reactants + * Remove the existing atom-mapping + * Remove reactions with more than 200 atoms when summing reactants and products + +(the last is a requisite for ``rxnmapper`` that was trained on a maximum token size roughly corresponding to 200 atoms) + + +The ``ord_data_mapped.csv`` files will have the following columns: + + * ID - unique ID from the original database + * Dataset - the name of the dataset from which this is reaction is taken + * Date - the date of the experiment as given in the database + * ReactionSmiles - the original reaction SMILES + * Yield - the yield of the first product of the first outcome, if provided + * ReactionSmilesClean - the reaction SMILES after cleaning + * BadMolecules - molecules not sanitizable by RDKit + * ReactantSize - number of atoms in reactants + * ProductSize - number of atoms in products + * mapped_rxn - the mapped reaction SMILES + * confidence - the confidence of the mapping as provided by ``rxnmapper`` diff --git a/_sources/pipeline.rst.txt b/_sources/pipeline.rst.txt new file mode 100644 index 0000000..11431eb --- /dev/null +++ b/_sources/pipeline.rst.txt @@ -0,0 +1,140 @@ +Pipeline +======== + +``rxnutils`` provide a simple pipeline to perform simple tasks on reaction SMILES and templates in a CSV-file. + + +The pipeline works on `tab-separated` CSV files (TSV files) + + +Usage +----- + +To exemplify the pipeline capabilities, we will have a look at the pipeline used to clean the USPTO data. + +The input to the pipeline is a simple YAML-file that specifies each action to take. The actions will be executed +sequentially, one after the other and each action takes a number of input arguments. + +This is the YAML-file used to clean the USPTO data: + +.. code-block:: yaml + + trim_rxn_smiles: + in_column: ReactionSmiles + out_column: ReactionSmilesClean + remove_unsanitizable: + in_column: ReactionSmilesClean + out_column: ReactionSmilesClean + reagents2reactants: + in_column: ReactionSmilesClean + out_column: ReactionSmilesClean + remove_atom_mapping: + in_column: ReactionSmilesClean + out_column: ReactionSmilesClean + reactantsize: + in_column: ReactionSmilesClean + productsize: + in_column: ReactionSmilesClean + query_dataframe1: + query: "ReactantSize>0" + query_dataframe2: + query: "ProductSize>0" + query_dataframe3: + query: "ReactantSize+ProductSize<200" + + +The first action is called ``trim_rxn_smiles`` and two arguments are given: ``in_column`` specifying which column to use as input and ``out_column`` specifying which column +to use as output. + +The following actions ``remove_unsanitizable``, ``reagents2reactants``, ``remove_atom_mapping``, ``reactantsize``, ``productsize`` works the same way, but might use other columns to specified for output. + +The last three actions are actually the same action but executed with different arguments. They therefore have to be postfixed with 1, 2 and 3. +The action ``query_dataframe`` takes a ``query`` argument and removes a number of rows not matching the query. + +If we save this to ``clean_pipeline.yml`` and given that we have a tab-separated file with USPTO data called ``uspto_data.csv`` we can run the following command + +.. code-block:: + + python -m rxnutils.pipeline.runner --pipeline clean_pipeline.yml --data uspto_data.csv --output uspto_cleaned.csv + + +or we can alternatively run it from a python method like this + +.. code-block:: + + from rxnutils.pipeline.runner import main as validation_runner + + validation_runner( + [ + "--pipeline", + "clean_pipeline.yml", + "--data", + "uspto_data.csv", + "--output", + "uspto_cleaned.csv", + ] + ) + +Actions +------- + +To find out what actions are available, you can type + +.. code-block:: + + python -m rxnutils.pipeline.runner --list + +Development +----------- + +New actions can easily be added to the pipeline framework. All of the actions are implemented in one of four modules + + + * ``rxnutils.pipeline.actions.dataframe_mod`` - actions that modify the dataframe, e.g., removing rows or columns + * ``rxnutils.pipeline.actions.reaction_mod`` - actions that modify reaction SMILES + * ``rxnutils.pipeline.actions.dataframe_props`` - actions that compute properties from reaction SMILES + * ``rxnutils.pipeline.actions.templates`` - actions that process reaction templates + + +To exemplify, let's have a look at the ``productsize`` action + + +.. code-block:: python + + @action + @dataclass + class ProductSize: + """Action for counting product size""" + + pretty_name: ClassVar[str] = "productsize" + in_column: str + out_column: str = "ProductSize" + + def __call__(self, data: pd.DataFrame) -> pd.DataFrame: + smiles_col = global_apply(data, self._row_action, axis=1) + return data.assign(**{self.out_column: smiles_col}) + + def __str__(self) -> str: + return f"{self.pretty_name} (number of heavy atoms in product)" + + def _row_action(self, row: pd.Series) -> str: + _, _, products = row[self.in_column].split(">") + products_mol = Chem.MolFromSmiles(products) + + if products_mol: + product_atom_count = products_mol.GetNumHeavyAtoms() + else: + product_atom_count = 0 + + return product_atom_count + +The action is defined as a class ``ProductSize`` that has two class-decorators. +The first ``@action`` will register the action in a global action list and second ``@dataclass`` is dataclass decorator from the standard library. +The ``pretty_name`` class variable is used to identify the action in the pipeline, that is what you are specifying in the YAML-file. +The other two ``in_column`` and ``out_column`` are the arguments you can specify in the YAML file for executing the action, they can have default +values in case they don't need to be specified in the YAML file. + +When the action is executed by the pipeline the ``__call__`` method is invoked with the current Pandas dataframe as the only argument. This method +should return the modified dataframe. + +Lastly, it is nice to implement a ``__str__`` method which is used by the pipeline to print useful information about the action that is executed. diff --git a/_sources/routes.rst.txt b/_sources/routes.rst.txt new file mode 100644 index 0000000..ac7a0a6 --- /dev/null +++ b/_sources/routes.rst.txt @@ -0,0 +1,68 @@ +Routes +====== + +``rxnutils`` contains routines to analyse synthesis routes. There are a number of readers that can be used to read routes from a number of +formats, and there are routines to score the different routes. + +Reading +------- + +The simplest route format supported is a text file, where each reaction is written as a reaction SMILES in a line. +Routes are separated by new-line + +For instance: + +.. code-block:: + + CC(C)N.Clc1cccc(Nc2ccoc2)n1>>CC(C)Nc1cccc(Nc2ccoc2)n1 + Brc1ccoc1.Nc1cccc(Cl)n1>>Clc1cccc(Nc2ccoc2)n1 + + Nc1cccc(NC(C)C)n1.Brc1ccoc1>>CC(C)Nc1cccc(Nc2ccoc2)n1 + CC(C)N.Nc1cccc(Cl)n1>>Nc1cccc(NC(C)C)n1 + + +If this is saved to ``routes.txt``, these can be read into route objects with + +.. code-block:: + + from rxnutils.routes.readers import read_reaction_lists + routes = read_reaction_lists("reactions.txt") + + +If you have an environment with ``rxnmapper`` installed and the NextMove software ``namerxn`` in your PATH then you can +add atom-mapping and reaction classes to these routes with + +.. code-block:: + + # This can be set on the command-line as well + import os + os.environ["RXNMAPPER_ENV_PATH"] = "/home/username/miniconda/envs/rxnmapper/" + + for route in routes: + route.assign_atom_mapping(only_rxnmapper=True) + routes[1].remap(routes[0]) + + +The last line of code also make sure that the second route shares mapping with the first route. + + +Other readers are available + +* ``read_aizynthcli_dataframe`` - for reading routes from aizynthcli output dataframe +* ``read_reactions_dataframe`` - for reading routes stored as reactions in a dataframe + + +For instance, to read routes from a dataframe with reactions. You can do something like what follows. +The dataframe has column ``reaction_smiles`` that holds the reaction SMILES, and the individual routes +are identified by a ``target_smiles`` and ``route_id`` column. The dataframe also has a column ``classification``, +holding the NextMove classification. The dataframe is called ``data``. + +.. code-block:: + + from rxnutils.routes.readers import read_reactions_dataframe + routes = read_reactions_dataframe( + data, + "reaction_smiles", + group_by=["target_smiles", "route_id"], + metadata_columns=["classification"] + ) diff --git a/_sources/rxnutils.chem.rinchi.rst.txt b/_sources/rxnutils.chem.rinchi.rst.txt new file mode 100644 index 0000000..565a824 --- /dev/null +++ b/_sources/rxnutils.chem.rinchi.rst.txt @@ -0,0 +1,29 @@ +rxnutils.chem.rinchi package +============================ + +Submodules +---------- + +rxnutils.chem.rinchi.download\_rinchi module +-------------------------------------------- + +.. automodule:: rxnutils.chem.rinchi.download_rinchi + :members: + :undoc-members: + :show-inheritance: + +rxnutils.chem.rinchi.rinchi\_api module +--------------------------------------- + +.. automodule:: rxnutils.chem.rinchi.rinchi_api + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: rxnutils.chem.rinchi + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/rxnutils.chem.rst.txt b/_sources/rxnutils.chem.rst.txt new file mode 100644 index 0000000..709525e --- /dev/null +++ b/_sources/rxnutils.chem.rst.txt @@ -0,0 +1,61 @@ +rxnutils.chem package +===================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + rxnutils.chem.rinchi + +Submodules +---------- + +rxnutils.chem.augmentation module +--------------------------------- + +.. automodule:: rxnutils.chem.augmentation + :members: + :undoc-members: + :show-inheritance: + +rxnutils.chem.cgr module +------------------------ + +.. automodule:: rxnutils.chem.cgr + :members: + :undoc-members: + :show-inheritance: + +rxnutils.chem.reaction module +----------------------------- + +.. automodule:: rxnutils.chem.reaction + :members: + :undoc-members: + :show-inheritance: + +rxnutils.chem.template module +----------------------------- + +.. automodule:: rxnutils.chem.template + :members: + :undoc-members: + :show-inheritance: + +rxnutils.chem.utils module +-------------------------- + +.. automodule:: rxnutils.chem.utils + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: rxnutils.chem + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/rxnutils.data.ord.rst.txt b/_sources/rxnutils.data.ord.rst.txt new file mode 100644 index 0000000..6394e6b --- /dev/null +++ b/_sources/rxnutils.data.ord.rst.txt @@ -0,0 +1,29 @@ +rxnutils.data.ord package +========================= + +Submodules +---------- + +rxnutils.data.ord.import\_ord\_dataset module +--------------------------------------------- + +.. automodule:: rxnutils.data.ord.import_ord_dataset + :members: + :undoc-members: + :show-inheritance: + +rxnutils.data.ord.preparation\_pipeline module +---------------------------------------------- + +.. automodule:: rxnutils.data.ord.preparation_pipeline + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: rxnutils.data.ord + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/rxnutils.data.rst.txt b/_sources/rxnutils.data.rst.txt new file mode 100644 index 0000000..7d9b977 --- /dev/null +++ b/_sources/rxnutils.data.rst.txt @@ -0,0 +1,54 @@ +rxnutils.data package +===================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + rxnutils.data.ord + rxnutils.data.uspto + +Submodules +---------- + +rxnutils.data.base\_pipeline module +----------------------------------- + +.. automodule:: rxnutils.data.base_pipeline + :members: + :undoc-members: + :show-inheritance: + +rxnutils.data.batch\_utils module +--------------------------------- + +.. automodule:: rxnutils.data.batch_utils + :members: + :undoc-members: + :show-inheritance: + +rxnutils.data.mapping module +---------------------------- + +.. automodule:: rxnutils.data.mapping + :members: + :undoc-members: + :show-inheritance: + +rxnutils.data.mapping\_pipeline module +-------------------------------------- + +.. automodule:: rxnutils.data.mapping_pipeline + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: rxnutils.data + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/rxnutils.data.uspto.rst.txt b/_sources/rxnutils.data.uspto.rst.txt new file mode 100644 index 0000000..9a660d2 --- /dev/null +++ b/_sources/rxnutils.data.uspto.rst.txt @@ -0,0 +1,45 @@ +rxnutils.data.uspto package +=========================== + +Submodules +---------- + +rxnutils.data.uspto.combine module +---------------------------------- + +.. automodule:: rxnutils.data.uspto.combine + :members: + :undoc-members: + :show-inheritance: + +rxnutils.data.uspto.download module +----------------------------------- + +.. automodule:: rxnutils.data.uspto.download + :members: + :undoc-members: + :show-inheritance: + +rxnutils.data.uspto.preparation\_pipeline module +------------------------------------------------ + +.. automodule:: rxnutils.data.uspto.preparation_pipeline + :members: + :undoc-members: + :show-inheritance: + +rxnutils.data.uspto.uspto\_yield module +--------------------------------------- + +.. automodule:: rxnutils.data.uspto.uspto_yield + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: rxnutils.data.uspto + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/rxnutils.pipeline.actions.rst.txt b/_sources/rxnutils.pipeline.actions.rst.txt new file mode 100644 index 0000000..4f89310 --- /dev/null +++ b/_sources/rxnutils.pipeline.actions.rst.txt @@ -0,0 +1,45 @@ +rxnutils.pipeline.actions package +================================= + +Submodules +---------- + +rxnutils.pipeline.actions.dataframe\_mod module +----------------------------------------------- + +.. automodule:: rxnutils.pipeline.actions.dataframe_mod + :members: + :undoc-members: + :show-inheritance: + +rxnutils.pipeline.actions.reaction\_mod module +---------------------------------------------- + +.. automodule:: rxnutils.pipeline.actions.reaction_mod + :members: + :undoc-members: + :show-inheritance: + +rxnutils.pipeline.actions.reaction\_props module +------------------------------------------------ + +.. automodule:: rxnutils.pipeline.actions.reaction_props + :members: + :undoc-members: + :show-inheritance: + +rxnutils.pipeline.actions.templates module +------------------------------------------ + +.. automodule:: rxnutils.pipeline.actions.templates + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: rxnutils.pipeline.actions + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/rxnutils.pipeline.rst.txt b/_sources/rxnutils.pipeline.rst.txt new file mode 100644 index 0000000..1a83a29 --- /dev/null +++ b/_sources/rxnutils.pipeline.rst.txt @@ -0,0 +1,37 @@ +rxnutils.pipeline package +========================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + rxnutils.pipeline.actions + +Submodules +---------- + +rxnutils.pipeline.base module +----------------------------- + +.. automodule:: rxnutils.pipeline.base + :members: + :undoc-members: + :show-inheritance: + +rxnutils.pipeline.runner module +------------------------------- + +.. automodule:: rxnutils.pipeline.runner + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: rxnutils.pipeline + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/rxnutils.routes.retro_bleu.rst.txt b/_sources/rxnutils.routes.retro_bleu.rst.txt new file mode 100644 index 0000000..0ca6319 --- /dev/null +++ b/_sources/rxnutils.routes.retro_bleu.rst.txt @@ -0,0 +1,29 @@ +rxnutils.routes.retro\_bleu package +=================================== + +Submodules +---------- + +rxnutils.routes.retro\_bleu.ngram\_collection module +---------------------------------------------------- + +.. automodule:: rxnutils.routes.retro_bleu.ngram_collection + :members: + :undoc-members: + :show-inheritance: + +rxnutils.routes.retro\_bleu.scoring module +------------------------------------------ + +.. automodule:: rxnutils.routes.retro_bleu.scoring + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: rxnutils.routes.retro_bleu + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/rxnutils.routes.rst.txt b/_sources/rxnutils.routes.rst.txt new file mode 100644 index 0000000..7ada7a0 --- /dev/null +++ b/_sources/rxnutils.routes.rst.txt @@ -0,0 +1,63 @@ +rxnutils.routes package +======================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + rxnutils.routes.retro_bleu + rxnutils.routes.ted + rxnutils.routes.utils + +Submodules +---------- + +rxnutils.routes.base module +--------------------------- + +.. automodule:: rxnutils.routes.base + :members: + :undoc-members: + :show-inheritance: + +rxnutils.routes.comparison module +--------------------------------- + +.. automodule:: rxnutils.routes.comparison + :members: + :undoc-members: + :show-inheritance: + +rxnutils.routes.image module +---------------------------- + +.. automodule:: rxnutils.routes.image + :members: + :undoc-members: + :show-inheritance: + +rxnutils.routes.readers module +------------------------------ + +.. automodule:: rxnutils.routes.readers + :members: + :undoc-members: + :show-inheritance: + +rxnutils.routes.scoring module +------------------------------ + +.. automodule:: rxnutils.routes.scoring + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: rxnutils.routes + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/rxnutils.routes.ted.rst.txt b/_sources/rxnutils.routes.ted.rst.txt new file mode 100644 index 0000000..6cf3084 --- /dev/null +++ b/_sources/rxnutils.routes.ted.rst.txt @@ -0,0 +1,37 @@ +rxnutils.routes.ted package +=========================== + +Submodules +---------- + +rxnutils.routes.ted.distances\_calculator module +------------------------------------------------ + +.. automodule:: rxnutils.routes.ted.distances_calculator + :members: + :undoc-members: + :show-inheritance: + +rxnutils.routes.ted.reactiontree module +--------------------------------------- + +.. automodule:: rxnutils.routes.ted.reactiontree + :members: + :undoc-members: + :show-inheritance: + +rxnutils.routes.ted.utils module +-------------------------------- + +.. automodule:: rxnutils.routes.ted.utils + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: rxnutils.routes.ted + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/rxnutils.routes.utils.rst.txt b/_sources/rxnutils.routes.utils.rst.txt new file mode 100644 index 0000000..4ccc8d7 --- /dev/null +++ b/_sources/rxnutils.routes.utils.rst.txt @@ -0,0 +1,21 @@ +rxnutils.routes.utils package +============================= + +Submodules +---------- + +rxnutils.routes.utils.validation module +--------------------------------------- + +.. automodule:: rxnutils.routes.utils.validation + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: rxnutils.routes.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/rxnutils.rst.txt b/_sources/rxnutils.rst.txt new file mode 100644 index 0000000..be04fc9 --- /dev/null +++ b/_sources/rxnutils.rst.txt @@ -0,0 +1,21 @@ +rxnutils package +================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + rxnutils.chem + rxnutils.data + rxnutils.pipeline + rxnutils.routes + +Module contents +--------------- + +.. automodule:: rxnutils + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/templates.rst.txt b/_sources/templates.rst.txt new file mode 100644 index 0000000..570a195 --- /dev/null +++ b/_sources/templates.rst.txt @@ -0,0 +1,104 @@ +Templates +========= + +`reaction utils` contains routines for extracting reaction templates using the `RDchiral` package. +This code is based on the work of Thakkar et al. (Chem. Sci., 2019) but with some re-factoring and +other additions. + +Template extraction +------------------- + +Let's start with this atom-mapped reaction + +.. image:: sample_reaction.PNG + +.. code-block:: + + CCN(CC)CC.CCOCC.Cl[S:3]([CH2:2][CH3:1])(=[O:4])=[O:5].[OH:6][CH2:7][CH2:8][Br:9]>>[CH3:1][CH2:2][S:3](=[O:4])(=[O:5])[O:6][CH2:7][CH2:8][Br:9] + + +First we create a ``ChemicalReaction`` object that is encapsulating the reaction and provides some +simple curation routines. + + +.. code-block:: + + from rxnutils.chem.reaction import ChemicalReaction + + reaction = "CCN(CC)CC.CCOCC.Cl[S:3]([CH2:2][CH3:1])(=[O:4])=[O:5].[OH:6][CH2:7][CH2:8][Br:9]>>[CH3:1][CH2:2][S:3](=[O:4])(=[O:5])[O:6][CH2:7][CH2:8][Br:9]" + rxn = ChemicalReaction(reaction) + +if you inspect the ``reactants_list`` property, you will see that two of the reactants from the reaction +SMILES have been moved to the list of agents because they are not mapped. + + +.. code-block:: + + rxn.reactants_list + >> ['Cl[S:3]([CH2:2][CH3:1])(=[O:4])=[O:5]', '[OH:6][CH2:7][CH2:8][Br:9]'] + + rxn.agents_list + >> ['CCN(CC)CC', 'CCOCC'] + + +Now we can extract a reaction template + + +.. code-block:: + + rxn.generate_reaction_template(radius=1) + + rxn.retro_template + >> + + rxn.retro_template.smarts + >> '[C:2]-[S;H0;D4;+0:1](=[O;D1;H0:3])(=[O;D1;H0:4])-[O;H0;D2;+0:6]-[C:5]>>Cl-[S;H0;D4;+0:1](-[C:2])(=[O;D1;H0:3])=[O;D1;H0:4].[C:5]-[OH;D1;+0:6]' + + +The ``radius`` is an optional argument, specifying the radius of the template. + + +Template manipulation +--------------------- + +The reaction template, either the canonical (forward) or retro template is encapulsated in a +`ReactionTemplate` object that can be used to apply the template to a molecule or to generate +fingerprints or hash strings. + +Let's see if the template generated above is capable of re-generating the expected reactants. + +.. code-block:: + + smiles="CCS(=O)(=O)OCCBr" + reactant_list = rxn.retro_template.apply(smiles) + reactant_list + >> (('CCS(=O)(=O)Cl', 'OCCBr'),) + +we see that returned list (technically a tuple) contains one item, implying that the template +was specific and only produced one set of reactants. These reactants as you see are identical +to the reactants in the reaction SMILES above. + +To create a hash string for the template, there are a number of routines + +.. code-block:: + + rxn.retro_template.hash_from_bits() + >> 'a1727cc9ed68a6411bfd02873c1615c22baa1af4957f14ae942e2c85caf9adb5' + + rxn.retro_template.hash_from_smarts() + >> '4cb9be0738a3a84e7ed4fb661d2efb73c099fc7d6c532a4b294c8d0d' + + rxn.retro_template.hash_from_smiles() + >> '5b2ff2a69fb7bd6a032938e468684773bcc668928b037bbec0ac8335' + +The first one is creating the hash string from the fingerprint bits that are one, whereas the +other two creates it by hashing the SMARTS and the SMILES string, respectively. + + +A Morgan fingerprint can be computed for a reaction template: + +.. code-block:: + + rxn.retro_template.fingerprint_vector(radius=2, nbits=1024) + >> array([0., 0., 0., ..., 0., 0., 0.]) + diff --git a/_sources/uspto.rst.txt b/_sources/uspto.rst.txt new file mode 100644 index 0000000..840076b --- /dev/null +++ b/_sources/uspto.rst.txt @@ -0,0 +1,94 @@ +USPTO +===== + +``rxnutils`` contain two pipelines that together downloads and prepares the USPTO reaction data so that it can be used on modelling. + +It is a complete end-to-end pipeline that is designed to be transparent and reproducible. + +Pre-requisites +-------------- + +The reason the pipeline is divided into two blocks is because the dependencies of the atom-mapper package (``rxnmapper``) is incompatible with +the dependencies ``rxnutils`` package. Therefore, to be able to use to full pipeline, you need to setup two python environment. + +1. Install ``rxnutils`` according to the instructions in the `README`-file + +2. Install ``rxnmapper`` according to the instructions in the repo: https://github.com/rxn4chemistry/rxnmapper + + +.. code-block:: + + conda create -n rxnmapper python=3.6 -y + conda activate rxnmapper + conda install -c rdkit rdkit=2020.03.3.0 + python -m pip install rxnmapper + + +3. Install ``Metaflow`` and ``rxnutils`` in the new environment + + +.. code-block:: + + python -m pip install metaflow + python -m pip install --no-deps --ignore-requires-python . + + +Usage +----- + +Create a folder for the USPTO data and in that folder execute this command in the ``rxnutils`` environment + + +.. code-block:: + + conda activate rxn-env + python -m rxnutils.data.uspto.preparation_pipeline run --nbatches 200 --max-workers 8 --max-num-splits 200 + + +and then in the environment with the ``rxnmapper`` run + + +.. code-block:: + + conda activate rxnmapper + python -m rxnutils.data.mapping_pipeline run --data-prefix uspto --nbatches 200 --max-workers 8 --max-num-splits 200 + + +The ``-max-workers`` flag should be set to the number of CPUs available. + +On 8 CPUs and 1 GPU the pipeline takes a couple of hours. + + +Artifacts +--------- + +The pipelines creates a number of `tab-separated` CSV files: + + * `1976_Sep2016_USPTOgrants_smiles.rsmi` and `2001_Sep2016_USPTOapplications_smiles.rsmi` is the original USPTO data downloaded from Figshare + * `uspto_data.csv` is the combined USPTO data, with selected columns and a unique ID for each reaction + * `uspto_data_cleaned.csv` is the cleaned and filter data + * `uspto_data_mapped.csv` is the atom-mapped, modelling-ready data + + +The cleaning is done to be able to atom-map the reactions and are performing the following tasks: + * Ignore extended SMILES information in the SMILES strings + * Remove molecules not sanitizable by RDKit + * Remove reactions without any reactants or products + * Move all reagents to reactants + * Remove the existing atom-mapping + * Remove reactions with more than 200 atoms when summing reactants and products + +(the last is a requisite for ``rxnmapper`` that was trained on a maximum token size roughly corresponding to 200 atoms) + + +The ``uspo_data_mapped.csv`` files will have the following columns: + + * ID - unique ID created by concatenated patent number, paragraph and row index in the original data file + * Year - the year of the patent filing + * ReactionSmiles - the original reaction SMILES + * ReactionSmilesClean - the reaction SMILES after cleaning + * BadMolecules - molecules not sanitizable by RDKit + * ReactantSize - number of atoms in reactants + * ProductSize - number of atoms in products + * mapped_rxn - the mapped reaction SMILES + * confidence - the confidence of the mapping as provided by ``rxnmapper`` diff --git a/_static/alabaster.css b/_static/alabaster.css new file mode 100644 index 0000000..75b472a --- /dev/null +++ b/_static/alabaster.css @@ -0,0 +1,714 @@ +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: Georgia, serif; + font-size: 17px; + background-color: #fff; + color: #000; + margin: 0; + padding: 0; +} + + +div.document { + width: 940px; + margin: 30px auto 0 auto; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 220px; +} + +div.sphinxsidebar { + width: 220px; + font-size: 14px; + line-height: 1.5; +} + +hr { + border: 1px solid #B1B4B6; +} + +div.body { + background-color: #fff; + color: #3E4349; + padding: 0 30px 0 30px; +} + +div.body > .section { + text-align: left; +} + +div.footer { + width: 940px; + margin: 20px auto 30px auto; + font-size: 14px; + color: #888; + text-align: right; +} + +div.footer a { + color: #888; +} + +p.caption { + font-family: inherit; + font-size: inherit; +} + + +div.relations { + display: none; +} + + +div.sphinxsidebar { + max-height: 100%; + overflow-y: auto; +} + +div.sphinxsidebar a { + color: #444; + text-decoration: none; + border-bottom: 1px dotted #999; +} + +div.sphinxsidebar a:hover { + border-bottom: 1px solid #999; +} + +div.sphinxsidebarwrapper { + padding: 18px 10px; +} + +div.sphinxsidebarwrapper p.logo { + padding: 0; + margin: -10px 0 0 0px; + text-align: center; +} + +div.sphinxsidebarwrapper h1.logo { + margin-top: -10px; + text-align: center; + margin-bottom: 5px; + text-align: left; +} + +div.sphinxsidebarwrapper h1.logo-name { + margin-top: 0px; +} + +div.sphinxsidebarwrapper p.blurb { + margin-top: 0; + font-style: normal; +} + +div.sphinxsidebar h3, +div.sphinxsidebar h4 { + font-family: Georgia, serif; + color: #444; + font-size: 24px; + font-weight: normal; + margin: 0 0 5px 0; + padding: 0; +} + +div.sphinxsidebar h4 { + font-size: 20px; +} + +div.sphinxsidebar h3 a { + color: #444; +} + +div.sphinxsidebar p.logo a, +div.sphinxsidebar h3 a, +div.sphinxsidebar p.logo a:hover, +div.sphinxsidebar h3 a:hover { + border: none; +} + +div.sphinxsidebar p { + color: #555; + margin: 10px 0; +} + +div.sphinxsidebar ul { + margin: 10px 0; + padding: 0; + color: #000; +} + +div.sphinxsidebar ul li.toctree-l1 > a { + font-size: 120%; +} + +div.sphinxsidebar ul li.toctree-l2 > a { + font-size: 110%; +} + +div.sphinxsidebar input { + border: 1px solid #CCC; + font-family: Georgia, serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox input[type="text"] { + width: 160px; +} + +div.sphinxsidebar .search > div { + display: table-cell; +} + +div.sphinxsidebar hr { + border: none; + height: 1px; + color: #AAA; + background: #AAA; + + text-align: left; + margin-left: 0; + width: 50%; +} + +div.sphinxsidebar .badge { + border-bottom: none; +} + +div.sphinxsidebar .badge:hover { + border-bottom: none; +} + +/* To address an issue with donation coming after search */ +div.sphinxsidebar h3.donation { + margin-top: 10px; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #004B6B; + text-decoration: underline; +} + +a:hover { + color: #6D4100; + text-decoration: underline; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: Georgia, serif; + font-weight: normal; + margin: 30px 0px 10px 0px; + padding: 0; +} + +div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } +div.body h2 { font-size: 180%; } +div.body h3 { font-size: 150%; } +div.body h4 { font-size: 130%; } +div.body h5 { font-size: 100%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #DDD; + padding: 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + color: #444; + background: #EAEAEA; +} + +div.body p, div.body dd, div.body li { + line-height: 1.4em; +} + +div.admonition { + margin: 20px 0px; + padding: 10px 30px; + background-color: #EEE; + border: 1px solid #CCC; +} + +div.admonition tt.xref, div.admonition code.xref, div.admonition a tt { + background-color: #FBFBFB; + border-bottom: 1px solid #fafafa; +} + +div.admonition p.admonition-title { + font-family: Georgia, serif; + font-weight: normal; + font-size: 24px; + margin: 0 0 10px 0; + padding: 0; + line-height: 1; +} + +div.admonition p.last { + margin-bottom: 0; +} + +div.highlight { + background-color: #fff; +} + +dt:target, .highlight { + background: #FAF3E8; +} + +div.warning { + background-color: #FCC; + border: 1px solid #FAA; +} + +div.danger { + background-color: #FCC; + border: 1px solid #FAA; + -moz-box-shadow: 2px 2px 4px #D52C2C; + -webkit-box-shadow: 2px 2px 4px #D52C2C; + box-shadow: 2px 2px 4px #D52C2C; +} + +div.error { + background-color: #FCC; + border: 1px solid #FAA; + -moz-box-shadow: 2px 2px 4px #D52C2C; + -webkit-box-shadow: 2px 2px 4px #D52C2C; + box-shadow: 2px 2px 4px #D52C2C; +} + +div.caution { + background-color: #FCC; + border: 1px solid #FAA; +} + +div.attention { + background-color: #FCC; + border: 1px solid #FAA; +} + +div.important { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.note { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.tip { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.hint { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.seealso { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.topic { + background-color: #EEE; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre, tt, code { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + font-size: 0.9em; +} + +.hll { + background-color: #FFC; + margin: 0 -12px; + padding: 0 12px; + display: block; +} + +img.screenshot { +} + +tt.descname, tt.descclassname, code.descname, code.descclassname { + font-size: 0.95em; +} + +tt.descname, code.descname { + padding-right: 0.08em; +} + +img.screenshot { + -moz-box-shadow: 2px 2px 4px #EEE; + -webkit-box-shadow: 2px 2px 4px #EEE; + box-shadow: 2px 2px 4px #EEE; +} + +table.docutils { + border: 1px solid #888; + -moz-box-shadow: 2px 2px 4px #EEE; + -webkit-box-shadow: 2px 2px 4px #EEE; + box-shadow: 2px 2px 4px #EEE; +} + +table.docutils td, table.docutils th { + border: 1px solid #888; + padding: 0.25em 0.7em; +} + +table.field-list, table.footnote { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +table.footnote { + margin: 15px 0; + width: 100%; + border: 1px solid #EEE; + background: #FDFDFD; + font-size: 0.9em; +} + +table.footnote + table.footnote { + margin-top: -15px; + border-top: none; +} + +table.field-list th { + padding: 0 0.8em 0 0; +} + +table.field-list td { + padding: 0; +} + +table.field-list p { + margin-bottom: 0.8em; +} + +/* Cloned from + * https://github.com/sphinx-doc/sphinx/commit/ef60dbfce09286b20b7385333d63a60321784e68 + */ +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +table.footnote td.label { + width: .1px; + padding: 0.3em 0 0.3em 0.5em; +} + +table.footnote td { + padding: 0.3em 0.5em; +} + +dl { + margin-left: 0; + margin-right: 0; + margin-top: 0; + padding: 0; +} + +dl dd { + margin-left: 30px; +} + +blockquote { + margin: 0 0 0 30px; + padding: 0; +} + +ul, ol { + /* Matches the 30px from the narrow-screen "li > ul" selector below */ + margin: 10px 0 10px 30px; + padding: 0; +} + +pre { + background: #EEE; + padding: 7px 30px; + margin: 15px 0px; + line-height: 1.3em; +} + +div.viewcode-block:target { + background: #ffd; +} + +dl pre, blockquote pre, li pre { + margin-left: 0; + padding-left: 30px; +} + +tt, code { + background-color: #ecf0f3; + color: #222; + /* padding: 1px 2px; */ +} + +tt.xref, code.xref, a tt { + background-color: #FBFBFB; + border-bottom: 1px solid #fff; +} + +a.reference { + text-decoration: none; + border-bottom: 1px dotted #004B6B; +} + +/* Don't put an underline on images */ +a.image-reference, a.image-reference:hover { + border-bottom: none; +} + +a.reference:hover { + border-bottom: 1px solid #6D4100; +} + +a.footnote-reference { + text-decoration: none; + font-size: 0.7em; + vertical-align: top; + border-bottom: 1px dotted #004B6B; +} + +a.footnote-reference:hover { + border-bottom: 1px solid #6D4100; +} + +a:hover tt, a:hover code { + background: #EEE; +} + + +@media screen and (max-width: 870px) { + + div.sphinxsidebar { + display: none; + } + + div.document { + width: 100%; + + } + + div.documentwrapper { + margin-left: 0; + margin-top: 0; + margin-right: 0; + margin-bottom: 0; + } + + div.bodywrapper { + margin-top: 0; + margin-right: 0; + margin-bottom: 0; + margin-left: 0; + } + + ul { + margin-left: 0; + } + + li > ul { + /* Matches the 30px from the "ul, ol" selector above */ + margin-left: 30px; + } + + .document { + width: auto; + } + + .footer { + width: auto; + } + + .bodywrapper { + margin: 0; + } + + .footer { + width: auto; + } + + .github { + display: none; + } + + + +} + + + +@media screen and (max-width: 875px) { + + body { + margin: 0; + padding: 20px 30px; + } + + div.documentwrapper { + float: none; + background: #fff; + } + + div.sphinxsidebar { + display: block; + float: none; + width: 102.5%; + margin: -20px -30px 20px -30px; + padding: 10px 20px; + background: #333; + color: #FFF; + } + + div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, + div.sphinxsidebar h3 a { + color: #fff; + } + + div.sphinxsidebar a { + color: #AAA; + } + + div.sphinxsidebar p.logo { + display: none; + } + + div.document { + width: 100%; + margin: 0; + } + + div.footer { + display: none; + } + + div.bodywrapper { + margin: 0; + } + + div.body { + min-height: 0; + padding: 0; + } + + .rtd_doc_footer { + display: none; + } + + .document { + width: auto; + } + + .footer { + width: auto; + } + + .footer { + width: auto; + } + + .github { + display: none; + } +} +@media screen and (min-width: 876px) { + div.sphinxsidebar { + position: fixed; + margin-left: 0; + } +} + + +/* misc. */ + +.revsys-inline { + display: none!important; +} + +/* Hide ugly table cell borders in ..bibliography:: directive output */ +table.docutils.citation, table.docutils.citation td, table.docutils.citation th { + border: none; + /* Below needed in some edge cases; if not applied, bottom shadows appear */ + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} + + +/* relbar */ + +.related { + line-height: 30px; + width: 100%; + font-size: 0.9rem; +} + +.related.top { + border-bottom: 1px solid #EEE; + margin-bottom: 20px; +} + +.related.bottom { + border-top: 1px solid #EEE; +} + +.related ul { + padding: 0; + margin: 0; + list-style: none; +} + +.related li { + display: inline; +} + +nav#rellinks { + float: right; +} + +nav#rellinks li+li:before { + content: "|"; +} + +nav#breadcrumbs li+li:before { + content: "\00BB"; +} + +/* Hide certain items when printing */ +@media print { + div.related { + display: none; + } +} \ No newline at end of file diff --git a/_static/basic.css b/_static/basic.css new file mode 100644 index 0000000..e5179b7 --- /dev/null +++ b/_static/basic.css @@ -0,0 +1,925 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: inherit; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a:visited { + color: #551A8B; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +.translated { + background-color: rgba(207, 255, 207, 0.2) +} + +.untranslated { + background-color: rgba(255, 207, 207, 0.2) +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/_static/custom.css b/_static/custom.css new file mode 100644 index 0000000..2a924f1 --- /dev/null +++ b/_static/custom.css @@ -0,0 +1 @@ +/* This file intentionally left blank. */ diff --git a/_static/doctools.js b/_static/doctools.js new file mode 100644 index 0000000..4d67807 --- /dev/null +++ b/_static/doctools.js @@ -0,0 +1,156 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Base JavaScript utilities for all Sphinx HTML documentation. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/_static/documentation_options.js b/_static/documentation_options.js new file mode 100644 index 0000000..b50c75e --- /dev/null +++ b/_static/documentation_options.js @@ -0,0 +1,13 @@ +const DOCUMENTATION_OPTIONS = { + VERSION: '1.6.0', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/_static/file.png b/_static/file.png new file mode 100644 index 0000000..a858a41 Binary files /dev/null and b/_static/file.png differ diff --git a/_static/language_data.js b/_static/language_data.js new file mode 100644 index 0000000..367b8ed --- /dev/null +++ b/_static/language_data.js @@ -0,0 +1,199 @@ +/* + * language_data.js + * ~~~~~~~~~~~~~~~~ + * + * This script contains the language-specific data used by searchtools.js, + * namely the list of stopwords, stemmer, scorer and splitter. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; + + +/* Non-minified version is copied as a separate JS file, if available */ + +/** + * Porter Stemmer + */ +var Stemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + diff --git a/_static/minus.png b/_static/minus.png new file mode 100644 index 0000000..d96755f Binary files /dev/null and b/_static/minus.png differ diff --git a/_static/plus.png b/_static/plus.png new file mode 100644 index 0000000..7107cec Binary files /dev/null and b/_static/plus.png differ diff --git a/_static/pygments.css b/_static/pygments.css new file mode 100644 index 0000000..04a4174 --- /dev/null +++ b/_static/pygments.css @@ -0,0 +1,84 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.highlight .hll { background-color: #ffffcc } +.highlight { background: #f8f8f8; } +.highlight .c { color: #8f5902; font-style: italic } /* Comment */ +.highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */ +.highlight .g { color: #000000 } /* Generic */ +.highlight .k { color: #004461; font-weight: bold } /* Keyword */ +.highlight .l { color: #000000 } /* Literal */ +.highlight .n { color: #000000 } /* Name */ +.highlight .o { color: #582800 } /* Operator */ +.highlight .x { color: #000000 } /* Other */ +.highlight .p { color: #000000; font-weight: bold } /* Punctuation */ +.highlight .ch { color: #8f5902; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #8f5902 } /* Comment.Preproc */ +.highlight .cpf { color: #8f5902; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #a40000 } /* Generic.Deleted */ +.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */ +.highlight .ges { color: #000000 } /* Generic.EmphStrong */ +.highlight .gr { color: #ef2929 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #745334 } /* Generic.Prompt */ +.highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */ +.highlight .kc { color: #004461; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #004461; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #004461; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #004461; font-weight: bold } /* Keyword.Pseudo */ +.highlight .kr { color: #004461; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #004461; font-weight: bold } /* Keyword.Type */ +.highlight .ld { color: #000000 } /* Literal.Date */ +.highlight .m { color: #990000 } /* Literal.Number */ +.highlight .s { color: #4e9a06 } /* Literal.String */ +.highlight .na { color: #c4a000 } /* Name.Attribute */ +.highlight .nb { color: #004461 } /* Name.Builtin */ +.highlight .nc { color: #000000 } /* Name.Class */ +.highlight .no { color: #000000 } /* Name.Constant */ +.highlight .nd { color: #888888 } /* Name.Decorator */ +.highlight .ni { color: #ce5c00 } /* Name.Entity */ +.highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #000000 } /* Name.Function */ +.highlight .nl { color: #f57900 } /* Name.Label */ +.highlight .nn { color: #000000 } /* Name.Namespace */ +.highlight .nx { color: #000000 } /* Name.Other */ +.highlight .py { color: #000000 } /* Name.Property */ +.highlight .nt { color: #004461; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #000000 } /* Name.Variable */ +.highlight .ow { color: #004461; font-weight: bold } /* Operator.Word */ +.highlight .pm { color: #000000; font-weight: bold } /* Punctuation.Marker */ +.highlight .w { color: #f8f8f8 } /* Text.Whitespace */ +.highlight .mb { color: #990000 } /* Literal.Number.Bin */ +.highlight .mf { color: #990000 } /* Literal.Number.Float */ +.highlight .mh { color: #990000 } /* Literal.Number.Hex */ +.highlight .mi { color: #990000 } /* Literal.Number.Integer */ +.highlight .mo { color: #990000 } /* Literal.Number.Oct */ +.highlight .sa { color: #4e9a06 } /* Literal.String.Affix */ +.highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */ +.highlight .sc { color: #4e9a06 } /* Literal.String.Char */ +.highlight .dl { color: #4e9a06 } /* Literal.String.Delimiter */ +.highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4e9a06 } /* Literal.String.Double */ +.highlight .se { color: #4e9a06 } /* Literal.String.Escape */ +.highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */ +.highlight .si { color: #4e9a06 } /* Literal.String.Interpol */ +.highlight .sx { color: #4e9a06 } /* Literal.String.Other */ +.highlight .sr { color: #4e9a06 } /* Literal.String.Regex */ +.highlight .s1 { color: #4e9a06 } /* Literal.String.Single */ +.highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */ +.highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #000000 } /* Name.Function.Magic */ +.highlight .vc { color: #000000 } /* Name.Variable.Class */ +.highlight .vg { color: #000000 } /* Name.Variable.Global */ +.highlight .vi { color: #000000 } /* Name.Variable.Instance */ +.highlight .vm { color: #000000 } /* Name.Variable.Magic */ +.highlight .il { color: #990000 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/_static/searchtools.js b/_static/searchtools.js new file mode 100644 index 0000000..b08d58c --- /dev/null +++ b/_static/searchtools.js @@ -0,0 +1,620 @@ +/* + * searchtools.js + * ~~~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for the full-text search. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +/** + * Simple result scoring code. + */ +if (typeof Scorer === "undefined") { + var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [docname, title, anchor, descr, score, filename] + // and returns the new score. + /* + score: result => { + const [docname, title, anchor, descr, score, filename] = result + return score + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: { + 0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5, // used to be unimportantResults + }, + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + partialTitle: 7, + // query found in terms + term: 5, + partialTerm: 2, + }; +} + +const _removeChildren = (element) => { + while (element && element.lastChild) element.removeChild(element.lastChild); +}; + +/** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping + */ +const _escapeRegExp = (string) => + string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + +const _displayItem = (item, searchTerms, highlightTerms) => { + const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; + const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; + const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + const contentRoot = document.documentElement.dataset.content_root; + + const [docName, title, anchor, descr, score, _filename] = item; + + let listItem = document.createElement("li"); + let requestUrl; + let linkUrl; + if (docBuilder === "dirhtml") { + // dirhtml builder + let dirname = docName + "/"; + if (dirname.match(/\/index\/$/)) + dirname = dirname.substring(0, dirname.length - 6); + else if (dirname === "index/") dirname = ""; + requestUrl = contentRoot + dirname; + linkUrl = requestUrl; + } else { + // normal html builders + requestUrl = contentRoot + docName + docFileSuffix; + linkUrl = docName + docLinkSuffix; + } + let linkEl = listItem.appendChild(document.createElement("a")); + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; + linkEl.innerHTML = title; + if (descr) { + listItem.appendChild(document.createElement("span")).innerHTML = + " (" + descr + ")"; + // highlight search terms in the description + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + } + else if (showSearchSummary) + fetch(requestUrl) + .then((responseData) => responseData.text()) + .then((data) => { + if (data) + listItem.appendChild( + Search.makeSearchSummary(data, searchTerms, anchor) + ); + // highlight search terms in the summary + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + }); + Search.output.appendChild(listItem); +}; +const _finishSearch = (resultCount) => { + Search.stopPulse(); + Search.title.innerText = _("Search Results"); + if (!resultCount) + Search.status.innerText = Documentation.gettext( + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." + ); + else + Search.status.innerText = _( + "Search finished, found ${resultCount} page(s) matching the search query." + ).replace('${resultCount}', resultCount); +}; +const _displayNextItem = ( + results, + resultCount, + searchTerms, + highlightTerms, +) => { + // results left, load the summary and display it + // this is intended to be dynamic (don't sub resultsCount) + if (results.length) { + _displayItem(results.pop(), searchTerms, highlightTerms); + setTimeout( + () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), + 5 + ); + } + // search finished, update title and status message + else _finishSearch(resultCount); +}; +// Helper function used by query() to order search results. +// Each input is an array of [docname, title, anchor, descr, score, filename]. +// Order the results by score (in opposite order of appearance, since the +// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically. +const _orderResultsByScoreThenName = (a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; +}; + +/** + * Default splitQuery function. Can be overridden in ``sphinx.search`` with a + * custom function per language. + * + * The regular expression works by splitting the string on consecutive characters + * that are not Unicode letters, numbers, underscores, or emoji characters. + * This is the same as ``\W+`` in Python, preserving the surrogate pair area. + */ +if (typeof splitQuery === "undefined") { + var splitQuery = (query) => query + .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) + .filter(term => term) // remove remaining empty strings +} + +/** + * Search Module + */ +const Search = { + _index: null, + _queued_query: null, + _pulse_status: -1, + + htmlToText: (htmlString, anchor) => { + const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); + for (const removalQuery of [".headerlink", "script", "style"]) { + htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() }); + } + if (anchor) { + const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`); + if (anchorContent) return anchorContent.textContent; + + console.warn( + `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.` + ); + } + + // if anchor not specified or not found, fall back to main content + const docContent = htmlElement.querySelector('[role="main"]'); + if (docContent) return docContent.textContent; + + console.warn( + "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template." + ); + return ""; + }, + + init: () => { + const query = new URLSearchParams(window.location.search).get("q"); + document + .querySelectorAll('input[name="q"]') + .forEach((el) => (el.value = query)); + if (query) Search.performSearch(query); + }, + + loadIndex: (url) => + (document.body.appendChild(document.createElement("script")).src = url), + + setIndex: (index) => { + Search._index = index; + if (Search._queued_query !== null) { + const query = Search._queued_query; + Search._queued_query = null; + Search.query(query); + } + }, + + hasIndex: () => Search._index !== null, + + deferQuery: (query) => (Search._queued_query = query), + + stopPulse: () => (Search._pulse_status = -1), + + startPulse: () => { + if (Search._pulse_status >= 0) return; + + const pulse = () => { + Search._pulse_status = (Search._pulse_status + 1) % 4; + Search.dots.innerText = ".".repeat(Search._pulse_status); + if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something (or wait until index is loaded) + */ + performSearch: (query) => { + // create the required interface elements + const searchText = document.createElement("h2"); + searchText.textContent = _("Searching"); + const searchSummary = document.createElement("p"); + searchSummary.classList.add("search-summary"); + searchSummary.innerText = ""; + const searchList = document.createElement("ul"); + searchList.classList.add("search"); + + const out = document.getElementById("search-results"); + Search.title = out.appendChild(searchText); + Search.dots = Search.title.appendChild(document.createElement("span")); + Search.status = out.appendChild(searchSummary); + Search.output = out.appendChild(searchList); + + const searchProgress = document.getElementById("search-progress"); + // Some themes don't use the search progress node + if (searchProgress) { + searchProgress.innerText = _("Preparing search..."); + } + Search.startPulse(); + + // index already loaded, the browser was quick! + if (Search.hasIndex()) Search.query(query); + else Search.deferQuery(query); + }, + + _parseQuery: (query) => { + // stem the search terms and add them to the correct list + const stemmer = new Stemmer(); + const searchTerms = new Set(); + const excludedTerms = new Set(); + const highlightTerms = new Set(); + const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); + splitQuery(query.trim()).forEach((queryTerm) => { + const queryTermLower = queryTerm.toLowerCase(); + + // maybe skip this "word" + // stopwords array is from language_data.js + if ( + stopwords.indexOf(queryTermLower) !== -1 || + queryTerm.match(/^\d+$/) + ) + return; + + // stem the word + let word = stemmer.stemWord(queryTermLower); + // select the correct list + if (word[0] === "-") excludedTerms.add(word.substr(1)); + else { + searchTerms.add(word); + highlightTerms.add(queryTermLower); + } + }); + + if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js + localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) + } + + // console.debug("SEARCH: searching for:"); + // console.info("required: ", [...searchTerms]); + // console.info("excluded: ", [...excludedTerms]); + + return [query, searchTerms, excludedTerms, highlightTerms, objectTerms]; + }, + + /** + * execute search (requires search index to be loaded) + */ + _performSearch: (query, searchTerms, excludedTerms, highlightTerms, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // Collect multiple result groups to be sorted separately and then ordered. + // Each is an array of [docname, title, anchor, descr, score, filename]. + const normalResults = []; + const nonMainIndexResults = []; + + _removeChildren(document.getElementById("search-progress")); + + const queryLower = query.toLowerCase().trim(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) { + for (const [file, id] of foundTitles) { + const score = Math.round(Scorer.title * queryLower.length / title.length); + const boost = titles[file] === title ? 1 : 0; // add a boost for document titles + normalResults.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score + boost, + filenames[file], + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { + for (const [file, id, isMain] of foundEntries) { + const score = Math.round(100 * queryLower.length / entry.length); + const result = [ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + ]; + if (isMain) { + normalResults.push(result); + } else { + nonMainIndexResults.push(result); + } + } + } + } + + // lookup as object + objectTerms.forEach((term) => + normalResults.push(...Search.performObjectSearch(term, objectTerms)) + ); + + // lookup as search terms in fulltext + normalResults.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + + // let the scorer override scores with a custom scoring function + if (Scorer.score) { + normalResults.forEach((item) => (item[4] = Scorer.score(item))); + nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item))); + } + + // Sort each group of results by score and then alphabetically by name. + normalResults.sort(_orderResultsByScoreThenName); + nonMainIndexResults.sort(_orderResultsByScoreThenName); + + // Combine the result groups in (reverse) order. + // Non-main index entries are typically arbitrary cross-references, + // so display them after other results. + let results = [...nonMainIndexResults, ...normalResults]; + + // remove duplicate search results + // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept + let seen = new Set(); + results = results.reverse().reduce((acc, result) => { + let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(','); + if (!seen.has(resultStr)) { + acc.push(result); + seen.add(resultStr); + } + return acc; + }, []); + + return results.reverse(); + }, + + query: (query) => { + const [searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms] = Search._parseQuery(query); + const results = Search._performSearch(searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms); + + // for debugging + //Search.lastresults = results.slice(); // a copy + // console.info("search results:", Search.lastresults); + + // print the results + _displayNextItem(results, results.length, searchTerms, highlightTerms); + }, + + /** + * search for object names + */ + performObjectSearch: (object, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const objects = Search._index.objects; + const objNames = Search._index.objnames; + const titles = Search._index.titles; + + const results = []; + + const objectSearchCallback = (prefix, match) => { + const name = match[4] + const fullname = (prefix ? prefix + "." : "") + name; + const fullnameLower = fullname.toLowerCase(); + if (fullnameLower.indexOf(object) < 0) return; + + let score = 0; + const parts = fullnameLower.split("."); + + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullnameLower === object || parts.slice(-1)[0] === object) + score += Scorer.objNameMatch; + else if (parts.slice(-1)[0].indexOf(object) > -1) + score += Scorer.objPartialMatch; // matches in last name + + const objName = objNames[match[1]][2]; + const title = titles[match[0]]; + + // If more than one term searched for, we require other words to be + // found in the name/title/description + const otherTerms = new Set(objectTerms); + otherTerms.delete(object); + if (otherTerms.size > 0) { + const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); + if ( + [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) + ) + return; + } + + let anchor = match[3]; + if (anchor === "") anchor = fullname; + else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; + + const descr = objName + _(", in ") + title; + + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) + score += Scorer.objPrio[match[2]]; + else score += Scorer.objPrioDefault; + + results.push([ + docNames[match[0]], + fullname, + "#" + anchor, + descr, + score, + filenames[match[0]], + ]); + }; + Object.keys(objects).forEach((prefix) => + objects[prefix].forEach((array) => + objectSearchCallback(prefix, array) + ) + ); + return results; + }, + + /** + * search for full-text terms in the index + */ + performTermsSearch: (searchTerms, excludedTerms) => { + // prepare search + const terms = Search._index.terms; + const titleTerms = Search._index.titleterms; + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + + const scoreMap = new Map(); + const fileMap = new Map(); + + // perform the search on the required terms + searchTerms.forEach((word) => { + const files = []; + const arr = [ + { files: terms[word], score: Scorer.term }, + { files: titleTerms[word], score: Scorer.title }, + ]; + // add support for partial matches + if (word.length > 2) { + const escapedWord = _escapeRegExp(word); + if (!terms.hasOwnProperty(word)) { + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + } + if (!titleTerms.hasOwnProperty(word)) { + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: titleTerms[term], score: Scorer.partialTitle }); + }); + } + } + + // no match but word was a required one + if (arr.every((record) => record.files === undefined)) return; + + // found search word in contents + arr.forEach((record) => { + if (record.files === undefined) return; + + let recordFiles = record.files; + if (recordFiles.length === undefined) recordFiles = [recordFiles]; + files.push(...recordFiles); + + // set score for the word in each file + recordFiles.forEach((file) => { + if (!scoreMap.has(file)) scoreMap.set(file, {}); + scoreMap.get(file)[word] = record.score; + }); + }); + + // create the mapping + files.forEach((file) => { + if (!fileMap.has(file)) fileMap.set(file, [word]); + else if (fileMap.get(file).indexOf(word) === -1) fileMap.get(file).push(word); + }); + }); + + // now check if the files don't contain excluded terms + const results = []; + for (const [file, wordList] of fileMap) { + // check if all requirements are matched + + // as search terms with length < 3 are discarded + const filteredTermCount = [...searchTerms].filter( + (term) => term.length > 2 + ).length; + if ( + wordList.length !== searchTerms.size && + wordList.length !== filteredTermCount + ) + continue; + + // ensure that none of the excluded terms is in the search result + if ( + [...excludedTerms].some( + (term) => + terms[term] === file || + titleTerms[term] === file || + (terms[term] || []).includes(file) || + (titleTerms[term] || []).includes(file) + ) + ) + break; + + // select one (max) score for the file. + const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w])); + // add result to the result list + results.push([ + docNames[file], + titles[file], + "", + null, + score, + filenames[file], + ]); + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words. + */ + makeSearchSummary: (htmlText, keywords, anchor) => { + const text = Search.htmlToText(htmlText, anchor); + if (text === "") return null; + + const textLower = text.toLowerCase(); + const actualStartPosition = [...keywords] + .map((k) => textLower.indexOf(k.toLowerCase())) + .filter((i) => i > -1) + .slice(-1)[0]; + const startWithContext = Math.max(actualStartPosition - 120, 0); + + const top = startWithContext === 0 ? "" : "..."; + const tail = startWithContext + 240 < text.length ? "..." : ""; + + let summary = document.createElement("p"); + summary.classList.add("context"); + summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; + + return summary; + }, +}; + +_ready(Search.init); diff --git a/_static/sphinx_highlight.js b/_static/sphinx_highlight.js new file mode 100644 index 0000000..8a96c69 --- /dev/null +++ b/_static/sphinx_highlight.js @@ -0,0 +1,154 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 && + !parent.classList.contains(className) && + !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + const rest = document.createTextNode(val.substr(pos + text.length)); + parent.insertBefore( + span, + parent.insertBefore( + rest, + node.nextSibling + ) + ); + node.nodeValue = val.substr(0, pos); + /* There may be more occurrences of search term in this node. So call this + * function recursively on the remaining fragment. + */ + _highlight(rest, addItems, text, className); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect" + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target) + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms") + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + + // get individual terms from highlight string + const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/genindex.html b/genindex.html new file mode 100644 index 0000000..bdc7d09 --- /dev/null +++ b/genindex.html @@ -0,0 +1,1634 @@ + + + + + + + Index — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ + +

Index

+ +
+ A + | B + | C + | D + | E + | F + | G + | H + | I + | J + | K + | L + | M + | N + | O + | P + | Q + | R + | S + | T + | U + | V + | W + +
+

A

+ + + +
+ +

B

+ + + +
+ +

C

+ + + +
+ +

D

+ + + +
+ +

E

+ + + +
+ +

F

+ + + +
+ +

G

+ + + +
+ +

H

+ + + +
+ +

I

+ + + +
+ +

J

+ + + +
+ +

K

+ + + +
+ +

L

+ + + +
+ +

M

+ + + +
+ +

N

+ + + +
+ +

O

+ + + +
+ +

P

+ + + +
+ +

Q

+ + + +
+ +

R

+ + + +
    +
  • + rxnutils.chem.utils + +
  • +
  • + rxnutils.data + +
  • +
  • + rxnutils.data.base_pipeline + +
  • +
  • + rxnutils.data.batch_utils + +
  • +
  • + rxnutils.data.mapping + +
  • +
  • + rxnutils.data.mapping_pipeline + +
  • +
  • + rxnutils.data.ord + +
  • +
  • + rxnutils.data.ord.import_ord_dataset + +
  • +
  • + rxnutils.data.ord.preparation_pipeline + +
  • +
  • + rxnutils.data.uspto + +
  • +
  • + rxnutils.data.uspto.combine + +
  • +
  • + rxnutils.data.uspto.download + +
  • +
  • + rxnutils.data.uspto.preparation_pipeline + +
  • +
  • + rxnutils.data.uspto.uspto_yield + +
  • +
  • + rxnutils.pipeline + +
  • +
  • + rxnutils.pipeline.actions + +
  • +
  • + rxnutils.pipeline.actions.dataframe_mod + +
  • +
  • + rxnutils.pipeline.actions.reaction_mod + +
  • +
  • + rxnutils.pipeline.actions.reaction_props + +
  • +
  • + rxnutils.pipeline.actions.templates + +
  • +
  • + rxnutils.pipeline.base + +
  • +
  • + rxnutils.pipeline.runner + +
  • +
  • + rxnutils.routes + +
  • +
  • + rxnutils.routes.base + +
  • +
  • + rxnutils.routes.comparison + +
  • +
  • + rxnutils.routes.image + +
  • +
  • + rxnutils.routes.readers + +
  • +
  • + rxnutils.routes.retro_bleu + +
  • +
  • + rxnutils.routes.retro_bleu.ngram_collection + +
  • +
  • + rxnutils.routes.retro_bleu.scoring + +
  • +
  • + rxnutils.routes.scoring + +
  • +
  • + rxnutils.routes.ted + +
  • +
  • + rxnutils.routes.ted.distances_calculator + +
  • +
  • + rxnutils.routes.ted.reactiontree + +
  • +
  • + rxnutils.routes.ted.utils + +
  • +
  • + rxnutils.routes.utils + +
  • +
  • + rxnutils.routes.utils.validation + +
  • +
+ +

S

+ + + +
+ +

T

+ + + +
+ +

U

+ + + +
+ +

V

+ + +
+ +

W

+ + +
+ + + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..65c86e9 --- /dev/null +++ b/index.html @@ -0,0 +1,153 @@ + + + + + + + + rxnutils documentation — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils documentation

+

rxnutils is a collection of routines for working with reactions, reaction templates and template extraction

+
+

Introduction

+

The package is divided into (currently) three sub-packages:

+
    +
  • chem - chemistry routines like template extraction or reaction cleaning

  • +
  • data - routines for manipulating various reaction data sources

  • +
  • pipeline - routines for building and executing simple pipelines for modifying and analyzing reactions

  • +
  • routes - routines for handling synthesis routes

  • +
+

Auto-generated API documentation is available, as well as guides for common tasks. See the menu to the left.

+
+
+

Installation

+

For most users it is as simple as

+
pip install reaction-utils
+
+
+

For developers, first clone the repository using Git.

+

Then execute the following commands in the root of the repository

+
conda env create -f env-dev.yml
+conda activate rxn-env
+poetry install
+
+
+

the rxnutils package is now installed in editable mode.

+

Lastly, make sure to install pre-commits that are run on every commit

+
pre-commit install
+
+
+
+
+

Limitations

+
    +
  • Some old RDKit wheels on pypi did not include the Contrib folder, preventing the usage of the rdkit_RxnRoleAssignment action

  • +
  • The pipeline for the Open reaction database requires some additional dependencies, see the documentation for this pipeline

  • +
  • Using the data piplines for the USPTO and Open reaction database requires you to setup a second python environment

  • +
  • The RInChI capabilities are not supported on MacOS

  • +
+
+
+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/modules.html b/modules.html new file mode 100644 index 0000000..5fd41fb --- /dev/null +++ b/modules.html @@ -0,0 +1,160 @@ + + + + + + + + rxnutils — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/objects.inv b/objects.inv new file mode 100644 index 0000000..f5bced6 Binary files /dev/null and b/objects.inv differ diff --git a/ord.html b/ord.html new file mode 100644 index 0000000..9cfab87 --- /dev/null +++ b/ord.html @@ -0,0 +1,210 @@ + + + + + + + + Open reaction database — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

Open reaction database

+

rxnutils contain two pipelines that together imports and prepares the reaction data from the Open reaction database so that it can be used on modelling.

+

It is a complete end-to-end pipeline that is designed to be transparent and reproducible.

+
+

Pre-requisites

+

The reason the pipeline is divided into two blocks is because the dependencies of the atom-mapper package (rxnmapper) is incompatible with +the dependencies rxnutils package. Therefore, to be able to use to full pipeline, you need to setup two python environment.

+
    +
  1. Install rxnutils according to the instructions in the README-file

  2. +
  3. Install the ord-schema package in the `` rxnutils`` environment

    +
    +

    conda activate rxn-env +python -m pip install ord-schema

    +
    +
  4. +
  5. Download/Clone the ord-data repository according to the instructions here: https://github.com/Open-Reaction-Database/ord-data

    +
    +
    +
  6. +
+

Note down the path to the repository as this needs to be given to the preparation pipeline

+
    +
  1. Install rxnmapper according to the instructions in the repo: https://github.com/rxn4chemistry/rxnmapper

  2. +
+
conda create -n rxnmapper python=3.6 -y
+conda activate rxnmapper
+conda install -c rdkit rdkit=2020.03.3.0
+python -m pip install rxnmapper
+
+
+
    +
  1. Install Metaflow and rxnutils in the new environment

  2. +
+
python -m pip install metaflow
+python -m pip install --no-deps --ignore-requires-python .
+
+
+
+
+

Usage

+

Create a folder for the ORD data and in that folder execute this command in the rxnutils environment

+
conda activate rxn-env
+python -m rxnutils.data.ord.preparation_pipeline run --nbatches 200  --max-workers 8 --max-num-splits 200 --ord-data ORD_DATA_REPO_PATH
+
+
+

and then in the environment with the rxnmapper run

+
conda activate rxnmapper
+python -m rxnutils.data.mapping_pipeline run --data-prefix ord --nbatches 200  --max-workers 8 --max-num-splits 200
+
+
+

The -max-workers flag should be set to the number of CPUs available.

+

On 8 CPUs and 1 GPU the pipeline takes a couple of hours.

+
+
+

Artifacts

+

The pipelines creates a number of tab-separated CSV files:

+
+
    +
  • ord_data.csv is the imported ORD data

  • +
  • ord_data_cleaned.csv is the cleaned and filter data

  • +
  • ord_data_mapped.csv is the atom-mapped, modelling-ready data

  • +
+
+
+
The cleaning is done to be able to atom-map the reactions and are performing the following tasks:
    +
  • Ignore extended SMILES information in the SMILES strings

  • +
  • Remove molecules not sanitizable by RDKit

  • +
  • Remove reactions without any reactants or products

  • +
  • Move all reagents to reactants

  • +
  • Remove the existing atom-mapping

  • +
  • Remove reactions with more than 200 atoms when summing reactants and products

  • +
+
+
+

(the last is a requisite for rxnmapper that was trained on a maximum token size roughly corresponding to 200 atoms)

+

The ord_data_mapped.csv files will have the following columns:

+
+
    +
  • ID - unique ID from the original database

  • +
  • Dataset - the name of the dataset from which this is reaction is taken

  • +
  • Date - the date of the experiment as given in the database

  • +
  • ReactionSmiles - the original reaction SMILES

  • +
  • Yield - the yield of the first product of the first outcome, if provided

  • +
  • ReactionSmilesClean - the reaction SMILES after cleaning

  • +
  • BadMolecules - molecules not sanitizable by RDKit

  • +
  • ReactantSize - number of atoms in reactants

  • +
  • ProductSize - number of atoms in products

  • +
  • mapped_rxn - the mapped reaction SMILES

  • +
  • confidence - the confidence of the mapping as provided by rxnmapper

  • +
+
+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/pipeline.html b/pipeline.html new file mode 100644 index 0000000..24865c5 --- /dev/null +++ b/pipeline.html @@ -0,0 +1,231 @@ + + + + + + + + Pipeline — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

Pipeline

+

rxnutils provide a simple pipeline to perform simple tasks on reaction SMILES and templates in a CSV-file.

+

The pipeline works on tab-separated CSV files (TSV files)

+
+

Usage

+

To exemplify the pipeline capabilities, we will have a look at the pipeline used to clean the USPTO data.

+

The input to the pipeline is a simple YAML-file that specifies each action to take. The actions will be executed +sequentially, one after the other and each action takes a number of input arguments.

+

This is the YAML-file used to clean the USPTO data:

+
trim_rxn_smiles:
+    in_column: ReactionSmiles
+    out_column: ReactionSmilesClean
+remove_unsanitizable:
+    in_column: ReactionSmilesClean
+    out_column: ReactionSmilesClean
+reagents2reactants:
+    in_column: ReactionSmilesClean
+    out_column: ReactionSmilesClean
+remove_atom_mapping:
+    in_column: ReactionSmilesClean
+    out_column: ReactionSmilesClean
+reactantsize:
+    in_column: ReactionSmilesClean
+productsize:
+    in_column: ReactionSmilesClean
+query_dataframe1:
+    query: "ReactantSize>0"
+query_dataframe2:
+    query: "ProductSize>0"
+query_dataframe3:
+    query: "ReactantSize+ProductSize<200"
+
+
+

The first action is called trim_rxn_smiles and two arguments are given: in_column specifying which column to use as input and out_column specifying which column +to use as output.

+

The following actions remove_unsanitizable, reagents2reactants, remove_atom_mapping, reactantsize, productsize works the same way, but might use other columns to specified for output.

+

The last three actions are actually the same action but executed with different arguments. They therefore have to be postfixed with 1, 2 and 3. +The action query_dataframe takes a query argument and removes a number of rows not matching the query.

+

If we save this to clean_pipeline.yml and given that we have a tab-separated file with USPTO data called uspto_data.csv we can run the following command

+
python -m rxnutils.pipeline.runner --pipeline clean_pipeline.yml --data uspto_data.csv --output uspto_cleaned.csv
+
+
+

or we can alternatively run it from a python method like this

+
from rxnutils.pipeline.runner import main as validation_runner
+
+validation_runner(
+    [
+        "--pipeline",
+        "clean_pipeline.yml",
+        "--data",
+        "uspto_data.csv",
+        "--output",
+        "uspto_cleaned.csv",
+    ]
+)
+
+
+
+
+

Actions

+

To find out what actions are available, you can type

+
python -m rxnutils.pipeline.runner --list
+
+
+
+
+

Development

+

New actions can easily be added to the pipeline framework. All of the actions are implemented in one of four modules

+
+
    +
  • rxnutils.pipeline.actions.dataframe_mod - actions that modify the dataframe, e.g., removing rows or columns

  • +
  • rxnutils.pipeline.actions.reaction_mod - actions that modify reaction SMILES

  • +
  • rxnutils.pipeline.actions.dataframe_props - actions that compute properties from reaction SMILES

  • +
  • rxnutils.pipeline.actions.templates - actions that process reaction templates

  • +
+
+

To exemplify, let’s have a look at the productsize action

+
@action
+@dataclass
+class ProductSize:
+"""Action for counting product size"""
+
+pretty_name: ClassVar[str] = "productsize"
+in_column: str
+out_column: str = "ProductSize"
+
+def __call__(self, data: pd.DataFrame) -> pd.DataFrame:
+    smiles_col = global_apply(data, self._row_action, axis=1)
+    return data.assign(**{self.out_column: smiles_col})
+
+def __str__(self) -> str:
+    return f"{self.pretty_name} (number of heavy atoms in product)"
+
+def _row_action(self, row: pd.Series) -> str:
+    _, _, products = row[self.in_column].split(">")
+    products_mol = Chem.MolFromSmiles(products)
+
+    if products_mol:
+        product_atom_count = products_mol.GetNumHeavyAtoms()
+    else:
+        product_atom_count = 0
+
+    return product_atom_count
+
+
+

The action is defined as a class ProductSize that has two class-decorators. +The first @action will register the action in a global action list and second @dataclass is dataclass decorator from the standard library. +The pretty_name class variable is used to identify the action in the pipeline, that is what you are specifying in the YAML-file. +The other two in_column and out_column are the arguments you can specify in the YAML file for executing the action, they can have default +values in case they don’t need to be specified in the YAML file.

+

When the action is executed by the pipeline the __call__ method is invoked with the current Pandas dataframe as the only argument. This method +should return the modified dataframe.

+

Lastly, it is nice to implement a __str__ method which is used by the pipeline to print useful information about the action that is executed.

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/py-modindex.html b/py-modindex.html new file mode 100644 index 0000000..675b501 --- /dev/null +++ b/py-modindex.html @@ -0,0 +1,348 @@ + + + + + + + Python Module Index — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ + +

Python Module Index

+ +
+ r +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ r
+ rxnutils +
    + rxnutils.chem +
    + rxnutils.chem.augmentation +
    + rxnutils.chem.cgr +
    + rxnutils.chem.reaction +
    + rxnutils.chem.rinchi +
    + rxnutils.chem.rinchi.download_rinchi +
    + rxnutils.chem.rinchi.rinchi_api +
    + rxnutils.chem.template +
    + rxnutils.chem.utils +
    + rxnutils.data +
    + rxnutils.data.base_pipeline +
    + rxnutils.data.batch_utils +
    + rxnutils.data.mapping +
    + rxnutils.data.mapping_pipeline +
    + rxnutils.data.ord +
    + rxnutils.data.ord.import_ord_dataset +
    + rxnutils.data.ord.preparation_pipeline +
    + rxnutils.data.uspto +
    + rxnutils.data.uspto.combine +
    + rxnutils.data.uspto.download +
    + rxnutils.data.uspto.preparation_pipeline +
    + rxnutils.data.uspto.uspto_yield +
    + rxnutils.pipeline +
    + rxnutils.pipeline.actions +
    + rxnutils.pipeline.actions.dataframe_mod +
    + rxnutils.pipeline.actions.reaction_mod +
    + rxnutils.pipeline.actions.reaction_props +
    + rxnutils.pipeline.actions.templates +
    + rxnutils.pipeline.base +
    + rxnutils.pipeline.runner +
    + rxnutils.routes +
    + rxnutils.routes.base +
    + rxnutils.routes.comparison +
    + rxnutils.routes.image +
    + rxnutils.routes.readers +
    + rxnutils.routes.retro_bleu +
    + rxnutils.routes.retro_bleu.ngram_collection +
    + rxnutils.routes.retro_bleu.scoring +
    + rxnutils.routes.scoring +
    + rxnutils.routes.ted +
    + rxnutils.routes.ted.distances_calculator +
    + rxnutils.routes.ted.reactiontree +
    + rxnutils.routes.ted.utils +
    + rxnutils.routes.utils +
    + rxnutils.routes.utils.validation +
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/routes.html b/routes.html new file mode 100644 index 0000000..0ca3a3e --- /dev/null +++ b/routes.html @@ -0,0 +1,166 @@ + + + + + + + + Routes — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

Routes

+

rxnutils contains routines to analyse synthesis routes. There are a number of readers that can be used to read routes from a number of +formats, and there are routines to score the different routes.

+
+

Reading

+

The simplest route format supported is a text file, where each reaction is written as a reaction SMILES in a line. +Routes are separated by new-line

+

For instance:

+
CC(C)N.Clc1cccc(Nc2ccoc2)n1>>CC(C)Nc1cccc(Nc2ccoc2)n1
+Brc1ccoc1.Nc1cccc(Cl)n1>>Clc1cccc(Nc2ccoc2)n1
+
+Nc1cccc(NC(C)C)n1.Brc1ccoc1>>CC(C)Nc1cccc(Nc2ccoc2)n1
+CC(C)N.Nc1cccc(Cl)n1>>Nc1cccc(NC(C)C)n1
+
+
+

If this is saved to routes.txt, these can be read into route objects with

+
from rxnutils.routes.readers import read_reaction_lists
+routes = read_reaction_lists("reactions.txt")
+
+
+

If you have an environment with rxnmapper installed and the NextMove software namerxn in your PATH then you can +add atom-mapping and reaction classes to these routes with

+
# This can be set on the command-line as well
+import os
+os.environ["RXNMAPPER_ENV_PATH"] = "/home/username/miniconda/envs/rxnmapper/"
+
+for route in routes:
+    route.assign_atom_mapping(only_rxnmapper=True)
+routes[1].remap(routes[0])
+
+
+

The last line of code also make sure that the second route shares mapping with the first route.

+

Other readers are available

+
    +
  • read_aizynthcli_dataframe - for reading routes from aizynthcli output dataframe

  • +
  • read_reactions_dataframe - for reading routes stored as reactions in a dataframe

  • +
+

For instance, to read routes from a dataframe with reactions. You can do something like what follows. +The dataframe has column reaction_smiles that holds the reaction SMILES, and the individual routes +are identified by a target_smiles and route_id column. The dataframe also has a column classification, +holding the NextMove classification. The dataframe is called data.

+
from rxnutils.routes.readers import read_reactions_dataframe
+routes = read_reactions_dataframe(
+    data,
+    "reaction_smiles",
+    group_by=["target_smiles", "route_id"],
+    metadata_columns=["classification"]
+)
+
+
+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/rxnutils.chem.html b/rxnutils.chem.html new file mode 100644 index 0000000..689fae2 --- /dev/null +++ b/rxnutils.chem.html @@ -0,0 +1,1130 @@ + + + + + + + + rxnutils.chem package — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils.chem package

+
+

Subpackages

+ +
+
+

Submodules

+
+
+

rxnutils.chem.augmentation module

+

Routines for augmenting chemical reactions

+
+
+rxnutils.chem.augmentation.single_reactant_augmentation(smiles, classification)
+

Augment single-reactant reaction with additional reagent if possible +based on the classification of the reaction +:param smiles: the reaction SMILES to augment +:param classification: the classification of the reaction or an empty string +:return: the processed SMILES

+
+
Parameters:
+
    +
  • smiles (str)

  • +
  • classification (str)

  • +
+
+
Return type:
+

str

+
+
+
+ +
+
+

rxnutils.chem.cgr module

+

Wrapper class for the CGRTools library

+
+
+class rxnutils.chem.cgr.CondensedGraphReaction(reaction)
+

Bases: object

+

The Condensed Graph of Reaction (CGR) representation of a reaction

+
+
Variables:
+
    +
  • reaction_container – the CGRTools container of the reaction

  • +
  • cgr_container – the CGRTools container of the CGR

  • +
+
+
Parameters:
+

reaction (ChemicalReaction) – the reaction composed of RDKit molecule to start from

+
+
Raises:
+

ValueError – if it is not possible to create the CGR from the reaction

+
+
+
+
+property bonds_broken: int
+

Returns the number of broken bonds in the reaction

+
+ +
+
+property bonds_changed: int
+

Returns the number of broken or formed bonds in the reaction

+
+ +
+
+property bonds_formed: int
+

Returns the number of formed bonds in the reaction

+
+ +
+
+property total_centers: int
+

Returns the number of atom and bond centers in the reaction

+
+ +
+
+distance_to(other)
+

Returns the chemical distance between two reactions, i.e. the absolute difference +between the total number of centers.

+

Used for some atom-mapping comparison statistics

+
+
Parameters:
+

other (CondensedGraphReaction) – the reaction to compare to

+
+
Returns:
+

the computed distance

+
+
Return type:
+

int

+
+
+
+ +
+ +
+
+

rxnutils.chem.reaction module

+

Module containing a class to handle chemical reactions

+
+
+exception rxnutils.chem.reaction.ReactionException
+

Bases: Exception

+

Custom exception raised when failing operations on a chemical reaction

+
+ +
+
+class rxnutils.chem.reaction.ChemicalReaction(smiles, id_=None, clean_smiles=True)
+

Bases: object

+

Representation of chemical reaction

+
+
Parameters:
+
    +
  • smiles (str) – the reaction SMILES

  • +
  • id – an optional database ID of the reaction

  • +
  • clean_smiles (bool) – if True, will standardize the reaction SMILES

  • +
  • id_ (str)

  • +
+
+
+
+
+property agents_list: List[str]
+

Gives all the agents as strings

+
+ +
+
+property canonical_template: ReactionTemplate
+

Gives the canonical (forward) template

+
+ +
+
+property products_list: List[str]
+

Gives all products as strings

+
+ +
+
+property pseudo_rinchi: str
+

Gives pseudo RInChI

+
+ +
+
+property pseudo_rinchi_key: str
+

Gives a pseudo reaction InChI key

+
+ +
+
+property hashed_rid: str
+

Gives a reaction hashkey based on Reaction SMILES & reaction id.

+
+ +
+
+property reactants_list: List[str]
+

Gives all reactants as strings

+
+ +
+
+property retro_template: ReactionTemplate
+

Gives the retro template

+
+ +
+
+property rinchi: str
+

Gives the reaction InChI

+
+ +
+
+property rinchi_key_long: str
+

Gives the long reaction InChI key

+
+ +
+
+property rinchi_key_short: str
+

Gives the short reaction InChI key

+
+ +
+
+generate_coreagent()
+

Extract un-mapped product atoms as extra ractant fragments

+
+ +
+
+generate_reaction_template(radius=1, expand_ring=False, expand_hetero=False)
+

Extracts the forward(canonical) and retro reaction template with the specified radius.

+
+
Uses a modified version of:

https://github.com/connorcoley/ochem_predict_nn/blob/master/data/generate_reaction_templates.py +https://github.com/connorcoley/rdchiral/blob/master/templates/template_extractor.py

+
+
+
+
Parameters:
+
    +
  • radius (int) – the radius refers to the number of atoms away from the reaction +centre to be extracted (the enivronment) i.e. radius = 1 (default) +returns the first neighbours around the reaction centre

  • +
  • expand_ring (bool) – if True will include all atoms in the same ring as the reaction centre in the template

  • +
  • expand_hetero (bool) – if True will extend the template with all bonded hetero atoms

  • +
+
+
Returns:
+

the canonical and retrosynthetic templates

+
+
Return type:
+

Tuple[ReactionTemplate, ReactionTemplate]

+
+
+
+ +
+
+has_partial_mapping()
+

Check product atom mapping.

+
+
Return type:
+

bool

+
+
+
+ +
+
+is_complete()
+

Check that the product is not among the reactants

+
+
Return type:
+

bool

+
+
+
+ +
+
+no_change()
+

Checks to see if the product appears in the reactant set.

+

Compares InChIs to rule out possible variations in SMILES notation.

+
+
Returns:
+

True the product is present in the reactants set, else False

+
+
Return type:
+

bool

+
+
+
+ +
+
+is_fuzzy()
+

Checks to see if there is fuzziness in the reaction.

+
+
Returns:
+

True if there is fuzziness, False otherwise

+
+
Return type:
+

bool

+
+
+
+ +
+
+sanitization_check()
+

Checks if the reactant and product mol objects can be sanitized in RDKit.

+

The actualy sanitization is carried out when the reaction is instansiated, +this method will only check that all molecules objects were created.

+
+
Returns:
+

True if all the molecule objects were successfully created, else False

+
+
Return type:
+

bool

+
+
+
+ +
+
+canonical_template_generate_outcome()
+

Checks whether the canonical template produces

+
+
Return type:
+

bool

+
+
+
+ +
+
+retro_template_generate_outcome()
+

Checks whether the retrosynthetic template produces an outcome

+
+
Return type:
+

bool

+
+
+
+ +
+
+retro_template_selectivity()
+

Checks whether the recorded reactants belong to the set of generated precursors.

+
+
Returns:
+

selectivity, i.e. the fraction of generated precursors matching the recorded precursors +i.e. 1.0 - match or match.match or match.match.match etc.

+
+

0.5 - match.none or match.none.match.none etc. +0.0 - none

+
+

+
+
Return type:
+

float

+
+
+
+ +
+ +
+
+

rxnutils.chem.template module

+

Module containing useful representations of templates

+
+
+class rxnutils.chem.template.TemplateMolecule(rd_mol=None, smarts=None)
+

Bases: object

+

Representation of a molecule created from a SMARTS string

+
+
Parameters:
+
    +
  • rd_mol (Mol) – the RDKit molecule to be represented by this class

  • +
  • smarts (str)

  • +
+
+
+
+
+atoms()
+

Generate the atom object of this molecule

+
+
Yield:
+

the next atom object

+
+
Return type:
+

Iterator[Atom]

+
+
+
+ +
+
+atom_invariants()
+

Calculate invariants on similar properties as in RDKit but ignore mass and add aromaticity

+
+
Returns:
+

a list of the atom invariants

+
+
Return type:
+

List[int]

+
+
+
+ +
+
+atom_properties()
+

Return a dictionary with atomic properties

+
+
Example:

import pandas +pandas.DataFrame(my_mol.atom_properties())

+
+
+
+
Return type:
+

Dict[str, List[object]]

+
+
+
+ +
+
+fingerprint_bits(radius=2, use_chirality=True)
+

Calculate the unique fingerprint bits

+

Will sanitize molecule if necessary

+
+
Parameters:
+
    +
  • radius (int) – the radius of the Morgan calculation

  • +
  • use_chirality (bool) – determines if chirality should be taken into account

  • +
+
+
Returns:
+

the set of unique bits

+
+
Return type:
+

Set[int]

+
+
+
+ +
+
+fingerprint_vector(radius=2, nbits=1024, use_chirality=True)
+

Calculate the finger bit vector

+

Will sanitize molecule if necessary

+
+
Parameters:
+
    +
  • radius (int) – the radius of the Morgan calculation

  • +
  • nbits (int) – the length of the bit vector

  • +
  • use_chirality (bool) – determines if chirality should be taken into account

  • +
+
+
Returns:
+

the bit vector

+
+
Return type:
+

ndarray

+
+
+
+ +
+
+fix_atom_properties()
+

Copy over some properties from the SMARTS specification to the atom object +1. Set IsAromatic flag is lower-case a is in the SMARTS +2. Fix formal charges +3. Explicit number of hydrogen atoms

+

Also extract explicit degree from SMARTS and is stored in +the comp_degree property.

+
+
Return type:
+

None

+
+
+
+ +
+
+hash_from_smiles()
+

Create a hash of the template based on a cleaned-up template SMILES string

+
+
Returns:
+

the hash string

+
+
Return type:
+

str

+
+
+
+ +
+
+hash_from_smarts()
+

Create a hash of the template based on a cleaned-up template SMARTS string

+
+
Returns:
+

the hash string

+
+
Return type:
+

str

+
+
+
+ +
+
+remove_atom_mapping()
+

Remove the atom mappings from the molecule

+
+
Return type:
+

None

+
+
+
+ +
+
+sanitize()
+

Will do selective sanitation - skip some procedures that causes problems due to “hanging” aromatic atoms

+
+
All possible flags:

SANITIZE_ADJUSTHS +SANITIZE_ALL +SANITIZE_CLEANUP +SANITIZE_CLEANUPCHIRALITY +SANITIZE_FINDRADICALS +SANITIZE_KEKULIZE +SANITIZE_NONE +SANITIZE_PROPERTIES +SANITIZE_SETAROMATICITY +SANITIZE_SETCONJUGATION +SANITIZE_SETHYBRIDIZATION +SANITIZE_SYMMRINGS

+
+
+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class rxnutils.chem.template.ReactionTemplate(smarts, direction='canonical')
+

Bases: object

+

Representation of a reaction template created with RDChiral

+
+
Parameters:
+
    +
  • smarts (str) – the SMARTS string representation of the reaction

  • +
  • direction (str) – if equal to “retro” reverse the meaning of products and reactants

  • +
+
+
+
+
+apply(mols)
+

Applies the template on the given molecule

+
+
Parameters:
+

mols (str) – the molecule as a SMILES

+
+
Returns:
+

the list of reactants

+
+
Return type:
+

Tuple[Tuple[str, …], …]

+
+
+
+ +
+
+fingerprint_bits(radius=2, use_chirality=True)
+

Calculate the difference count of the fingerprint bits set of the reactants and products

+
+
Parameters:
+
    +
  • radius (int) – the radius of the Morgan calculation

  • +
  • use_chirality (bool) – determines if chirality should be taken into account

  • +
+
+
Returns:
+

a dictionary of the difference count for each bit

+
+
Return type:
+

Dict[int, int]

+
+
+
+ +
+
+fingerprint_vector(radius=2, nbits=1024, use_chirality=True)
+

Calculate the difference fingerprint vector

+
+
Parameters:
+
    +
  • radius (int) – the radius of the Morgan calculation

  • +
  • nbits (int) – the length of the bit vector

  • +
  • use_chirality (bool) – determines if chirality should be taken into account

  • +
+
+
Returns:
+

the bit vector

+
+
Return type:
+

ndarray

+
+
+
+ +
+
+hash_from_bits(radius=2, use_chirality=True)
+

Create a hash of the template based on the difference counts of the fingerprint bits

+
+
Parameters:
+
    +
  • radius (int) – the radius of the Morgan calculation

  • +
  • use_chirality (bool) – determines if chirality should be taken into account

  • +
+
+
Returns:
+

the hash string

+
+
Return type:
+

str

+
+
+
+ +
+
+hash_from_smiles()
+

Create a hash of the template based on a cleaned-up template SMILES string

+
+
Returns:
+

the hash string

+
+
Return type:
+

str

+
+
+
+ +
+
+hash_from_smarts()
+

Create a hash of the template based on a cleaned-up template SMARTS string

+
+
Returns:
+

the hash string

+
+
Return type:
+

str

+
+
+
+ +
+
+rdkit_validation()
+

Checks if the template is valid in RDKit

+
+
Return type:
+

bool

+
+
+
+ +
+ +
+
+

rxnutils.chem.utils module

+

Module containing various chemical utility routines

+
+
+rxnutils.chem.utils.get_special_groups(mol)
+

Given an RDKit molecule, this function returns a list of tuples, where +each tuple contains the AtomIdx’s for a special group of atoms which should +be included in a fragment all together. This should only be done for the +reactants, otherwise the products might end up with mapping mismatches +We draw a distinction between atoms in groups that trigger that whole +group to be included, and “unimportant” atoms in the groups that will not +be included if another atom matches.

+
+
Return type:
+

List[Tuple[Tuple[int, …], Tuple[int, …]]]

+
+
+
+ +
+
+rxnutils.chem.utils.has_atom_mapping(smiles, is_smarts=False, sanitize=True)
+

Returns True if a molecule has atom mapping, else False.

+
+
Parameters:
+
    +
  • smiles (str) – the SMILES/SMARTS representing the molecule

  • +
  • is_smarts (bool) – if True, will interpret the SMILES as a SMARTS

  • +
  • sanitize (bool) – if True, will sanitize the molecule

  • +
+
+
Returns:
+

True if the SMILES string has atom-mapping, else False

+
+
Return type:
+

bool

+
+
+
+ +
+
+rxnutils.chem.utils.remove_atom_mapping(smiles, is_smarts=False, sanitize=True, canonical=True)
+

Returns a molecule without atom mapping

+
+
Parameters:
+
    +
  • smiles (str) – the SMILES/SMARTS representing the molecule

  • +
  • is_smarts (bool) – if True, will interpret the SMILES as a SMARTS

  • +
  • sanitize (bool) – if True, will sanitize the molecule

  • +
  • canonical (bool) – if False, will not canonicalize (applies to SMILES)

  • +
+
+
Returns:
+

the molecule without atom-mapping

+
+
Return type:
+

str

+
+
+
+ +
+
+rxnutils.chem.utils.remove_atom_mapping_template(template_smarts)
+

Remove atom mapping from a template SMARTS string

+
+
Parameters:
+

template_smarts (str)

+
+
Return type:
+

str

+
+
+
+ +
+
+rxnutils.chem.utils.neutralize_molecules(smiles_list)
+

Neutralize a set of molecules using RDKit routines

+
+
Parameters:
+

smiles_list (List[str]) – the molecules as SMILES

+
+
Returns:
+

the neutralized molecules

+
+
Return type:
+

List[str]

+
+
+
+ +
+
+rxnutils.chem.utils.desalt_molecules(smiles_list, keep_something=False)
+

Remove salts from a set of molecules using RDKit routines

+
+
Parameters:
+
    +
  • smiles_list (List[str]) – the molecules as SMILES

  • +
  • keep_something (bool) – if True will keep at least one salt

  • +
+
+
Returns:
+

the desalted molecules

+
+
Return type:
+

List[str]

+
+
+
+ +
+
+rxnutils.chem.utils.same_molecule(mol1, mol2)
+

Test if two molecules are the same. +First number of atoms and bonds are compared to guard the potentially more expensive +substructure match. If mol1 is a substructure of mol2 and vice versa, the molecules +are considered to be the same.

+
+
Parameters:
+
    +
  • mol1 – First molecule

  • +
  • mol2 – Second molecule for comparison

  • +
+
+
Returns:
+

if the molecules match

+
+
Return type:
+

bool

+
+
+
+ +
+
+rxnutils.chem.utils.atom_mapping_numbers(smiles)
+

Return the numbers in the atom mapping

+
+
Parameters:
+

smiles (str) – the molecule as SMILES

+
+
Returns:
+

the atom mapping numbers

+
+
Return type:
+

List[int]

+
+
+
+ +
+
+rxnutils.chem.utils.reassign_rsmi_atom_mapping(rsmi, as_smiles=False)
+

Reassign reaction’s atom mapping. +Remove atom maps for atoms in reactants and reactents not found in product’s atoms.

+
+
Parameters:
+
    +
  • rsmi (str) – Reaction SMILES

  • +
  • as_smiles (bool) – Return reaction SMILES or SMARTS, defaults to False

  • +
+
+
Returns:
+

Reaction SMILES or SMARTS

+
+
Return type:
+

str

+
+
+
+ +
+
+rxnutils.chem.utils.join_smiles_from_reaction(smiles_list)
+

Join a part of reaction SMILES, e.g. reactants and products into components. +Intra-molecular complexes are bracketed with parenthesis

+
+
Parameters:
+

smiles_list (List[str]) – the SMILES components

+
+
Returns:
+

the joined list

+
+
Return type:
+

str

+
+
+
+ +
+
+rxnutils.chem.utils.split_smiles_from_reaction(smiles)
+

Split a part of reaction SMILES, e.g. reactants or products +into components. Taking care of intra-molecular complexes

+

Taken from RDKit: +https://github.com/rdkit/rdkit/blob/master/Code/GraphMol/ChemReactions/DaylightParser.cpp

+
+
Parameters:
+

smiles (str) – the SMILES/SMARTS

+
+
Returns:
+

the individual components.

+
+
Return type:
+

List[str]

+
+
+
+ +
+
+rxnutils.chem.utils.reaction_centres(rxn)
+

Return reaction centre atoms, provided that the bonding partners +actually change when comparing the environment in the reactant and the product

+

inspired by code from Greg Landrum’s tutorial +set up array to remove atoms from the reaction centers +by comparing the atom mapping in the reactant vs the products

+

Original implementation by Christoph Bauer

+
+
Parameters:
+

rxn (ChemicalReaction) – the initialized RDKit reaction

+
+
Returns:
+

tuple of reaction centre atoms, filtered by connectivity criterion

+
+
Return type:
+

Tuple[List[int], …]

+
+
+
+ +
+
+

Module contents

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/rxnutils.chem.rinchi.html b/rxnutils.chem.rinchi.html new file mode 100644 index 0000000..b68d089 --- /dev/null +++ b/rxnutils.chem.rinchi.html @@ -0,0 +1,217 @@ + + + + + + + + rxnutils.chem.rinchi package — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils.chem.rinchi package

+
+

Submodules

+
+
+

rxnutils.chem.rinchi.download_rinchi module

+

Module for downloading InChI Trust Reaction InChI.

+
+
+exception rxnutils.chem.rinchi.download_rinchi.RInChIError
+

Bases: Exception

+

Exception raised by RInChI API

+
+ +
+
+rxnutils.chem.rinchi.download_rinchi.main()
+

Check if Reaction InchI application is present. +Download it if it’s required to do so.

+
+
Returns:
+

Path of the folder containing the appropriate +command line executable based on system type.

+
+
Return type:
+

str

+
+
+
+ +
+
+

rxnutils.chem.rinchi.rinchi_api module

+

Module containing an API to the Reaction InChI program

+
+
+rxnutils.chem.rinchi.rinchi_api.RInChIStructure
+

alias of RInChI

+
+ +
+
+rxnutils.chem.rinchi.rinchi_api.generate_rinchi(reaction_smiles)
+

Generate RInChI from Reaction SMILES.

+
+
Parameters:
+

reaction_smiles (str) – Reaction SMILES

+
+
Raises:
+

RInChIError – When there is an error with RInChI generation.

+
+
Returns:
+

Namedtuple with the generated RInChI.

+
+
Return type:
+

RInChI

+
+
+
+ +
+
+

Module contents

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/rxnutils.data.html b/rxnutils.data.html new file mode 100644 index 0000000..1e1c910 --- /dev/null +++ b/rxnutils.data.html @@ -0,0 +1,451 @@ + + + + + + + + rxnutils.data package — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils.data package

+
+

Subpackages

+ +
+
+

Submodules

+
+
+

rxnutils.data.base_pipeline module

+

Module containing base class for data pipelines

+
+
+class rxnutils.data.base_pipeline.DataBaseFlow(use_cli=True)
+

Bases: FlowSpec

+

Base-class for pipelines for processing data

+
+
+nbatches = metaflow.Parameter(name=nbatches, kwargs={'type': <class 'int'>, 'required': True, 'show_default': True})
+
+ +
+
+folder = metaflow.Parameter(name=folder, kwargs={'default': '.', 'required': False, 'show_default': True, 'type': <class 'str'>})
+
+ +
+ +
+
+class rxnutils.data.base_pipeline.DataPreparationBaseFlow(use_cli=True)
+

Bases: DataBaseFlow

+

Base pipeline for preparing datasets and doing clean-up

+
+
+data_prefix = ''
+
+ +
+ +
+
+

rxnutils.data.batch_utils module

+
+
+rxnutils.data.batch_utils.nlines(filename)
+

Count and return the number of lines in a file

+
+
Parameters:
+

filename (str)

+
+
Return type:
+

int

+
+
+
+ +
+
+rxnutils.data.batch_utils.combine_batches(filename, nbatches, read_func, write_func, combine_func)
+
+
Parameters:
+
    +
  • filename (str)

  • +
  • nbatches (int)

  • +
  • read_func (Any)

  • +
  • write_func (Any)

  • +
  • combine_func (Any)

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+rxnutils.data.batch_utils.combine_csv_batches(filename, nbatches)
+

Combine CSV batches to one master file

+

The batch files are removed from disc

+
+
Parameters:
+
    +
  • filename (str) – the filename of the master file

  • +
  • nbatches (int) – the number of batches

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+rxnutils.data.batch_utils.combine_sparse_matrix_batches(filename, nbatches)
+

Combine sparse matrix batches to one master file

+

The batch files are removed from disc

+
+
Parameters:
+
    +
  • filename (str) – the filename of the master file

  • +
  • nbatches (int) – the number of batches

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+rxnutils.data.batch_utils.create_csv_batches(filename, nbatches, output_filename=None)
+

Create batches for reading a splitted CSV-file

+
+
The batches will be in the form of a tuple with three indices:
    +
  • Batch index

  • +
  • Start index

  • +
  • End index

  • +
+
+
+
+
Parameters:
+
    +
  • filename (str) – the CSV file to make batches of

  • +
  • nbatches (int) – the number of batches

  • +
  • output_filename (str | None)

  • +
+
+
Returns:
+

the created batches

+
+
Return type:
+

List[Tuple[int, int, int]]

+
+
+
+ +
+
+rxnutils.data.batch_utils.read_csv_batch(filename, batch=None, **kwargs)
+

Read parts of a CSV file as specified by a batch

+
+
Parameters:
+
    +
  • filename (str) – the path to the CSV file on disc

  • +
  • batch (Tuple[int, ...] | None) – the batch specification as returned by create_csv_batches

  • +
  • kwargs (Any)

  • +
+
+
Return type:
+

DataFrame

+
+
+
+ +
+
+

rxnutils.data.mapping module

+

Module containing script to atom-map USPTO or ORD reactions

+
+
+rxnutils.data.mapping.main(input_args=None)
+

Function for command-line tool

+
+
Parameters:
+

input_args (Sequence[str] | None)

+
+
Return type:
+

None

+
+
+
+ +
+
+

rxnutils.data.mapping_pipeline module

+

Module containing pipeline for mapping with rxnmapper +This needs to be run in an environment with rxnmapper installed

+
+
+class rxnutils.data.mapping_pipeline.RxnMappingFlow(use_cli=True)
+

Bases: DataBaseFlow

+

Pipeline for atom-map USPTO or ORD data with rxnmapper

+
+
+data_prefix = metaflow.Parameter(name=data-prefix, kwargs={'required': False, 'show_default': True, 'type': <class 'str'>})
+
+ +
+
+start()
+

Setup batches for mapping

+
+ +
+
+do_mapping()
+

Perform atom-mapping of reactions

+
+ +
+
+join_mapping(_)
+

Join batches from mapping

+
+ +
+
+end()
+

Final step, just print information

+
+ +
+ +
+
+

Module contents

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/rxnutils.data.ord.html b/rxnutils.data.ord.html new file mode 100644 index 0000000..a2e1c57 --- /dev/null +++ b/rxnutils.data.ord.html @@ -0,0 +1,237 @@ + + + + + + + + rxnutils.data.ord package — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils.data.ord package

+
+

Submodules

+
+
+

rxnutils.data.ord.import_ord_dataset module

+

Module containing script to import ORD dataset to a CSV file

+
+
+rxnutils.data.ord.import_ord_dataset.main(input_args=None)
+

Function for command-line tool

+
+
Parameters:
+

input_args (Sequence[str] | None)

+
+
Return type:
+

None

+
+
+
+ +
+
+

rxnutils.data.ord.preparation_pipeline module

+

Module containing pipeline for extracting, transforming and cleaning Open reaction database data +This needs to be run in an environment with rxnutils installed

+
+
+class rxnutils.data.ord.preparation_pipeline.OrdDataPreparationFlow(use_cli=True)
+

Bases: DataPreparationBaseFlow

+

Pipeline for extracting ORD data and do some clean-up

+
+
+ord_data = metaflow.Parameter(name=ord-data, kwargs={'required': False, 'show_default': True, 'type': <class 'str'>})
+
+ +
+
+data_prefix = 'ord'
+
+ +
+
+start()
+

Import ORD data

+
+ +
+
+setup_cleaning()
+

Setup cleaning

+
+ +
+
+do_cleaning()
+

Perform cleaning of data

+
+ +
+
+join_cleaning(_)
+

Combined cleaned batches of data

+
+ +
+
+end()
+

Final step, just print information

+
+ +
+ +
+
+

Module contents

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/rxnutils.data.uspto.html b/rxnutils.data.uspto.html new file mode 100644 index 0000000..5504aa8 --- /dev/null +++ b/rxnutils.data.uspto.html @@ -0,0 +1,314 @@ + + + + + + + + rxnutils.data.uspto package — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils.data.uspto package

+
+

Submodules

+
+
+

rxnutils.data.uspto.combine module

+

Module containing script to combine raw USPTO files

+
+
It will:
    +
  • preserve the ReactionSmiles and Year columns

  • +
  • create an ID from PatentNumber and ParagraphNum and row index in the original file

  • +
+
+
+
+
+rxnutils.data.uspto.combine.main(args=None)
+

Function for command-line tool

+
+
Parameters:
+

args (Sequence[str] | None)

+
+
Return type:
+

None

+
+
+
+ +
+
+

rxnutils.data.uspto.download module

+

Module containing a script to download USPTO files Figshare

+
+
+rxnutils.data.uspto.download.main(args=None)
+

Function for command-line tool

+
+
Parameters:
+

args (Sequence[str] | None)

+
+
Return type:
+

None

+
+
+
+ +
+
+

rxnutils.data.uspto.preparation_pipeline module

+

Module containing pipeline for downloading, transforming and cleaning USPTO data +This needs to be run in an environment with rxnutils installed

+
+
+class rxnutils.data.uspto.preparation_pipeline.UsptoDataPreparationFlow(use_cli=True)
+

Bases: DataPreparationBaseFlow

+

Pipeline for download UPSTO source file, combining them and do some clean-up

+
+
+data_prefix = 'uspto'
+
+ +
+
+start()
+

Download USPTO data from Figshare

+
+ +
+
+combine_files()
+

Combine USPTO data files and add IDs

+
+ +
+
+setup_cleaning()
+

Setup cleaning

+
+ +
+
+do_cleaning()
+

Perform cleaning of data

+
+ +
+
+join_cleaning(_)
+

Combined cleaned batches of data

+
+ +
+
+end()
+

Final step, just print information

+
+ +
+ +
+
+

rxnutils.data.uspto.uspto_yield module

+

Code for curating USPTO yields.

+

Inspiration from this code: https://github.com/DocMinus/Yield_curation_USPTO

+

This could potentially be an action, but since it only make sens to use it +with USPTO data, it resides here for now.

+
+
+class rxnutils.data.uspto.uspto_yield.UsptoYieldCuration(text_yield_column='TextMinedYield', calc_yield_column='CalculatedYield', out_column='CuratedYield')
+

Bases: object

+

Action for curating USPTO yield columns

+
+
Parameters:
+
    +
  • text_yield_column (str)

  • +
  • calc_yield_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+text_yield_column: str = 'TextMinedYield'
+
+ +
+
+calc_yield_column: str = 'CalculatedYield'
+
+ +
+
+out_column: str = 'CuratedYield'
+
+ +
+ +
+
+

Module contents

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/rxnutils.html b/rxnutils.html new file mode 100644 index 0000000..04cd308 --- /dev/null +++ b/rxnutils.html @@ -0,0 +1,404 @@ + + + + + + + + rxnutils package — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils package

+
+

Subpackages

+
+ +
+
+
+

Module contents

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/rxnutils.pipeline.actions.html b/rxnutils.pipeline.actions.html new file mode 100644 index 0000000..1ea5fa1 --- /dev/null +++ b/rxnutils.pipeline.actions.html @@ -0,0 +1,2385 @@ + + + + + + + + rxnutils.pipeline.actions package — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils.pipeline.actions package

+
+

Submodules

+
+
+

rxnutils.pipeline.actions.dataframe_mod module

+

Module containing actions that modify the dataframe in some way

+
+
+class rxnutils.pipeline.actions.dataframe_mod.DropColumns(columns)
+

Bases: object

+

Drops columns specified in ‘columns’

+

yaml example:

+
+
drop_columns:
+
columns:
    +
  • NRingChange

  • +
  • RingBondMade

  • +
+
+
+
+
+
+
Parameters:
+

columns (list[str])

+
+
+
+
+pretty_name: ClassVar[str] = 'drop_columns'
+
+ +
+
+columns: list[str]
+
+ +
+ +
+
+class rxnutils.pipeline.actions.dataframe_mod.DropDuplicates(key_columns)
+

Bases: object

+

Action for dropping duplicates from dataframe

+
+
Parameters:
+

key_columns (list[str])

+
+
+
+
+pretty_name: ClassVar[str] = 'drop_duplicates'
+
+ +
+
+key_columns: list[str]
+
+ +
+ +
+
+class rxnutils.pipeline.actions.dataframe_mod.DropRows(indicator_columns)
+

Bases: object

+

Drops rows according to boolean in ‘indicator_columns’. +True => Keep, False => Drop.

+

yaml example:

+
+
drop_rows:
+
indicator_columns:
    +
  • is_sanitizable

  • +
  • is_sanitizable2

  • +
+
+
+
+
+
+
Parameters:
+

indicator_columns (list[str])

+
+
+
+
+pretty_name: ClassVar[str] = 'drop_rows'
+
+ +
+
+indicator_columns: list[str]
+
+ +
+ +
+
+class rxnutils.pipeline.actions.dataframe_mod.KeepColumns(columns)
+

Bases: object

+

Drops columns not specified in ‘columns’

+

yaml example:

+
+
keep_columns:
+
columns:
    +
  • id

  • +
  • classification

  • +
  • rsmi_processed

  • +
+
+
+
+
+
+
Parameters:
+

columns (list[str])

+
+
+
+
+pretty_name: ClassVar[str] = 'keep_columns'
+
+ +
+
+columns: list[str]
+
+ +
+ +
+
+class rxnutils.pipeline.actions.dataframe_mod.RenameColumns(in_columns, out_columns)
+

Bases: object

+

Renames columns specified in ‘in_columns’ to the names specified in ‘out_columns’

+

yaml example:

+
+
rename_columns:
+
in_columns:
    +
  • column1

  • +
  • column2

  • +
+
+
out_columns:
    +
  • column1_renamed

  • +
  • column2_renamed

  • +
+
+
+
+
+
+
Parameters:
+
    +
  • in_columns (list[str])

  • +
  • out_columns (list[str])

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'rename_columns'
+
+ +
+
+in_columns: list[str]
+
+ +
+
+out_columns: list[str]
+
+ +
+ +
+
+class rxnutils.pipeline.actions.dataframe_mod.QueryDataframe(query)
+

Bases: object

+

Uses dataframe query to produce a new (smaller) dataframe. Query must conform to pandas.query()

+

yaml file example: Keeping only rows where the has_stereo columns is True:

+
+
query_dataframe:

query: has_stereo == True

+
+
+
+
Parameters:
+

query (str)

+
+
+
+
+pretty_name: ClassVar[str] = 'query_dataframe'
+
+ +
+
+query: str
+
+ +
+ +
+
+class rxnutils.pipeline.actions.dataframe_mod.StackColumns(in_columns, out_column='StackedColumns')
+

Bases: object

+

Stacks the specified in_columns under a new column name (out_column), +multiplies the rest of the columns as appropriate

+

yaml control file example:

+
+
stack_columns:
+
in_columns:
    +
  • rsmi_processed

  • +
  • rsmi_inverted_stereo

  • +
+
+
+

out_column: rsmi_processed

+
+
+
+
Parameters:
+
    +
  • in_columns (list[str])

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'stack_columns'
+
+ +
+
+in_columns: list[str]
+
+ +
+
+out_column: str = 'StackedColumns'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.dataframe_mod.StackMultiColumns(stack_columns, target_columns)
+

Bases: object

+

Stacks the specified target_columns on top of the stack_columns after renaming.

+

Example Yaml:

+
+
stack_multi_columns:
+
stack_columns:
    +
  • rsmi_inverted_stereo

  • +
  • PseudoHash_inverted_stereo

  • +
+
+
target_columns:
    +
  • rsmi_processed

  • +
  • PseudoHash

  • +
+
+
+
+
+
+
Parameters:
+
    +
  • stack_columns (list[str])

  • +
  • target_columns (list[str])

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'stack_multi_columns'
+
+ +
+
+stack_columns: list[str]
+
+ +
+
+target_columns: list[str]
+
+ +
+ +
+
+

rxnutils.pipeline.actions.reaction_mod module

+

Module containing actions on reactions that modify the reaction in some way

+
+
+class rxnutils.pipeline.actions.reaction_mod.DesaltMolecules(in_column, out_column='RxnDesalted', keep_something=False)
+

Bases: ReactionActionMixIn

+

Action for desalting molecules

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
  • keep_something (bool)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'desalt_molecules'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnDesalted'
+
+ +
+
+keep_something: bool = False
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.NameRxn(in_column, options='', nm_rxn_column='NextMoveRxnSmiles', nmc_column='NMC')
+

Bases: object

+

Action for calling namrxn

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • options (str)

  • +
  • nm_rxn_column (str)

  • +
  • nmc_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'namerxn'
+
+ +
+
+in_column: str
+
+ +
+
+options: str = ''
+
+ +
+
+nm_rxn_column: str = 'NextMoveRxnSmiles'
+
+ +
+
+nmc_column: str = 'NMC'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.NeutralizeMolecules(in_column, out_column='RxnNeutralized')
+

Bases: ReactionActionMixIn

+

Action for neutralizing molecules

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'neutralize_molecules'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnNeutralized'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.ReactantsToReagents(in_column, out_column='RxnSmilesWithTrueReagents')
+

Bases: ReactionActionMixIn

+

Action for converting reactants to reagents

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'reactants2reagents'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnSmilesWithTrueReagents'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.ReagentsToReactants(in_column, out_column='RxnSmilesAllReactants')
+

Bases: object

+

Action for converting reagents to reactants

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'reagents2reactants'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnSmilesAllReactants'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.RemoveAtomMapping(in_column, out_column='RxnSmilesNoAtomMap')
+

Bases: ReactionActionMixIn

+

Action for removing all atom mapping

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'remove_atom_mapping'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnSmilesNoAtomMap'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.RemoveStereoInfo(in_column, out_column='RxnSmilesNoStereo')
+

Bases: object

+

Action for removing stero information

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'remove_stereo_info'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnSmilesNoStereo'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.InvertStereo(in_column, out_column='RxnSmilesInvertedStereo')
+

Bases: object

+

Action for inverting stero information

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'invert_stereo'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnSmilesInvertedStereo'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.IsotopeInfo(in_column, isotope_column='Isotope', out_column='RxnSmilesWithoutIsotopes', match_regex='\\[(?P<mass>[0-9]+)(?P<symbol>[A-Za-z][a-z]*)(?P<spec>[^\\]]+)*\\]', sub_regex='[\\g<symbol>\\g<spec>]')
+

Bases: object

+

Action creating and modifying isotope information

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • isotope_column (str)

  • +
  • out_column (str)

  • +
  • match_regex (str)

  • +
  • sub_regex (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'isotope_info'
+
+ +
+
+in_column: str
+
+ +
+
+isotope_column: str = 'Isotope'
+
+ +
+
+out_column: str = 'RxnSmilesWithoutIsotopes'
+
+ +
+
+match_regex: str = '\\[(?P<mass>[0-9]+)(?P<symbol>[A-Za-z][a-z]*)(?P<spec>[^\\]]+)*\\]'
+
+ +
+
+sub_regex: str = '[\\g<symbol>\\g<spec>]'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.RemoveExtraAtomMapping(in_column, out_column='RxnSmilesReassignedAtomMap')
+

Bases: ReactionActionMixIn

+

Action for removing extra atom mapping

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'remove_extra_atom_mapping'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnSmilesReassignedAtomMap'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.RemoveUnchangedProducts(in_column, out_column='RxnNoUnchangedProd')
+

Bases: ReactionActionMixIn

+

Compares the products with the reagents and reactants and remove unchanged products.

+

Protonation is considered a difference, As example, if there’s a HCl in the reagents and +a Cl- in the products, it will not be removed.

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'remove_unchanged_products'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnNoUnchangedProd'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.RemoveUnsanitizable(in_column, out_column='RxnSanitizable', bad_column='BadMolecules')
+

Bases: ReactionActionMixIn

+

Action for removing unsanitizable reactions

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
  • bad_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'remove_unsanitizable'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnSanitizable'
+
+ +
+
+bad_column: str = 'BadMolecules'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.RDKitRxnRoles(in_column, out_column='RxnRoleAssigned')
+

Bases: object

+

Action for assigning roles based on RDKit algorithm

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'rdkit_RxnRoleAssignment'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnRoleAssigned'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.RxnMapper(in_column, out_column='RxnmapperRxnSmiles', rxnmapper_command='conda run -p ${RXNMAPPER_ENV_PATH} python /home/runner/work/reaction_utils/reaction_utils/rxnutils/data/mapping.py')
+

Bases: object

+

Action for mapping reactions with the RXNMapper tool

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
  • rxnmapper_command (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'rxnmapper'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnmapperRxnSmiles'
+
+ +
+
+rxnmapper_command: str = 'conda run -p ${RXNMAPPER_ENV_PATH} python /home/runner/work/reaction_utils/reaction_utils/rxnutils/data/mapping.py'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.SplitReaction(in_column, out_columns)
+

Bases: ReactionActionMixIn

+

Action for splitting reaction into components

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_columns (list[str])

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'split_reaction'
+
+ +
+
+in_column: str
+
+ +
+
+out_columns: list[str]
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.AtomMapTagDisconnectionSite(in_column='RxnSmilesClean', out_column='products_atom_map_tagged')
+

Bases: ReactionActionMixIn

+

Action for tagging disconnection site in products with atom-map ‘[<atom>:1]’.

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'atom_map_tag_disconnection_site'
+
+ +
+
+in_column: str = 'RxnSmilesClean'
+
+ +
+
+out_column: str = 'products_atom_map_tagged'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.ConvertAtomMapDisconnectionTag(in_column='products_atom_map_tagged', out_column_tagged='products_tagged', out_column_reconstructed='products_reconstructed')
+

Bases: ReactionActionMixIn

+

Action for converting atom-map tagging to exclamation mark tagging.

+

yaml example:

+
+
convert_atom_map_disconnection_tag:

in_column_tagged: products_atom_map_tagged +in_column_untagged: products +out_column_tagged: products_tagged +out_column_reconstructed: products_reconstructed

+
+
+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column_tagged (str)

  • +
  • out_column_reconstructed (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'convert_atom_map_disconnection_tag'
+
+ +
+
+in_column: str = 'products_atom_map_tagged'
+
+ +
+
+out_column_tagged: str = 'products_tagged'
+
+ +
+
+out_column_reconstructed: str = 'products_reconstructed'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_mod.TrimRxnSmiles(in_column, out_column='RxnSmiles', smiles_column_index=0)
+

Bases: object

+

Action from trimming reaction SMILES

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
  • smiles_column_index (int)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'trim_rxn_smiles'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnSmiles'
+
+ +
+
+smiles_column_index: int = 0
+
+ +
+ +
+
+

rxnutils.pipeline.actions.reaction_props module

+

Module containing actions on reactions that doesn’t modify the reactions only compute properties of them

+
+
+class rxnutils.pipeline.actions.reaction_props.CountComponents(in_column, nreactants_column='NReactants', nmapped_reactants_column='NMappedReactants', nreagents_column='NReagents', nmapped_reagents_column='NMappedReagents', nproducts_column='NProducts', nmapped_products_column='NMappedProducts')
+

Bases: ReactionActionMixIn

+

Action for counting reaction components

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • nreactants_column (str)

  • +
  • nmapped_reactants_column (str)

  • +
  • nreagents_column (str)

  • +
  • nmapped_reagents_column (str)

  • +
  • nproducts_column (str)

  • +
  • nmapped_products_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'count_components'
+
+ +
+
+in_column: str
+
+ +
+
+nreactants_column: str = 'NReactants'
+
+ +
+
+nmapped_reactants_column: str = 'NMappedReactants'
+
+ +
+
+nreagents_column: str = 'NReagents'
+
+ +
+
+nmapped_reagents_column: str = 'NMappedReagents'
+
+ +
+
+nproducts_column: str = 'NProducts'
+
+ +
+
+nmapped_products_column: str = 'NMappedProducts'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.CountElements(in_column, out_column='ElementCount')
+

Bases: object

+

Action for counting elements in reactants

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'count_elements'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'ElementCount'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.HasStereoInfo(in_column, out_column='HasStereo')
+

Bases: object

+

Action for checking stereo info

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'has_stereo_info'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'HasStereo'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.HasUnmappedRadicalAtom(in_column, out_column='HasUnmappedRadicalAtom')
+

Bases: object

+

Action for flagging if reaction has any unmapped radical atoms

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'hasunmappedradicalatom'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'HasUnmappedRadicalAtom'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.HasUnsanitizableReactants(rsmi_column, bad_columns, out_column='HasUnsanitizableReactants')
+

Bases: object

+

Action for flagging if reaction has any unsanitizable reactants

+
+
Parameters:
+
    +
  • rsmi_column (str)

  • +
  • bad_columns (List[str])

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'unsanitizablereactants'
+
+ +
+
+rsmi_column: str
+
+ +
+
+bad_columns: List[str]
+
+ +
+
+out_column: str = 'HasUnsanitizableReactants'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.CgrCreated(in_column, out_column='CGRCreated')
+

Bases: object

+

Action for determining if a CGR can be created from the reaction smiles

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+in_column: str
+
+ +
+
+pretty_name: ClassVar[str] = 'cgr_created'
+
+ +
+
+out_column: str = 'CGRCreated'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.CgrNumberOfDynamicBonds(in_column, out_column='NDynamicBonds')
+

Bases: object

+

Action for calculating the number of dynamic bonds

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+in_column: str
+
+ +
+
+pretty_name: ClassVar[str] = 'cgr_dynamic_bonds'
+
+ +
+
+out_column: str = 'NDynamicBonds'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.ProductAtomMappingStats(in_column, unmapped_column='UnmappedProdAtoms', widow_column='WidowAtoms')
+

Bases: object

+

Action for collecting statistics of product atom mapping

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • unmapped_column (str)

  • +
  • widow_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'product_atommapping_stats'
+
+ +
+
+in_column: str
+
+ +
+
+unmapped_column: str = 'UnmappedProdAtoms'
+
+ +
+
+widow_column: str = 'WidowAtoms'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.ProductSize(in_column, out_column='ProductSize')
+

Bases: object

+

Action for counting product size

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'productsize'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'ProductSize'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.PseudoReactionHash(in_column, out_column='PseudoHash', no_reagents=False)
+

Bases: object

+

Action for creating a reaction hash based on InChI keys

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
  • no_reagents (bool)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'pseudo_reaction_hash'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'PseudoHash'
+
+ +
+
+no_reagents: bool = False
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.PseudoSmilesHash(in_column, out_column='PseudoSmilesHash')
+

Bases: object

+

Action for creating a reaction hash based on SMILES

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'pseudo_smiles_hash'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'PseudoSmilesHash'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.ReactantProductAtomBalance(in_column, out_column='RxnAtomBalance')
+

Bases: object

+

Action for computing atom balance

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'atombalance'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RxnAtomBalance'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.ReactantSize(in_column, out_column='ReactantSize')
+

Bases: object

+

Action for counting reactant size

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'reactantsize'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'ReactantSize'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.MaxRingNumber(in_column, out_column='MaxRings')
+

Bases: object

+

Action for calculating the maximum number of rings in either the product or reactant +For a reaction without reactants or products, it will return 0 to enable easy arithmetic comparison

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'maxrings'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'MaxRings'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.RingNumberChange(in_column, out_column='NRingChange')
+

Bases: object

+

Action for calculating if reaction has change in number of rings

+

A positive number from this action implies that a ring was formed during the reaction

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'ringnumberchange'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'NRingChange'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.RingBondMade(in_column, out_column='RingBondMade')
+

Bases: object

+

Action for flagging if reaction has made a ring bond in the product

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'ringbondmade'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RingBondMade'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.RingMadeSize(in_column, out_column='RingMadeSize')
+

Bases: object

+

Action for computing the size of a newly formed ring

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'ringmadesize'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'RingMadeSize'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.SmilesLength(in_column, out_column='SmilesLength')
+

Bases: object

+

Action for counting SMILES length

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'smiles_length'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'SmilesLength'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.SmilesSanitizable(in_column, out_column='SmilesSanitizable')
+

Bases: object

+

Action for checking if SMILES are sanitizable

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'smiles_sanitizable'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'SmilesSanitizable'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.StereoInvention(in_column, out_column='StereoInvention')
+

Bases: object

+

Flags reactions where non-stereo compounds (No “@”s in SMILES) +turn into stereo compounds (containing “@”)

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'stereo_invention'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'StereoInvention'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.StereoCentreChanges(in_column, out_column='HasStereoChanges', stereo_changes_column='StereoChanges')
+

Bases: object

+

Action for checking if stereogenic centre in reaction center is changing +during the reaction

+
+
Will create two columns:
    +
  1. A boolean column indicating True or False if it has stereochanges

  2. +
  3. A description of the stereo information before and after the reaction

  4. +
+
+
+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
  • stereo_changes_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'stereo_centre_changes'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'HasStereoChanges'
+
+ +
+
+stereo_changes_column: str = 'StereoChanges'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.StereoHasChiralReagent(in_column, out_column='HasChiralReagent')
+

Bases: object

+

Action for checking if reagent has stereo centres

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'stereo_chiral_reagent'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'HasChiralReagent'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.StereoCenterIsCreated(in_column='StereoChanges', out_column='StereoCentreCreated')
+

Bases: object

+

Action for checking if stereo centre is created during reaction

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'stereo_centre_created'
+
+ +
+
+in_column: str = 'StereoChanges'
+
+ +
+
+out_column: str = 'StereoCentreCreated'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.StereoCenterIsRemoved(in_column='StereoChanges', out_column='StereoCentreRemoved')
+

Bases: object

+

Action for checking if stereo centre is removed during reaction

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'stereo_centre_removed'
+
+ +
+
+in_column: str = 'StereoChanges'
+
+ +
+
+out_column: str = 'StereoCentreRemoved'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.StereoCenterInReactantPotential(in_column, out_column='PotentialStereoCentre')
+

Bases: object

+

Action for checking if there is a potential stereo centre in the reaction

+

Do not consider changes to bond stereochemistry

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'potential_stereo_center'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'PotentialStereoCentre'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.StereoCenterOutsideReaction(in_column, out_column='StereoOutside')
+

Bases: object

+

Action for checking if there is a stereo centre outside the reaction centre

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'stereo_centre_outside'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'StereoOutside'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.reaction_props.StereoMesoProduct(in_column, out_column='MesoProduct')
+

Bases: object

+

Action for checking if the product is a meso compound

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • out_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'meso_product'
+
+ +
+
+in_column: str
+
+ +
+
+out_column: str = 'MesoProduct'
+
+ +
+ +
+
+

rxnutils.pipeline.actions.templates module

+

Module containing template validation actions

+
+
+class rxnutils.pipeline.actions.templates.CountTemplateComponents(in_column, nreactants_column='nreactants', nreagents_column='nreagents', nproducts_column='nproducts')
+

Bases: object

+

Action for counting template components

+
+
Parameters:
+
    +
  • in_column (str)

  • +
  • nreactants_column (str)

  • +
  • nreagents_column (str)

  • +
  • nproducts_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'count_template_components'
+
+ +
+
+in_column: str
+
+ +
+
+nreactants_column: str = 'nreactants'
+
+ +
+
+nreagents_column: str = 'nreagents'
+
+ +
+
+nproducts_column: str = 'nproducts'
+
+ +
+ +
+
+class rxnutils.pipeline.actions.templates.RetroTemplateReproduction(template_column, smiles_column, expected_reactants_column='TemplateGivesTrueReactants', other_reactants_column='TemplateGivesOtherReactants', noutcomes_column='TemplateGivesNOutcomes')
+

Bases: object

+

Action for checking template reproduction

+
+
Parameters:
+
    +
  • template_column (str)

  • +
  • smiles_column (str)

  • +
  • expected_reactants_column (str)

  • +
  • other_reactants_column (str)

  • +
  • noutcomes_column (str)

  • +
+
+
+
+
+pretty_name: ClassVar[str] = 'retro_template_reproduction'
+
+ +
+
+template_column: str
+
+ +
+
+smiles_column: str
+
+ +
+
+expected_reactants_column: str = 'TemplateGivesTrueReactants'
+
+ +
+
+other_reactants_column: str = 'TemplateGivesOtherReactants'
+
+ +
+
+noutcomes_column: str = 'TemplateGivesNOutcomes'
+
+ +
+ +
+
+

Module contents

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/rxnutils.pipeline.html b/rxnutils.pipeline.html new file mode 100644 index 0000000..4f34c2a --- /dev/null +++ b/rxnutils.pipeline.html @@ -0,0 +1,715 @@ + + + + + + + + rxnutils.pipeline package — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils.pipeline package

+
+

Subpackages

+
+ +
+
+
+

Submodules

+
+
+

rxnutils.pipeline.base module

+

Module containing routines for the validation framework

+
+
+rxnutils.pipeline.base.action(obj)
+

Decorator that register a callable as a validation action.

+

An action will be called with a pandas.DataFrame object +and return a new pandas.DataFrame object.

+

An action needs to have an attribute pretty_name.

+
+
Parameters:
+

obj (Callable[[DataFrame], DataFrame]) – the callable to register as an action

+
+
Returns:
+

the same as obj.

+
+
Return type:
+

Callable[[DataFrame], DataFrame]

+
+
+
+ +
+
+rxnutils.pipeline.base.list_actions(short=False)
+

List all available actions in a nice table

+
+
Parameters:
+

short (bool)

+
+
Return type:
+

None

+
+
+
+ +
+
+rxnutils.pipeline.base.create_action(pretty_name, *args, **kwargs)
+

Create an action that can be called

+
+
Parameters:
+
    +
  • pretty_name (str) – the name of the action

  • +
  • args (Any)

  • +
  • kwargs (Any)

  • +
+
+
Returns:
+

the instantiated actions

+
+
Return type:
+

Callable[[DataFrame], DataFrame]

+
+
+
+ +
+
+class rxnutils.pipeline.base.ReactionActionMixIn
+

Bases: object

+

Mixin class with standard routines for splitting and joining reaction SMILES

+
+
+join_lists(reactants_list, reagents_list, products_list)
+

Join list of components into a reaction SMILES

+
+
Parameters:
+
    +
  • reactants_list (List[str]) – the list of reactant SMILES

  • +
  • reagents_list (List[str]) – the list of reagent SMILES

  • +
  • products_list (List[str]) – the list of product SMILES

  • +
+
+
Returns:
+

the concatenated reaction SMILES

+
+
Return type:
+

str

+
+
+
+ +
+
+join_smiles(reactants, reagents, products)
+

Join component SMILES into a reaction SMILES

+
+
Parameters:
+
    +
  • reactants (str) – the reactant SMILES

  • +
  • reagents (str) – the reagent SMILES

  • +
  • products (str) – the product SMILES

  • +
+
+
Returns:
+

the concatenated reaction SMILES

+
+
Return type:
+

str

+
+
+
+ +
+
+split_lists(row)
+

Split a reaction SMILES into list of component SMILES

+
+
Parameters:
+

row (Series) – the row with the SMILES

+
+
Returns:
+

the list of SMILES of the components

+
+
Return type:
+

Tuple[List[str], List[str], List[str]]

+
+
+
+ +
+
+split_smiles(row)
+

Split a reaction SMILES into components SMILES

+
+
Parameters:
+

row (Series) – the row with the SMILES

+
+
Returns:
+

the SMILES of the components

+
+
Return type:
+

Tuple[str, str, str]

+
+
+
+ +
+ +
+
+

rxnutils.pipeline.runner module

+

Module containg routines and interface to run pipelines

+
+
+rxnutils.pipeline.runner.run_pipeline(data, pipeline, filename, save_intermediates=True)
+

Run a given pipeline on a dataset

+

The actions are applied sequentials as they are defined in the pipeline

+

The intermediate results of the pipeline will be written to separate +tab-separated CSV files.

+
+
Parameters:
+
    +
  • data (DataFrame) – the dataset

  • +
  • pipeline (Dict[str, Any]) – the action specifications

  • +
  • filename (str) – path to the final output file

  • +
  • save_intermediates (bool) – if True will save intermediate results

  • +
+
+
Returns:
+

the dataset after completing the pipeline

+
+
Return type:
+

DataFrame

+
+
+
+ +
+
+rxnutils.pipeline.runner.main(args=None)
+

Function for command line argument

+
+
Parameters:
+

args (Sequence[str] | None)

+
+
Return type:
+

None

+
+
+
+ +
+
+

Module contents

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/rxnutils.routes.html b/rxnutils.routes.html new file mode 100644 index 0000000..9b8d7dc --- /dev/null +++ b/rxnutils.routes.html @@ -0,0 +1,901 @@ + + + + + + + + rxnutils.routes package — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils.routes package

+
+

Subpackages

+ +
+
+

Submodules

+
+
+

rxnutils.routes.base module

+

Contains a class encapsulating a synthesis route, +as well as routines for assigning proper atom-mapping +and drawing the route

+
+
+class rxnutils.routes.base.SynthesisRoute(reaction_tree)
+

Bases: object

+

This encapsulates a synthesis route or a reaction tree. +It provide convinient methods for assigning atom-mapping +to the reactions, and for providing reaction-level data +of the route

+

It is typically initiallized by one of the readers in the +rxnutils.routes.readers module.

+

The tree depth and the forward step is automatically assigned +to each reaction node.

+

The max_depth attribute holds the longest-linear-sequence (LLS)

+
+
Parameters:
+

reaction_tree (Dict[str, Any]) – the tree structure representing the route

+
+
+
+
+property mapped_root_smiles: str
+

Return the atom-mapped SMILES of the root compound

+

Will raise an exception if the route is a just a single +compound, or if the route has not been assigned atom-mapping.

+
+ +
+
+property nsteps: int
+

Return the number of reactions in the route

+
+ +
+
+atom_mapped_reaction_smiles()
+

Returns a list of the atom-mapped reaction SMILES in the route

+
+
Return type:
+

List[str]

+
+
+
+ +
+
+assign_atom_mapping(overwrite=False, only_rxnmapper=False)
+

Assign atom-mapping to each reaction in the route and +ensure that it is consistent from root compound and throughout +the route.

+

It will use NameRxn to assign classification and possiblty atom-mapping, +as well as rxnmapper to assign atom-mapping in case NameRxn cannot classify +a reaction.

+
+
Parameters:
+
    +
  • overwrite (bool) – if True will overwrite existing mapping

  • +
  • only_rxnmapper (bool) – if True will disregard NameRxn mapping and use only rxnmapper

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+chains(complexity_func)
+

Returns linear sequences or chains extracted from the route.

+

Each chain is a list of a dictionary representing the molecules, only the most +complex molecule is kept for each reaction - making the chain a sequence of molecule +to molecule transformation.

+

The first chain will be the longest linear sequence (LLS), and the second chain +will be longest branch if this is a convergent route. This branch will be processed +further, but the other branches can probably be discarded as they have not been +investigated thoroughly.

+
+
Parameters:
+

complexity_func (Callable[[str], float]) – a function that takes a SMILES and returns a +complexity metric of the molecule

+
+
Returns:
+

a list of chains where each chain is a list of molecules

+
+
Return type:
+

List[List[Dict[str, Any]]]

+
+
+
+ +
+
+image(show_atom_mapping=False, factory_kwargs=None)
+

Depict the route.

+
+
Parameters:
+
    +
  • show_atom_mapping (bool) – if True, will show the atom-mapping

  • +
  • factory_kwargs (Dict[str, Any] | None) – additional keyword arguments sent to the RouteImageFactory

  • +
+
+
Returns:
+

the image of the route

+
+
Return type:
+

Image

+
+
+
+ +
+
+is_solved()
+

Find if this route is solved, i.e. if all starting material +is in stock.

+

To be accurate, each molecule node need to have an extra +boolean property called in_stock.

+
+
Return type:
+

bool

+
+
+
+ +
+
+leaves()
+

Extract a set with the SMILES of all the leaf nodes, i.e. +starting material

+
+
Returns:
+

a set of SMILES strings

+
+
Return type:
+

Set[str]

+
+
+
+ +
+
+reaction_data()
+

Returns a list of dictionaries for each reaction +in the route. This is metadata of the reactions +augmented with reaction SMILES and depth of the reaction

+
+
Return type:
+

List[Dict[str, Any]]

+
+
+
+ +
+
+reaction_ngrams(nitems, metadata_key)
+

Extract an n-gram representation of the route by building up n-grams +of the reaction metadata.

+
+
Parameters:
+
    +
  • nitems (int) – the length of the gram

  • +
  • metadata_key (str) – the metadata to extract

  • +
+
+
Returns:
+

the collected n-grams

+
+
Return type:
+

List[Tuple[Any, …]]

+
+
+
+ +
+
+reaction_smiles(augment=False)
+

Returns a list of the un-mapped reaction SMILES +:param augment: if True will add reagents to single-reactant

+
+

reagents whenever possible

+
+
+
Parameters:
+

augment (bool)

+
+
Return type:
+

List[str]

+
+
+
+ +
+
+remap(other)
+

Remap the reaction so that it follows the mapping of a +1) root compound in a reference route, 2) a ref compound given +as a SMILES, or 3) using a raw mapping

+
+
Parameters:
+

other (SynthesisRoute | str | Dict[int, int]) – the reference for re-mapping

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+rxnutils.routes.base.smiles2inchikey(smiles, ignore_stereo=False)
+

Converts a SMILES to an InChI key

+
+
Parameters:
+
    +
  • smiles (str)

  • +
  • ignore_stereo (bool)

  • +
+
+
Return type:
+

str

+
+
+
+ +
+
+

rxnutils.routes.comparison module

+

Contains routines for computing route similarities

+
+
+rxnutils.routes.comparison.simple_route_similarity(routes)
+

Returns the geometric mean of the simple bond forming similarity, and +the atom matching bonanza similarity

+
+
Parameters:
+

routes (Sequence[SynthesisRoute]) – the sequence of routes to compare

+
+
Returns:
+

the pairwise similarity

+
+
Return type:
+

ndarray

+
+
+
+ +
+
+rxnutils.routes.comparison.atom_matching_bonanza_similarity(routes)
+

Calculates the pairwise similarity of a sequence of routes +based on the overlap of the atom-mapping numbers of the compounds +in the routes.

+
+
Parameters:
+

routes (Sequence[SynthesisRoute]) – the sequence of routes to compare

+
+
Returns:
+

the pairwise similarity

+
+
Return type:
+

ndarray

+
+
+
+ +
+
+rxnutils.routes.comparison.simple_bond_forming_similarity(routes)
+

Calculates the pairwise similarity of a sequence of routes +based on the overlap of formed bonds in the reactions.

+
+
Parameters:
+

routes (Sequence[SynthesisRoute]) – the sequence of routes to compare

+
+
Returns:
+

the pairwise similarity

+
+
Return type:
+

ndarray

+
+
+
+ +
+
+rxnutils.routes.comparison.route_distances_calculator(model, **kwargs)
+

Return a callable that given a list routes as dictionaries +calculate the squared distance matrix

+
+
Parameters:
+
    +
  • model (str) – the route distance model name

  • +
  • kwargs (Any) – additional keyword arguments for the model

  • +
+
+
Returns:
+

the appropriate route distances calculator

+
+
Return type:
+

Callable[[Sequence[SynthesisRoute]], ndarray]

+
+
+
+ +
+
+

rxnutils.routes.image module

+

This module contains a collection of routines to produce pretty images

+
+
+rxnutils.routes.image.molecule_to_image(mol, frame_color, size=300)
+

Create a pretty image of a molecule, +with a colored frame around it

+
+
Parameters:
+
    +
  • mol (Chem.rdchem.Mol) – the molecule

  • +
  • frame_color (PilColor) – the color of the frame

  • +
  • size (int) – the size of the image

  • +
+
+
Returns:
+

the produced image

+
+
Return type:
+

PilImage

+
+
+
+ +
+
+rxnutils.routes.image.molecules_to_images(mols, frame_colors, size=300, draw_kwargs=None)
+

Create pretty images of molecules with a colored frame around each one of them.

+

The molecules will be resized to be of similar sizes.

+
+
Parameters:
+
    +
  • smiles_list – the molecules

  • +
  • frame_colors (Sequence[PilColor]) – the color of the frame for each molecule

  • +
  • size (int) – the sub-image size

  • +
  • draw_kwargs (Dict[str, Any]) – additional keyword-arguments sent to MolsToGridImage

  • +
  • mols (Sequence[Chem.rdchem.Mol])

  • +
+
+
Returns:
+

the produced images

+
+
Return type:
+

List[PilImage]

+
+
+
+ +
+
+rxnutils.routes.image.crop_image(img, margin=20)
+

Crop an image by removing white space around it

+
+
Parameters:
+
    +
  • img (PilImage) – the image to crop

  • +
  • margin (int) – padding, defaults to 20

  • +
+
+
Returns:
+

the cropped image

+
+
Return type:
+

PilImage

+
+
+
+ +
+
+rxnutils.routes.image.draw_rounded_rectangle(img, color, arc_size=20)
+

Draw a rounded rectangle around an image

+
+
Parameters:
+
    +
  • img (PilImage) – the image to draw upon

  • +
  • color (PilColor) – the color of the rectangle

  • +
  • arc_size (int) – the size of the corner, defaults to 20

  • +
+
+
Returns:
+

the new image

+
+
Return type:
+

PilImage

+
+
+
+ +
+
+class rxnutils.routes.image.RouteImageFactory(route, in_stock_colors=None, show_all=True, margin=100, mol_size=300, mol_draw_kwargs=None, replace_mol_func=None)
+

Bases: object

+

Factory class for drawing a route

+
+
Parameters:
+
    +
  • route (Dict[str, Any]) – the dictionary representation of the route

  • +
  • in_stock_colors (FrameColors) – the colors around molecules, defaults to {True: “green”, False: “orange”}

  • +
  • show_all (bool) – if True, also show nodes that are marked as hidden

  • +
  • margin (int) – the margin between images

  • +
  • mol_size (int) – the size of the molecule

  • +
  • mol_draw_kwargs (Dict[str, Any]) – additional arguments sent to the drawing routine

  • +
  • replace_mol_func (Callable[[Dict[str, Any]], None]) – an optional function to replace molecule images

  • +
+
+
+
+ +
+
+

rxnutils.routes.readers module

+

Routines for reading routes from various formats

+
+
+rxnutils.routes.readers.read_reaction_lists(filename)
+

Read one or more simple lists of reactions into one or more +retrosynthesis trees.

+

Each list of reactions should be separated by an empty line. +Each row of each reaction should contain the reaction SMILES (reactants>>products) +and nothing else.

+

Example: +A.B>>C +D.E>>B

+

A.X>>Y +Z>>X

+
+
defines two retrosynthesis trees, and the first being

A

+
+
C -> D
+
B ->

E

+
+
+
+
+
+
Params filename:
+

the path to the file with the reactions

+
+
Returns:
+

the list of the created trees

+
+
Parameters:
+

filename (str)

+
+
Return type:
+

List[SynthesisRoute]

+
+
+
+ +
+
+rxnutils.routes.readers.read_aizynthcli_dataframe(data)
+

Read routes as produced by the aizynthcli tool of the AiZynthFinder package.

+
+
Parameters:
+

data (DataFrame) – the dataframe as output by aizynthcli

+
+
Returns:
+

the created routes

+
+
Return type:
+

Series

+
+
+
+ +
+
+rxnutils.routes.readers.read_reactions_dataframe(data, smiles_column, group_by, metadata_columns=None)
+

Read routes from reactions stored in a pandas dataframe. The different +routes are groupable by one or more column. Additional metadata columns +can be extracted from the dataframe as well.

+

The dataframe is grouped by the columns specified by group_by and +then one routes is extracted from each subset dataframe. The function +returns a series with the routes, which is indexable by the columns +in the group_by list.

+
+
Parameters:
+
    +
  • data (DataFrame) – the dataframe with reaction data

  • +
  • smiles_column (str) – the column with the reaction SMILES

  • +
  • group_by (List[str]) – the columns that uniquely identifies each route

  • +
  • metadata_column – additional columns to be added as metadata to each route

  • +
  • metadata_columns (List[str] | None)

  • +
+
+
Returns:
+

the created series with route.

+
+
Return type:
+

Series

+
+
+
+ +
+
+rxnutils.routes.readers.reactions2route(reactions, metadata=None)
+

Convert a list of reactions into a retrosynthesis tree

+

This is based on matching partial InChI keys of the reactants in one +reaction with the partial InChI key of a product.

+
+
Params reactions:
+

list of reaction SMILES

+
+
Returns:
+

the created trees

+
+
Parameters:
+
    +
  • reactions (Sequence[str])

  • +
  • metadata (Sequence[Dict[str, Any]] | None)

  • +
+
+
Return type:
+

SynthesisRoute

+
+
+
+ +
+
+rxnutils.routes.readers.read_rdf_file(filename)
+
+
Parameters:
+

filename (str)

+
+
Return type:
+

SynthesisRoute

+
+
+
+ +
+
+

rxnutils.routes.scoring module

+

Routines for scoring synthesis routes

+
+
+rxnutils.routes.scoring.route_sorter(routes, scorer, **kwargs)
+

Scores and sort a list of routes. +Returns a tuple of the sorted routes and their scores.

+
+
Parameters:
+
    +
  • routes (List[SynthesisRoute]) – the routes to score

  • +
  • scorer (Callable[[...], float]) – the scorer function

  • +
  • kwargs (Any) – additional argument given to the scorer

  • +
+
+
Returns:
+

the sorted routes and their scores

+
+
Return type:
+

Tuple[List[SynthesisRoute], List[float]]

+
+
+
+ +
+
+rxnutils.routes.scoring.route_ranks(scores)
+

Compute the rank of route scores. Rank starts at 1

+
+
Parameters:
+

scores (List[float]) – the route scores

+
+
Returns:
+

a list of ranks for each route

+
+
Return type:
+

List[int]

+
+
+
+ +
+
+rxnutils.routes.scoring.badowski_route_score(route, mol_costs=None, average_yield=0.8, reaction_cost=1.0)
+

Calculate the score of route using the method from +(Badowski et al. Chem Sci. 2019, 10, 4640).

+

The reaction cost is constant and the yield is an average yield. +The starting materials are assigned a cost based on whether they are in +stock or not. By default starting material in stock is assigned a +cost of 1 and starting material not in stock is assigned a cost of 10.

+

To be accurate, each molecule node need to have an extra +boolean property called in_stock.

+
+
Parameters:
+
    +
  • route (SynthesisRoute) – the route to analyze

  • +
  • mol_costs (Dict[bool, float] | None) – the starting material cost

  • +
  • average_yield (float) – the average yield, defaults to 0.8

  • +
  • reaction_cost (float) – the reaction cost, defaults to 1.0

  • +
+
+
Returns:
+

the computed cost

+
+
Return type:
+

float

+
+
+
+ +
+
+

Module contents

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/rxnutils.routes.retro_bleu.html b/rxnutils.routes.retro_bleu.html new file mode 100644 index 0000000..17b75be --- /dev/null +++ b/rxnutils.routes.retro_bleu.html @@ -0,0 +1,310 @@ + + + + + + + + rxnutils.routes.retro_bleu package — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils.routes.retro_bleu package

+
+

Submodules

+
+
+

rxnutils.routes.retro_bleu.ngram_collection module

+

Contains routines for creating, reading, and writing n-gram collections

+

Can be run as a module to create a collection from a set of routes:

+
+

python -m rxnutils.routes.retro_bleu.ngram_collection –filename routes.json –output ngrams.json –nitems 2 –metadata template_hash

+
+
+
+class rxnutils.routes.retro_bleu.ngram_collection.NgramCollection(nitems, metadata_key, ngrams)
+

Bases: object

+

Class to create, read, and write a collection of n-grams

+
+
Parameters:
+
    +
  • nitems (int) – the length of each n-gram

  • +
  • metadata_key (str) – the key used to extract the n-grams from the reactions

  • +
  • ngrams (Set[Tuple[str, ...]]) – the extracted n-grams

  • +
+
+
+
+
+nitems: int
+
+ +
+
+metadata_key: str
+
+ +
+
+ngrams: Set[Tuple[str, ...]]
+
+ +
+
+classmethod from_file(filename)
+

Read an n-gram collection from a JSON-file

+
+
Parameters:
+

filename (str) – the path to the file

+
+
Returns:
+

the n-gram collection

+
+
Return type:
+

NgramCollection

+
+
+
+ +
+
+classmethod from_tree_collection(filename, nitems, metadata_key)
+

Make a n-gram collection by extracting them from a collection of +synthesis routes.

+
+
Parameters:
+
    +
  • filename (str) – the path to a file with a list of synthesis routes

  • +
  • nitems (int) – the length of the gram

  • +
  • metadata_key (str) – the metadata to extract

  • +
+
+
Returns:
+

the n-gram collection

+
+
Return type:
+

NgramCollection

+
+
+
+ +
+
+save_to_file(filename)
+

Save an n-gram collection to a JSON-file

+
+
Parameters:
+

filename (str) – the path to the file

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+

rxnutils.routes.retro_bleu.scoring module

+

Contains routine to score routes according to Retro-BLEU paper

+
+
+rxnutils.routes.retro_bleu.scoring.ngram_overlap_score(route, ref)
+

Calculate the fractional n-gram overlap of the n-grams in the given +route and the reference n-gram collection

+
+
Parameters:
+
+
+
Returns:
+

the calculated score

+
+
Return type:
+

float

+
+
+
+ +
+
+rxnutils.routes.retro_bleu.scoring.retro_bleu_score(route, ref, ideal_steps=3)
+

Calculate the Retro-BLEU score according to the paper:

+

Li, Junren, Lei Fang, och Jian-Guang Lou. +”Retro-BLEU: quantifying chemical plausibility of retrosynthesis routes through reaction template sequence analysis”. +Digital Discovery 3, nr 3 (2024): 482–90. https://doi.org/10.1039/D3DD00219E.

+
+
Parameters:
+
    +
  • route (SynthesisRoute) – the route to score

  • +
  • ref (NgramCollection) – the reference n-gram collection

  • +
  • ideal_steps (int) – a length-penalization hyperparameter (see Eq 2 in ref)

  • +
+
+
Returns:
+

the calculated score

+
+
Return type:
+

float

+
+
+
+ +
+
+

Module contents

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/rxnutils.routes.ted.html b/rxnutils.routes.ted.html new file mode 100644 index 0000000..f76bf67 --- /dev/null +++ b/rxnutils.routes.ted.html @@ -0,0 +1,414 @@ + + + + + + + + rxnutils.routes.ted package — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils.routes.ted package

+
+

Submodules

+
+
+

rxnutils.routes.ted.distances_calculator module

+

Module contain method to compute distance matrix using TED

+
+
+rxnutils.routes.ted.distances_calculator.ted_distances_calculator(routes, content='both', timeout=None)
+

Compute the TED distances between each pair of routes

+
+
Parameters:
+
    +
  • routes (Sequence[SynthesisRoute]) – the routes to calculate pairwise distance on

  • +
  • content (str) – determine what part of the synthesis trees to include in the calculation, +options ‘molecules’, ‘reactions’ and ‘both’, default ‘both’

  • +
  • timeout (int | None) – if given, raises an exception if timeout is taking longer time

  • +
+
+
Returns:
+

the square distance matrix

+
+
Return type:
+

ndarray

+
+
+
+ +
+
+

rxnutils.routes.ted.reactiontree module

+

Module containing helper classes to compute the distance between to reaction trees using the APTED method +Since APTED is based on ordered trees and the reaction trees are unordered, plenty of +heuristics are implemented to deal with this.

+
+
+class rxnutils.routes.ted.reactiontree.ReactionTreeWrapper(route, content=TreeContent.MOLECULES, exhaustive_limit=20, fp_factory=None, dist_func=None)
+

Bases: object

+

Wrapper for a reaction tree that can calculate distances between +trees.

+
+
Parameters:
+
    +
  • route (SynthesisRoute) – the synthesis route to wrap

  • +
  • content (Union[str, TreeContent]) – the content of the route to consider in the distance calculation, default ‘molecules’

  • +
  • exhaustive_limit (int) – if the number of possible ordered trees are below this limit create them all, default 20

  • +
  • fp_factory (Callable[[StrDict, Optional[StrDict]], None]) – the factory of the fingerprint, Morgan fingerprint for molecules and reactions by default

  • +
  • dist_func (Callable[[np.ndarray, np.ndarray], float]) – the distance function to use when renaming nodes

  • +
+
+
+
+
+property info: Dict[str, Any]
+

Return a dictionary with internal information about the wrapper

+
+ +
+
+property first_tree: Dict[str, Any]
+

Return the first created ordered tree

+
+ +
+
+property trees: List[Dict[str, Any]]
+

Return a list of all created ordered trees

+
+ +
+
+distance_iter(other, exhaustive_limit=20)
+

Iterate over all distances computed between this and another tree

+

There are three possible enumeration of distances possible dependent +on the number of possible ordered trees for the two routes that are compared

+
    +
  • If the product of the number of possible ordered trees for both routes are +below exhaustive_limit compute the distance between all pair of trees

  • +
  • If both self and other has been fully enumerated (i.e. all ordered trees has been created) +compute the distances between all trees of the route with the most ordered trees and +the first tree of the other route

  • +
  • Compute exhaustive_limit number of distances by shuffling the child order for +each of the routes.

  • +
+

The rules are applied top-to-bottom.

+
+
Parameters:
+
    +
  • other (ReactionTreeWrapper) – another tree to calculate distance to

  • +
  • exhaustive_limit (int) – used to determine what type of enumeration to do

  • +
+
+
Yield:
+

the next computed distance between self and other

+
+
Return type:
+

Iterable[float]

+
+
+
+ +
+
+distance_to(other, exhaustive_limit=20)
+

Calculate the minimum distance from this route to another route

+

Enumerate the distances using distance_iter.

+
+
Parameters:
+
    +
  • other (ReactionTreeWrapper) – another tree to calculate distance to

  • +
  • exhaustive_limit (int) – used to determine what type of enumeration to do

  • +
+
+
Returns:
+

the minimum distance

+
+
Return type:
+

float

+
+
+
+ +
+
+distance_to_with_sorting(other)
+

Compute the distance to another tree, by simpling sorting the children +of both trees. This is not guaranteed to return the minimum distance.

+
+
Parameters:
+

other (ReactionTreeWrapper) – another tree to calculate distance to

+
+
Returns:
+

the distance

+
+
Return type:
+

float

+
+
+
+ +
+ +
+
+

rxnutils.routes.ted.utils module

+

Module containing utilities for TED calculations

+
+
+class rxnutils.routes.ted.utils.TreeContent(value)
+

Bases: str, Enum

+

Possibilities for distance calculations on reaction trees

+
+
+MOLECULES = 'molecules'
+
+ +
+
+REACTIONS = 'reactions'
+
+ +
+
+BOTH = 'both'
+
+ +
+ +
+
+class rxnutils.routes.ted.utils.AptedConfig(randomize=False, sort_children=False, dist_func=None)
+

Bases: Config

+

This is a helper class for the tree edit distance +calculation. It defines how the substitution +cost is calculated and how to obtain children nodes.

+
+
Parameters:
+
    +
  • randomize (bool) – if True, the children will be shuffled

  • +
  • sort_children (bool) – if True, the children will be sorted

  • +
  • dist_func (Callable[[np.ndarray, np.ndarray], float]) – the distance function used for renaming nodes, Jaccard by default

  • +
+
+
+
+
+rename(node1, node2)
+

Calculates the cost of renaming the label of the source node +to the label of the destination node

+
+
Parameters:
+
    +
  • node1 (Dict[str, Any])

  • +
  • node2 (Dict[str, Any])

  • +
+
+
Return type:
+

float

+
+
+
+ +
+
+children(node)
+

Returns children of node

+
+
Parameters:
+

node (Dict[str, Any])

+
+
Return type:
+

List[Dict[str, Any]]

+
+
+
+ +
+ +
+
+class rxnutils.routes.ted.utils.StandardFingerprintFactory(radius=2, nbits=2048)
+

Bases: object

+

Calculate Morgan fingerprint for molecules, and difference fingerprints for reactions

+
+
Parameters:
+
    +
  • radius (int) – the radius of the fingerprint

  • +
  • nbits (int) – the fingerprint lengths

  • +
+
+
+
+ +
+
+

Module contents

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/rxnutils.routes.utils.html b/rxnutils.routes.utils.html new file mode 100644 index 0000000..1a1668a --- /dev/null +++ b/rxnutils.routes.utils.html @@ -0,0 +1,285 @@ + + + + + + + + rxnutils.routes.utils package — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

rxnutils.routes.utils package

+
+

Submodules

+
+
+

rxnutils.routes.utils.validation module

+

Module containing routes to validate AiZynthFinder-like input dictionaries

+
+
+class rxnutils.routes.utils.validation.ReactionNode(**data)
+

Bases: BaseModel

+

Node representing a reaction

+
+
Parameters:
+

data (Any)

+
+
+
+
+type: Annotated[str, StringConstraints(pattern='^reaction$')]
+
+ +
+
+children: List[MoleculeNode]
+
+ +
+
+model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
+

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

+
+ +
+
+model_config: ClassVar[ConfigDict] = {}
+

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

+
+ +
+
+model_fields: ClassVar[Dict[str, FieldInfo]] = {'children': FieldInfo(annotation=List[MoleculeNode], required=True), 'type': FieldInfo(annotation=str, required=True, metadata=[StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern='^reaction$')])}
+

Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

+

This replaces Model.__fields__ from Pydantic V1.

+
+ +
+ +
+
+class rxnutils.routes.utils.validation.MoleculeNode(*, smiles, type, children=None)
+

Bases: BaseModel

+

Node representing a molecule

+
+
Parameters:
+
    +
  • smiles (str)

  • +
  • type (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^mol$)])

  • +
  • children (Annotated[List[ReactionNode], Len(min_length=1, max_length=1)] | None)

  • +
+
+
+
+
+smiles: str
+
+ +
+
+type: Annotated[str, StringConstraints(pattern='^mol$')]
+
+ +
+
+children: conlist(ReactionNode, min_length=1, max_length=1) | None
+
+ +
+
+model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
+

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

+
+ +
+
+model_config: ClassVar[ConfigDict] = {}
+

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

+
+ +
+
+model_fields: ClassVar[Dict[str, FieldInfo]] = {'children': FieldInfo(annotation=Union[Annotated[List[ReactionNode], Len], NoneType], required=False, default=None), 'smiles': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=str, required=True, metadata=[StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern='^mol$')])}
+

Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

+

This replaces Model.__fields__ from Pydantic V1.

+
+ +
+ +
+
+rxnutils.routes.utils.validation.validate_dict(dict_)
+

Check that the route dictionary is a valid structure

+
+
Parameters:
+
    +
  • dict – the route as dictionary

  • +
  • dict_ (Dict[str, Any])

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+

Module contents

+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/search.html b/search.html new file mode 100644 index 0000000..a9209fb --- /dev/null +++ b/search.html @@ -0,0 +1,125 @@ + + + + + + + Search — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +

Search

+ + + + +

+ Searching for multiple words only shows matches that contain + all words. +

+ + +
+ + + +
+ + +
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/searchindex.js b/searchindex.js new file mode 100644 index 0000000..53fd725 --- /dev/null +++ b/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({"alltitles": {"Actions": [[3, "actions"]], "Artifacts": [[2, "artifacts"], [18, "artifacts"]], "Development": [[3, "development"]], "Installation": [[0, "installation"]], "Introduction": [[0, "introduction"]], "Limitations": [[0, "limitations"]], "Module contents": [[5, "module-rxnutils"], [6, "module-rxnutils.chem"], [7, "module-rxnutils.chem.rinchi"], [8, "module-rxnutils.data"], [9, "module-rxnutils.data.ord"], [10, "module-rxnutils.data.uspto"], [11, "module-rxnutils.pipeline"], [12, "module-rxnutils.pipeline.actions"], [13, "module-rxnutils.routes"], [14, "module-rxnutils.routes.retro_bleu"], [15, "module-rxnutils.routes.ted"], [16, "module-rxnutils.routes.utils"]], "Open reaction database": [[2, null]], "Pipeline": [[3, null]], "Pre-requisites": [[2, "pre-requisites"], [18, "pre-requisites"]], "Reading": [[4, "reading"]], "Routes": [[4, null]], "Submodules": [[6, "submodules"], [7, "submodules"], [8, "submodules"], [9, "submodules"], [10, "submodules"], [11, "submodules"], [12, "submodules"], [13, "submodules"], [14, "submodules"], [15, "submodules"], [16, "submodules"]], "Subpackages": [[5, "subpackages"], [6, "subpackages"], [8, "subpackages"], [11, "subpackages"], [13, "subpackages"]], "Template extraction": [[17, "template-extraction"]], "Template manipulation": [[17, "template-manipulation"]], "Templates": [[17, null]], "USPTO": [[18, null]], "Usage": [[2, "usage"], [3, "usage"], [18, "usage"]], "rxnutils": [[1, null]], "rxnutils documentation": [[0, null]], "rxnutils package": [[5, null]], "rxnutils.chem package": [[6, null]], "rxnutils.chem.augmentation module": [[6, "module-rxnutils.chem.augmentation"]], "rxnutils.chem.cgr module": [[6, "module-rxnutils.chem.cgr"]], "rxnutils.chem.reaction module": [[6, "module-rxnutils.chem.reaction"]], "rxnutils.chem.rinchi package": [[7, null]], "rxnutils.chem.rinchi.download_rinchi module": [[7, "module-rxnutils.chem.rinchi.download_rinchi"]], "rxnutils.chem.rinchi.rinchi_api module": [[7, "module-rxnutils.chem.rinchi.rinchi_api"]], "rxnutils.chem.template module": [[6, "module-rxnutils.chem.template"]], "rxnutils.chem.utils module": [[6, "module-rxnutils.chem.utils"]], "rxnutils.data package": [[8, null]], "rxnutils.data.base_pipeline module": [[8, "module-rxnutils.data.base_pipeline"]], "rxnutils.data.batch_utils module": [[8, "module-rxnutils.data.batch_utils"]], "rxnutils.data.mapping module": [[8, "module-rxnutils.data.mapping"]], "rxnutils.data.mapping_pipeline module": [[8, "module-rxnutils.data.mapping_pipeline"]], "rxnutils.data.ord package": [[9, null]], "rxnutils.data.ord.import_ord_dataset module": [[9, "module-rxnutils.data.ord.import_ord_dataset"]], "rxnutils.data.ord.preparation_pipeline module": [[9, "module-rxnutils.data.ord.preparation_pipeline"]], "rxnutils.data.uspto package": [[10, null]], "rxnutils.data.uspto.combine module": [[10, "module-rxnutils.data.uspto.combine"]], "rxnutils.data.uspto.download module": [[10, "module-rxnutils.data.uspto.download"]], "rxnutils.data.uspto.preparation_pipeline module": [[10, "module-rxnutils.data.uspto.preparation_pipeline"]], "rxnutils.data.uspto.uspto_yield module": [[10, "module-rxnutils.data.uspto.uspto_yield"]], "rxnutils.pipeline package": [[11, null]], "rxnutils.pipeline.actions package": [[12, null]], "rxnutils.pipeline.actions.dataframe_mod module": [[12, "module-rxnutils.pipeline.actions.dataframe_mod"]], "rxnutils.pipeline.actions.reaction_mod module": [[12, "module-rxnutils.pipeline.actions.reaction_mod"]], "rxnutils.pipeline.actions.reaction_props module": [[12, "module-rxnutils.pipeline.actions.reaction_props"]], "rxnutils.pipeline.actions.templates module": [[12, "module-rxnutils.pipeline.actions.templates"]], "rxnutils.pipeline.base module": [[11, "module-rxnutils.pipeline.base"]], "rxnutils.pipeline.runner module": [[11, "module-rxnutils.pipeline.runner"]], "rxnutils.routes package": [[13, null]], "rxnutils.routes.base module": [[13, "module-rxnutils.routes.base"]], "rxnutils.routes.comparison module": [[13, "module-rxnutils.routes.comparison"]], "rxnutils.routes.image module": [[13, "module-rxnutils.routes.image"]], "rxnutils.routes.readers module": [[13, "module-rxnutils.routes.readers"]], "rxnutils.routes.retro_bleu package": [[14, null]], "rxnutils.routes.retro_bleu.ngram_collection module": [[14, "module-rxnutils.routes.retro_bleu.ngram_collection"]], "rxnutils.routes.retro_bleu.scoring module": [[14, "module-rxnutils.routes.retro_bleu.scoring"]], "rxnutils.routes.scoring module": [[13, "module-rxnutils.routes.scoring"]], "rxnutils.routes.ted package": [[15, null]], "rxnutils.routes.ted.distances_calculator module": [[15, "module-rxnutils.routes.ted.distances_calculator"]], "rxnutils.routes.ted.reactiontree module": [[15, "module-rxnutils.routes.ted.reactiontree"]], "rxnutils.routes.ted.utils module": [[15, "module-rxnutils.routes.ted.utils"]], "rxnutils.routes.utils package": [[16, null]], "rxnutils.routes.utils.validation module": [[16, "module-rxnutils.routes.utils.validation"]]}, "docnames": ["index", "modules", "ord", "pipeline", "routes", "rxnutils", "rxnutils.chem", "rxnutils.chem.rinchi", "rxnutils.data", "rxnutils.data.ord", "rxnutils.data.uspto", "rxnutils.pipeline", "rxnutils.pipeline.actions", "rxnutils.routes", "rxnutils.routes.retro_bleu", "rxnutils.routes.ted", "rxnutils.routes.utils", "templates", "uspto"], "envversion": {"sphinx": 62, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2}, "filenames": ["index.rst", "modules.rst", "ord.rst", "pipeline.rst", "routes.rst", "rxnutils.rst", "rxnutils.chem.rst", "rxnutils.chem.rinchi.rst", "rxnutils.data.rst", "rxnutils.data.ord.rst", "rxnutils.data.uspto.rst", "rxnutils.pipeline.rst", "rxnutils.pipeline.actions.rst", "rxnutils.routes.rst", "rxnutils.routes.retro_bleu.rst", "rxnutils.routes.ted.rst", "rxnutils.routes.utils.rst", "templates.rst", "uspto.rst"], "indexentries": {"action() (in module rxnutils.pipeline.base)": [[11, "rxnutils.pipeline.base.action", false]], "agents_list (rxnutils.chem.reaction.chemicalreaction property)": [[6, "rxnutils.chem.reaction.ChemicalReaction.agents_list", false]], "apply() (rxnutils.chem.template.reactiontemplate method)": [[6, "rxnutils.chem.template.ReactionTemplate.apply", false]], "aptedconfig (class in rxnutils.routes.ted.utils)": [[15, "rxnutils.routes.ted.utils.AptedConfig", false]], "assign_atom_mapping() (rxnutils.routes.base.synthesisroute method)": [[13, "rxnutils.routes.base.SynthesisRoute.assign_atom_mapping", false]], "atom_invariants() (rxnutils.chem.template.templatemolecule method)": [[6, "rxnutils.chem.template.TemplateMolecule.atom_invariants", false]], "atom_mapped_reaction_smiles() (rxnutils.routes.base.synthesisroute method)": [[13, "rxnutils.routes.base.SynthesisRoute.atom_mapped_reaction_smiles", false]], "atom_mapping_numbers() (in module rxnutils.chem.utils)": [[6, "rxnutils.chem.utils.atom_mapping_numbers", false]], "atom_matching_bonanza_similarity() (in module rxnutils.routes.comparison)": [[13, "rxnutils.routes.comparison.atom_matching_bonanza_similarity", false]], "atom_properties() (rxnutils.chem.template.templatemolecule method)": [[6, "rxnutils.chem.template.TemplateMolecule.atom_properties", false]], "atommaptagdisconnectionsite (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.AtomMapTagDisconnectionSite", false]], "atoms() (rxnutils.chem.template.templatemolecule method)": [[6, "rxnutils.chem.template.TemplateMolecule.atoms", false]], "bad_column (rxnutils.pipeline.actions.reaction_mod.removeunsanitizable attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveUnsanitizable.bad_column", false]], "bad_columns (rxnutils.pipeline.actions.reaction_props.hasunsanitizablereactants attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.HasUnsanitizableReactants.bad_columns", false]], "badowski_route_score() (in module rxnutils.routes.scoring)": [[13, "rxnutils.routes.scoring.badowski_route_score", false]], "bonds_broken (rxnutils.chem.cgr.condensedgraphreaction property)": [[6, "rxnutils.chem.cgr.CondensedGraphReaction.bonds_broken", false]], "bonds_changed (rxnutils.chem.cgr.condensedgraphreaction property)": [[6, "rxnutils.chem.cgr.CondensedGraphReaction.bonds_changed", false]], "bonds_formed (rxnutils.chem.cgr.condensedgraphreaction property)": [[6, "rxnutils.chem.cgr.CondensedGraphReaction.bonds_formed", false]], "both (rxnutils.routes.ted.utils.treecontent attribute)": [[15, "rxnutils.routes.ted.utils.TreeContent.BOTH", false]], "calc_yield_column (rxnutils.data.uspto.uspto_yield.usptoyieldcuration attribute)": [[10, "rxnutils.data.uspto.uspto_yield.UsptoYieldCuration.calc_yield_column", false]], "canonical_template (rxnutils.chem.reaction.chemicalreaction property)": [[6, "rxnutils.chem.reaction.ChemicalReaction.canonical_template", false]], "canonical_template_generate_outcome() (rxnutils.chem.reaction.chemicalreaction method)": [[6, "rxnutils.chem.reaction.ChemicalReaction.canonical_template_generate_outcome", false]], "cgrcreated (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.CgrCreated", false]], "cgrnumberofdynamicbonds (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.CgrNumberOfDynamicBonds", false]], "chains() (rxnutils.routes.base.synthesisroute method)": [[13, "rxnutils.routes.base.SynthesisRoute.chains", false]], "chemicalreaction (class in rxnutils.chem.reaction)": [[6, "rxnutils.chem.reaction.ChemicalReaction", false]], "children (rxnutils.routes.utils.validation.moleculenode attribute)": [[16, "rxnutils.routes.utils.validation.MoleculeNode.children", false]], "children (rxnutils.routes.utils.validation.reactionnode attribute)": [[16, "rxnutils.routes.utils.validation.ReactionNode.children", false]], "children() (rxnutils.routes.ted.utils.aptedconfig method)": [[15, "rxnutils.routes.ted.utils.AptedConfig.children", false]], "columns (rxnutils.pipeline.actions.dataframe_mod.dropcolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.DropColumns.columns", false]], "columns (rxnutils.pipeline.actions.dataframe_mod.keepcolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.KeepColumns.columns", false]], "combine_batches() (in module rxnutils.data.batch_utils)": [[8, "rxnutils.data.batch_utils.combine_batches", false]], "combine_csv_batches() (in module rxnutils.data.batch_utils)": [[8, "rxnutils.data.batch_utils.combine_csv_batches", false]], "combine_files() (rxnutils.data.uspto.preparation_pipeline.usptodatapreparationflow method)": [[10, "rxnutils.data.uspto.preparation_pipeline.UsptoDataPreparationFlow.combine_files", false]], "combine_sparse_matrix_batches() (in module rxnutils.data.batch_utils)": [[8, "rxnutils.data.batch_utils.combine_sparse_matrix_batches", false]], "condensedgraphreaction (class in rxnutils.chem.cgr)": [[6, "rxnutils.chem.cgr.CondensedGraphReaction", false]], "convertatommapdisconnectiontag (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.ConvertAtomMapDisconnectionTag", false]], "countcomponents (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.CountComponents", false]], "countelements (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.CountElements", false]], "counttemplatecomponents (class in rxnutils.pipeline.actions.templates)": [[12, "rxnutils.pipeline.actions.templates.CountTemplateComponents", false]], "create_action() (in module rxnutils.pipeline.base)": [[11, "rxnutils.pipeline.base.create_action", false]], "create_csv_batches() (in module rxnutils.data.batch_utils)": [[8, "rxnutils.data.batch_utils.create_csv_batches", false]], "crop_image() (in module rxnutils.routes.image)": [[13, "rxnutils.routes.image.crop_image", false]], "data_prefix (rxnutils.data.base_pipeline.datapreparationbaseflow attribute)": [[8, "rxnutils.data.base_pipeline.DataPreparationBaseFlow.data_prefix", false]], "data_prefix (rxnutils.data.mapping_pipeline.rxnmappingflow attribute)": [[8, "rxnutils.data.mapping_pipeline.RxnMappingFlow.data_prefix", false]], "data_prefix (rxnutils.data.ord.preparation_pipeline.orddatapreparationflow attribute)": [[9, "rxnutils.data.ord.preparation_pipeline.OrdDataPreparationFlow.data_prefix", false]], "data_prefix (rxnutils.data.uspto.preparation_pipeline.usptodatapreparationflow attribute)": [[10, "rxnutils.data.uspto.preparation_pipeline.UsptoDataPreparationFlow.data_prefix", false]], "databaseflow (class in rxnutils.data.base_pipeline)": [[8, "rxnutils.data.base_pipeline.DataBaseFlow", false]], "datapreparationbaseflow (class in rxnutils.data.base_pipeline)": [[8, "rxnutils.data.base_pipeline.DataPreparationBaseFlow", false]], "desalt_molecules() (in module rxnutils.chem.utils)": [[6, "rxnutils.chem.utils.desalt_molecules", false]], "desaltmolecules (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.DesaltMolecules", false]], "distance_iter() (rxnutils.routes.ted.reactiontree.reactiontreewrapper method)": [[15, "rxnutils.routes.ted.reactiontree.ReactionTreeWrapper.distance_iter", false]], "distance_to() (rxnutils.chem.cgr.condensedgraphreaction method)": [[6, "rxnutils.chem.cgr.CondensedGraphReaction.distance_to", false]], "distance_to() (rxnutils.routes.ted.reactiontree.reactiontreewrapper method)": [[15, "rxnutils.routes.ted.reactiontree.ReactionTreeWrapper.distance_to", false]], "distance_to_with_sorting() (rxnutils.routes.ted.reactiontree.reactiontreewrapper method)": [[15, "rxnutils.routes.ted.reactiontree.ReactionTreeWrapper.distance_to_with_sorting", false]], "do_cleaning() (rxnutils.data.ord.preparation_pipeline.orddatapreparationflow method)": [[9, "rxnutils.data.ord.preparation_pipeline.OrdDataPreparationFlow.do_cleaning", false]], "do_cleaning() (rxnutils.data.uspto.preparation_pipeline.usptodatapreparationflow method)": [[10, "rxnutils.data.uspto.preparation_pipeline.UsptoDataPreparationFlow.do_cleaning", false]], "do_mapping() (rxnutils.data.mapping_pipeline.rxnmappingflow method)": [[8, "rxnutils.data.mapping_pipeline.RxnMappingFlow.do_mapping", false]], "draw_rounded_rectangle() (in module rxnutils.routes.image)": [[13, "rxnutils.routes.image.draw_rounded_rectangle", false]], "dropcolumns (class in rxnutils.pipeline.actions.dataframe_mod)": [[12, "rxnutils.pipeline.actions.dataframe_mod.DropColumns", false]], "dropduplicates (class in rxnutils.pipeline.actions.dataframe_mod)": [[12, "rxnutils.pipeline.actions.dataframe_mod.DropDuplicates", false]], "droprows (class in rxnutils.pipeline.actions.dataframe_mod)": [[12, "rxnutils.pipeline.actions.dataframe_mod.DropRows", false]], "end() (rxnutils.data.mapping_pipeline.rxnmappingflow method)": [[8, "rxnutils.data.mapping_pipeline.RxnMappingFlow.end", false]], "end() (rxnutils.data.ord.preparation_pipeline.orddatapreparationflow method)": [[9, "rxnutils.data.ord.preparation_pipeline.OrdDataPreparationFlow.end", false]], "end() (rxnutils.data.uspto.preparation_pipeline.usptodatapreparationflow method)": [[10, "rxnutils.data.uspto.preparation_pipeline.UsptoDataPreparationFlow.end", false]], "expected_reactants_column (rxnutils.pipeline.actions.templates.retrotemplatereproduction attribute)": [[12, "rxnutils.pipeline.actions.templates.RetroTemplateReproduction.expected_reactants_column", false]], "fingerprint_bits() (rxnutils.chem.template.reactiontemplate method)": [[6, "rxnutils.chem.template.ReactionTemplate.fingerprint_bits", false]], "fingerprint_bits() (rxnutils.chem.template.templatemolecule method)": [[6, "rxnutils.chem.template.TemplateMolecule.fingerprint_bits", false]], "fingerprint_vector() (rxnutils.chem.template.reactiontemplate method)": [[6, "rxnutils.chem.template.ReactionTemplate.fingerprint_vector", false]], "fingerprint_vector() (rxnutils.chem.template.templatemolecule method)": [[6, "rxnutils.chem.template.TemplateMolecule.fingerprint_vector", false]], "first_tree (rxnutils.routes.ted.reactiontree.reactiontreewrapper property)": [[15, "rxnutils.routes.ted.reactiontree.ReactionTreeWrapper.first_tree", false]], "fix_atom_properties() (rxnutils.chem.template.templatemolecule method)": [[6, "rxnutils.chem.template.TemplateMolecule.fix_atom_properties", false]], "folder (rxnutils.data.base_pipeline.databaseflow attribute)": [[8, "rxnutils.data.base_pipeline.DataBaseFlow.folder", false]], "from_file() (rxnutils.routes.retro_bleu.ngram_collection.ngramcollection class method)": [[14, "rxnutils.routes.retro_bleu.ngram_collection.NgramCollection.from_file", false]], "from_tree_collection() (rxnutils.routes.retro_bleu.ngram_collection.ngramcollection class method)": [[14, "rxnutils.routes.retro_bleu.ngram_collection.NgramCollection.from_tree_collection", false]], "generate_coreagent() (rxnutils.chem.reaction.chemicalreaction method)": [[6, "rxnutils.chem.reaction.ChemicalReaction.generate_coreagent", false]], "generate_reaction_template() (rxnutils.chem.reaction.chemicalreaction method)": [[6, "rxnutils.chem.reaction.ChemicalReaction.generate_reaction_template", false]], "generate_rinchi() (in module rxnutils.chem.rinchi.rinchi_api)": [[7, "rxnutils.chem.rinchi.rinchi_api.generate_rinchi", false]], "get_special_groups() (in module rxnutils.chem.utils)": [[6, "rxnutils.chem.utils.get_special_groups", false]], "has_atom_mapping() (in module rxnutils.chem.utils)": [[6, "rxnutils.chem.utils.has_atom_mapping", false]], "has_partial_mapping() (rxnutils.chem.reaction.chemicalreaction method)": [[6, "rxnutils.chem.reaction.ChemicalReaction.has_partial_mapping", false]], "hash_from_bits() (rxnutils.chem.template.reactiontemplate method)": [[6, "rxnutils.chem.template.ReactionTemplate.hash_from_bits", false]], "hash_from_smarts() (rxnutils.chem.template.reactiontemplate method)": [[6, "rxnutils.chem.template.ReactionTemplate.hash_from_smarts", false]], "hash_from_smarts() (rxnutils.chem.template.templatemolecule method)": [[6, "rxnutils.chem.template.TemplateMolecule.hash_from_smarts", false]], "hash_from_smiles() (rxnutils.chem.template.reactiontemplate method)": [[6, "rxnutils.chem.template.ReactionTemplate.hash_from_smiles", false]], "hash_from_smiles() (rxnutils.chem.template.templatemolecule method)": [[6, "rxnutils.chem.template.TemplateMolecule.hash_from_smiles", false]], "hashed_rid (rxnutils.chem.reaction.chemicalreaction property)": [[6, "rxnutils.chem.reaction.ChemicalReaction.hashed_rid", false]], "hasstereoinfo (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.HasStereoInfo", false]], "hasunmappedradicalatom (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.HasUnmappedRadicalAtom", false]], "hasunsanitizablereactants (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.HasUnsanitizableReactants", false]], "image() (rxnutils.routes.base.synthesisroute method)": [[13, "rxnutils.routes.base.SynthesisRoute.image", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.atommaptagdisconnectionsite attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.AtomMapTagDisconnectionSite.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.convertatommapdisconnectiontag attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.ConvertAtomMapDisconnectionTag.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.desaltmolecules attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.DesaltMolecules.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.invertstereo attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.InvertStereo.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.isotopeinfo attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.IsotopeInfo.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.namerxn attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.NameRxn.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.neutralizemolecules attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.NeutralizeMolecules.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.rdkitrxnroles attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RDKitRxnRoles.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.reactantstoreagents attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.ReactantsToReagents.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.reagentstoreactants attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.ReagentsToReactants.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.removeatommapping attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveAtomMapping.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.removeextraatommapping attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveExtraAtomMapping.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.removestereoinfo attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveStereoInfo.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.removeunchangedproducts attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveUnchangedProducts.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.removeunsanitizable attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveUnsanitizable.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.rxnmapper attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RxnMapper.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.splitreaction attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.SplitReaction.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_mod.trimrxnsmiles attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.TrimRxnSmiles.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.cgrcreated attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CgrCreated.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.cgrnumberofdynamicbonds attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CgrNumberOfDynamicBonds.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.countcomponents attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CountComponents.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.countelements attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CountElements.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.hasstereoinfo attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.HasStereoInfo.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.hasunmappedradicalatom attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.HasUnmappedRadicalAtom.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.maxringnumber attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.MaxRingNumber.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.productatommappingstats attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ProductAtomMappingStats.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.productsize attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ProductSize.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.pseudoreactionhash attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.PseudoReactionHash.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.pseudosmileshash attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.PseudoSmilesHash.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.reactantproductatombalance attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ReactantProductAtomBalance.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.reactantsize attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ReactantSize.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.ringbondmade attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.RingBondMade.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.ringmadesize attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.RingMadeSize.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.ringnumberchange attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.RingNumberChange.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.smileslength attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.SmilesLength.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.smilessanitizable attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.SmilesSanitizable.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.stereocenterinreactantpotential attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterInReactantPotential.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.stereocenteriscreated attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterIsCreated.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.stereocenterisremoved attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterIsRemoved.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.stereocenteroutsidereaction attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterOutsideReaction.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.stereocentrechanges attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCentreChanges.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.stereohaschiralreagent attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoHasChiralReagent.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.stereoinvention attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoInvention.in_column", false]], "in_column (rxnutils.pipeline.actions.reaction_props.stereomesoproduct attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoMesoProduct.in_column", false]], "in_column (rxnutils.pipeline.actions.templates.counttemplatecomponents attribute)": [[12, "rxnutils.pipeline.actions.templates.CountTemplateComponents.in_column", false]], "in_columns (rxnutils.pipeline.actions.dataframe_mod.renamecolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.RenameColumns.in_columns", false]], "in_columns (rxnutils.pipeline.actions.dataframe_mod.stackcolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.StackColumns.in_columns", false]], "indicator_columns (rxnutils.pipeline.actions.dataframe_mod.droprows attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.DropRows.indicator_columns", false]], "info (rxnutils.routes.ted.reactiontree.reactiontreewrapper property)": [[15, "rxnutils.routes.ted.reactiontree.ReactionTreeWrapper.info", false]], "invertstereo (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.InvertStereo", false]], "is_complete() (rxnutils.chem.reaction.chemicalreaction method)": [[6, "rxnutils.chem.reaction.ChemicalReaction.is_complete", false]], "is_fuzzy() (rxnutils.chem.reaction.chemicalreaction method)": [[6, "rxnutils.chem.reaction.ChemicalReaction.is_fuzzy", false]], "is_solved() (rxnutils.routes.base.synthesisroute method)": [[13, "rxnutils.routes.base.SynthesisRoute.is_solved", false]], "isotope_column (rxnutils.pipeline.actions.reaction_mod.isotopeinfo attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.IsotopeInfo.isotope_column", false]], "isotopeinfo (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.IsotopeInfo", false]], "join_cleaning() (rxnutils.data.ord.preparation_pipeline.orddatapreparationflow method)": [[9, "rxnutils.data.ord.preparation_pipeline.OrdDataPreparationFlow.join_cleaning", false]], "join_cleaning() (rxnutils.data.uspto.preparation_pipeline.usptodatapreparationflow method)": [[10, "rxnutils.data.uspto.preparation_pipeline.UsptoDataPreparationFlow.join_cleaning", false]], "join_lists() (rxnutils.pipeline.base.reactionactionmixin method)": [[11, "rxnutils.pipeline.base.ReactionActionMixIn.join_lists", false]], "join_mapping() (rxnutils.data.mapping_pipeline.rxnmappingflow method)": [[8, "rxnutils.data.mapping_pipeline.RxnMappingFlow.join_mapping", false]], "join_smiles() (rxnutils.pipeline.base.reactionactionmixin method)": [[11, "rxnutils.pipeline.base.ReactionActionMixIn.join_smiles", false]], "join_smiles_from_reaction() (in module rxnutils.chem.utils)": [[6, "rxnutils.chem.utils.join_smiles_from_reaction", false]], "keep_something (rxnutils.pipeline.actions.reaction_mod.desaltmolecules attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.DesaltMolecules.keep_something", false]], "keepcolumns (class in rxnutils.pipeline.actions.dataframe_mod)": [[12, "rxnutils.pipeline.actions.dataframe_mod.KeepColumns", false]], "key_columns (rxnutils.pipeline.actions.dataframe_mod.dropduplicates attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.DropDuplicates.key_columns", false]], "leaves() (rxnutils.routes.base.synthesisroute method)": [[13, "rxnutils.routes.base.SynthesisRoute.leaves", false]], "list_actions() (in module rxnutils.pipeline.base)": [[11, "rxnutils.pipeline.base.list_actions", false]], "main() (in module rxnutils.chem.rinchi.download_rinchi)": [[7, "rxnutils.chem.rinchi.download_rinchi.main", false]], "main() (in module rxnutils.data.mapping)": [[8, "rxnutils.data.mapping.main", false]], "main() (in module rxnutils.data.ord.import_ord_dataset)": [[9, "rxnutils.data.ord.import_ord_dataset.main", false]], "main() (in module rxnutils.data.uspto.combine)": [[10, "rxnutils.data.uspto.combine.main", false]], "main() (in module rxnutils.data.uspto.download)": [[10, "rxnutils.data.uspto.download.main", false]], "main() (in module rxnutils.pipeline.runner)": [[11, "rxnutils.pipeline.runner.main", false]], "mapped_root_smiles (rxnutils.routes.base.synthesisroute property)": [[13, "rxnutils.routes.base.SynthesisRoute.mapped_root_smiles", false]], "match_regex (rxnutils.pipeline.actions.reaction_mod.isotopeinfo attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.IsotopeInfo.match_regex", false]], "maxringnumber (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.MaxRingNumber", false]], "metadata_key (rxnutils.routes.retro_bleu.ngram_collection.ngramcollection attribute)": [[14, "rxnutils.routes.retro_bleu.ngram_collection.NgramCollection.metadata_key", false]], "model_computed_fields (rxnutils.routes.utils.validation.moleculenode attribute)": [[16, "rxnutils.routes.utils.validation.MoleculeNode.model_computed_fields", false]], "model_computed_fields (rxnutils.routes.utils.validation.reactionnode attribute)": [[16, "rxnutils.routes.utils.validation.ReactionNode.model_computed_fields", false]], "model_config (rxnutils.routes.utils.validation.moleculenode attribute)": [[16, "rxnutils.routes.utils.validation.MoleculeNode.model_config", false]], "model_config (rxnutils.routes.utils.validation.reactionnode attribute)": [[16, "rxnutils.routes.utils.validation.ReactionNode.model_config", false]], "model_fields (rxnutils.routes.utils.validation.moleculenode attribute)": [[16, "rxnutils.routes.utils.validation.MoleculeNode.model_fields", false]], "model_fields (rxnutils.routes.utils.validation.reactionnode attribute)": [[16, "rxnutils.routes.utils.validation.ReactionNode.model_fields", false]], "module": [[5, "module-rxnutils", false], [6, "module-rxnutils.chem", false], [6, "module-rxnutils.chem.augmentation", false], [6, "module-rxnutils.chem.cgr", false], [6, "module-rxnutils.chem.reaction", false], [6, "module-rxnutils.chem.template", false], [6, "module-rxnutils.chem.utils", false], [7, "module-rxnutils.chem.rinchi", false], [7, "module-rxnutils.chem.rinchi.download_rinchi", false], [7, "module-rxnutils.chem.rinchi.rinchi_api", false], [8, "module-rxnutils.data", false], [8, "module-rxnutils.data.base_pipeline", false], [8, "module-rxnutils.data.batch_utils", false], [8, "module-rxnutils.data.mapping", false], [8, "module-rxnutils.data.mapping_pipeline", false], [9, "module-rxnutils.data.ord", false], [9, "module-rxnutils.data.ord.import_ord_dataset", false], [9, "module-rxnutils.data.ord.preparation_pipeline", false], [10, "module-rxnutils.data.uspto", false], [10, "module-rxnutils.data.uspto.combine", false], [10, "module-rxnutils.data.uspto.download", false], [10, "module-rxnutils.data.uspto.preparation_pipeline", false], [10, "module-rxnutils.data.uspto.uspto_yield", false], [11, "module-rxnutils.pipeline", false], [11, "module-rxnutils.pipeline.base", false], [11, "module-rxnutils.pipeline.runner", false], [12, "module-rxnutils.pipeline.actions", false], [12, "module-rxnutils.pipeline.actions.dataframe_mod", false], [12, "module-rxnutils.pipeline.actions.reaction_mod", false], [12, "module-rxnutils.pipeline.actions.reaction_props", false], [12, "module-rxnutils.pipeline.actions.templates", false], [13, "module-rxnutils.routes", false], [13, "module-rxnutils.routes.base", false], [13, "module-rxnutils.routes.comparison", false], [13, "module-rxnutils.routes.image", false], [13, "module-rxnutils.routes.readers", false], [13, "module-rxnutils.routes.scoring", false], [14, "module-rxnutils.routes.retro_bleu", false], [14, "module-rxnutils.routes.retro_bleu.ngram_collection", false], [14, "module-rxnutils.routes.retro_bleu.scoring", false], [15, "module-rxnutils.routes.ted", false], [15, "module-rxnutils.routes.ted.distances_calculator", false], [15, "module-rxnutils.routes.ted.reactiontree", false], [15, "module-rxnutils.routes.ted.utils", false], [16, "module-rxnutils.routes.utils", false], [16, "module-rxnutils.routes.utils.validation", false]], "molecule_to_image() (in module rxnutils.routes.image)": [[13, "rxnutils.routes.image.molecule_to_image", false]], "moleculenode (class in rxnutils.routes.utils.validation)": [[16, "rxnutils.routes.utils.validation.MoleculeNode", false]], "molecules (rxnutils.routes.ted.utils.treecontent attribute)": [[15, "rxnutils.routes.ted.utils.TreeContent.MOLECULES", false]], "molecules_to_images() (in module rxnutils.routes.image)": [[13, "rxnutils.routes.image.molecules_to_images", false]], "namerxn (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.NameRxn", false]], "nbatches (rxnutils.data.base_pipeline.databaseflow attribute)": [[8, "rxnutils.data.base_pipeline.DataBaseFlow.nbatches", false]], "neutralize_molecules() (in module rxnutils.chem.utils)": [[6, "rxnutils.chem.utils.neutralize_molecules", false]], "neutralizemolecules (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.NeutralizeMolecules", false]], "ngram_overlap_score() (in module rxnutils.routes.retro_bleu.scoring)": [[14, "rxnutils.routes.retro_bleu.scoring.ngram_overlap_score", false]], "ngramcollection (class in rxnutils.routes.retro_bleu.ngram_collection)": [[14, "rxnutils.routes.retro_bleu.ngram_collection.NgramCollection", false]], "ngrams (rxnutils.routes.retro_bleu.ngram_collection.ngramcollection attribute)": [[14, "rxnutils.routes.retro_bleu.ngram_collection.NgramCollection.ngrams", false]], "nitems (rxnutils.routes.retro_bleu.ngram_collection.ngramcollection attribute)": [[14, "rxnutils.routes.retro_bleu.ngram_collection.NgramCollection.nitems", false]], "nlines() (in module rxnutils.data.batch_utils)": [[8, "rxnutils.data.batch_utils.nlines", false]], "nm_rxn_column (rxnutils.pipeline.actions.reaction_mod.namerxn attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.NameRxn.nm_rxn_column", false]], "nmapped_products_column (rxnutils.pipeline.actions.reaction_props.countcomponents attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CountComponents.nmapped_products_column", false]], "nmapped_reactants_column (rxnutils.pipeline.actions.reaction_props.countcomponents attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CountComponents.nmapped_reactants_column", false]], "nmapped_reagents_column (rxnutils.pipeline.actions.reaction_props.countcomponents attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CountComponents.nmapped_reagents_column", false]], "nmc_column (rxnutils.pipeline.actions.reaction_mod.namerxn attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.NameRxn.nmc_column", false]], "no_change() (rxnutils.chem.reaction.chemicalreaction method)": [[6, "rxnutils.chem.reaction.ChemicalReaction.no_change", false]], "no_reagents (rxnutils.pipeline.actions.reaction_props.pseudoreactionhash attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.PseudoReactionHash.no_reagents", false]], "noutcomes_column (rxnutils.pipeline.actions.templates.retrotemplatereproduction attribute)": [[12, "rxnutils.pipeline.actions.templates.RetroTemplateReproduction.noutcomes_column", false]], "nproducts_column (rxnutils.pipeline.actions.reaction_props.countcomponents attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CountComponents.nproducts_column", false]], "nproducts_column (rxnutils.pipeline.actions.templates.counttemplatecomponents attribute)": [[12, "rxnutils.pipeline.actions.templates.CountTemplateComponents.nproducts_column", false]], "nreactants_column (rxnutils.pipeline.actions.reaction_props.countcomponents attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CountComponents.nreactants_column", false]], "nreactants_column (rxnutils.pipeline.actions.templates.counttemplatecomponents attribute)": [[12, "rxnutils.pipeline.actions.templates.CountTemplateComponents.nreactants_column", false]], "nreagents_column (rxnutils.pipeline.actions.reaction_props.countcomponents attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CountComponents.nreagents_column", false]], "nreagents_column (rxnutils.pipeline.actions.templates.counttemplatecomponents attribute)": [[12, "rxnutils.pipeline.actions.templates.CountTemplateComponents.nreagents_column", false]], "nsteps (rxnutils.routes.base.synthesisroute property)": [[13, "rxnutils.routes.base.SynthesisRoute.nsteps", false]], "options (rxnutils.pipeline.actions.reaction_mod.namerxn attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.NameRxn.options", false]], "ord_data (rxnutils.data.ord.preparation_pipeline.orddatapreparationflow attribute)": [[9, "rxnutils.data.ord.preparation_pipeline.OrdDataPreparationFlow.ord_data", false]], "orddatapreparationflow (class in rxnutils.data.ord.preparation_pipeline)": [[9, "rxnutils.data.ord.preparation_pipeline.OrdDataPreparationFlow", false]], "other_reactants_column (rxnutils.pipeline.actions.templates.retrotemplatereproduction attribute)": [[12, "rxnutils.pipeline.actions.templates.RetroTemplateReproduction.other_reactants_column", false]], "out_column (rxnutils.data.uspto.uspto_yield.usptoyieldcuration attribute)": [[10, "rxnutils.data.uspto.uspto_yield.UsptoYieldCuration.out_column", false]], "out_column (rxnutils.pipeline.actions.dataframe_mod.stackcolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.StackColumns.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.atommaptagdisconnectionsite attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.AtomMapTagDisconnectionSite.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.desaltmolecules attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.DesaltMolecules.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.invertstereo attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.InvertStereo.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.isotopeinfo attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.IsotopeInfo.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.neutralizemolecules attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.NeutralizeMolecules.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.rdkitrxnroles attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RDKitRxnRoles.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.reactantstoreagents attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.ReactantsToReagents.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.reagentstoreactants attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.ReagentsToReactants.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.removeatommapping attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveAtomMapping.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.removeextraatommapping attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveExtraAtomMapping.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.removestereoinfo attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveStereoInfo.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.removeunchangedproducts attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveUnchangedProducts.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.removeunsanitizable attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveUnsanitizable.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.rxnmapper attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RxnMapper.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_mod.trimrxnsmiles attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.TrimRxnSmiles.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.cgrcreated attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CgrCreated.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.cgrnumberofdynamicbonds attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CgrNumberOfDynamicBonds.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.countelements attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CountElements.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.hasstereoinfo attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.HasStereoInfo.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.hasunmappedradicalatom attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.HasUnmappedRadicalAtom.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.hasunsanitizablereactants attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.HasUnsanitizableReactants.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.maxringnumber attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.MaxRingNumber.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.productsize attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ProductSize.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.pseudoreactionhash attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.PseudoReactionHash.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.pseudosmileshash attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.PseudoSmilesHash.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.reactantproductatombalance attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ReactantProductAtomBalance.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.reactantsize attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ReactantSize.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.ringbondmade attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.RingBondMade.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.ringmadesize attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.RingMadeSize.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.ringnumberchange attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.RingNumberChange.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.smileslength attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.SmilesLength.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.smilessanitizable attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.SmilesSanitizable.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.stereocenterinreactantpotential attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterInReactantPotential.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.stereocenteriscreated attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterIsCreated.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.stereocenterisremoved attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterIsRemoved.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.stereocenteroutsidereaction attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterOutsideReaction.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.stereocentrechanges attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCentreChanges.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.stereohaschiralreagent attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoHasChiralReagent.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.stereoinvention attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoInvention.out_column", false]], "out_column (rxnutils.pipeline.actions.reaction_props.stereomesoproduct attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoMesoProduct.out_column", false]], "out_column_reconstructed (rxnutils.pipeline.actions.reaction_mod.convertatommapdisconnectiontag attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.ConvertAtomMapDisconnectionTag.out_column_reconstructed", false]], "out_column_tagged (rxnutils.pipeline.actions.reaction_mod.convertatommapdisconnectiontag attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.ConvertAtomMapDisconnectionTag.out_column_tagged", false]], "out_columns (rxnutils.pipeline.actions.dataframe_mod.renamecolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.RenameColumns.out_columns", false]], "out_columns (rxnutils.pipeline.actions.reaction_mod.splitreaction attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.SplitReaction.out_columns", false]], "pretty_name (rxnutils.pipeline.actions.dataframe_mod.dropcolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.DropColumns.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.dataframe_mod.dropduplicates attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.DropDuplicates.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.dataframe_mod.droprows attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.DropRows.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.dataframe_mod.keepcolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.KeepColumns.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.dataframe_mod.querydataframe attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.QueryDataframe.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.dataframe_mod.renamecolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.RenameColumns.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.dataframe_mod.stackcolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.StackColumns.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.dataframe_mod.stackmulticolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.StackMultiColumns.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.atommaptagdisconnectionsite attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.AtomMapTagDisconnectionSite.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.convertatommapdisconnectiontag attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.ConvertAtomMapDisconnectionTag.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.desaltmolecules attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.DesaltMolecules.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.invertstereo attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.InvertStereo.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.isotopeinfo attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.IsotopeInfo.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.namerxn attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.NameRxn.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.neutralizemolecules attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.NeutralizeMolecules.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.rdkitrxnroles attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RDKitRxnRoles.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.reactantstoreagents attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.ReactantsToReagents.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.reagentstoreactants attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.ReagentsToReactants.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.removeatommapping attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveAtomMapping.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.removeextraatommapping attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveExtraAtomMapping.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.removestereoinfo attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveStereoInfo.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.removeunchangedproducts attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveUnchangedProducts.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.removeunsanitizable attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveUnsanitizable.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.rxnmapper attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RxnMapper.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.splitreaction attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.SplitReaction.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_mod.trimrxnsmiles attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.TrimRxnSmiles.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.cgrcreated attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CgrCreated.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.cgrnumberofdynamicbonds attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CgrNumberOfDynamicBonds.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.countcomponents attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CountComponents.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.countelements attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.CountElements.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.hasstereoinfo attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.HasStereoInfo.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.hasunmappedradicalatom attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.HasUnmappedRadicalAtom.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.hasunsanitizablereactants attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.HasUnsanitizableReactants.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.maxringnumber attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.MaxRingNumber.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.productatommappingstats attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ProductAtomMappingStats.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.productsize attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ProductSize.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.pseudoreactionhash attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.PseudoReactionHash.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.pseudosmileshash attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.PseudoSmilesHash.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.reactantproductatombalance attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ReactantProductAtomBalance.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.reactantsize attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ReactantSize.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.ringbondmade attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.RingBondMade.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.ringmadesize attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.RingMadeSize.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.ringnumberchange attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.RingNumberChange.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.smileslength attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.SmilesLength.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.smilessanitizable attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.SmilesSanitizable.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.stereocenterinreactantpotential attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterInReactantPotential.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.stereocenteriscreated attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterIsCreated.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.stereocenterisremoved attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterIsRemoved.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.stereocenteroutsidereaction attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterOutsideReaction.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.stereocentrechanges attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCentreChanges.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.stereohaschiralreagent attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoHasChiralReagent.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.stereoinvention attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoInvention.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.reaction_props.stereomesoproduct attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoMesoProduct.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.templates.counttemplatecomponents attribute)": [[12, "rxnutils.pipeline.actions.templates.CountTemplateComponents.pretty_name", false]], "pretty_name (rxnutils.pipeline.actions.templates.retrotemplatereproduction attribute)": [[12, "rxnutils.pipeline.actions.templates.RetroTemplateReproduction.pretty_name", false]], "productatommappingstats (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.ProductAtomMappingStats", false]], "products_list (rxnutils.chem.reaction.chemicalreaction property)": [[6, "rxnutils.chem.reaction.ChemicalReaction.products_list", false]], "productsize (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.ProductSize", false]], "pseudo_rinchi (rxnutils.chem.reaction.chemicalreaction property)": [[6, "rxnutils.chem.reaction.ChemicalReaction.pseudo_rinchi", false]], "pseudo_rinchi_key (rxnutils.chem.reaction.chemicalreaction property)": [[6, "rxnutils.chem.reaction.ChemicalReaction.pseudo_rinchi_key", false]], "pseudoreactionhash (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.PseudoReactionHash", false]], "pseudosmileshash (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.PseudoSmilesHash", false]], "query (rxnutils.pipeline.actions.dataframe_mod.querydataframe attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.QueryDataframe.query", false]], "querydataframe (class in rxnutils.pipeline.actions.dataframe_mod)": [[12, "rxnutils.pipeline.actions.dataframe_mod.QueryDataframe", false]], "rdkit_validation() (rxnutils.chem.template.reactiontemplate method)": [[6, "rxnutils.chem.template.ReactionTemplate.rdkit_validation", false]], "rdkitrxnroles (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.RDKitRxnRoles", false]], "reactantproductatombalance (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.ReactantProductAtomBalance", false]], "reactants_list (rxnutils.chem.reaction.chemicalreaction property)": [[6, "rxnutils.chem.reaction.ChemicalReaction.reactants_list", false]], "reactantsize (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.ReactantSize", false]], "reactantstoreagents (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.ReactantsToReagents", false]], "reaction_centres() (in module rxnutils.chem.utils)": [[6, "rxnutils.chem.utils.reaction_centres", false]], "reaction_data() (rxnutils.routes.base.synthesisroute method)": [[13, "rxnutils.routes.base.SynthesisRoute.reaction_data", false]], "reaction_ngrams() (rxnutils.routes.base.synthesisroute method)": [[13, "rxnutils.routes.base.SynthesisRoute.reaction_ngrams", false]], "reaction_smiles() (rxnutils.routes.base.synthesisroute method)": [[13, "rxnutils.routes.base.SynthesisRoute.reaction_smiles", false]], "reactionactionmixin (class in rxnutils.pipeline.base)": [[11, "rxnutils.pipeline.base.ReactionActionMixIn", false]], "reactionexception": [[6, "rxnutils.chem.reaction.ReactionException", false]], "reactionnode (class in rxnutils.routes.utils.validation)": [[16, "rxnutils.routes.utils.validation.ReactionNode", false]], "reactions (rxnutils.routes.ted.utils.treecontent attribute)": [[15, "rxnutils.routes.ted.utils.TreeContent.REACTIONS", false]], "reactions2route() (in module rxnutils.routes.readers)": [[13, "rxnutils.routes.readers.reactions2route", false]], "reactiontemplate (class in rxnutils.chem.template)": [[6, "rxnutils.chem.template.ReactionTemplate", false]], "reactiontreewrapper (class in rxnutils.routes.ted.reactiontree)": [[15, "rxnutils.routes.ted.reactiontree.ReactionTreeWrapper", false]], "read_aizynthcli_dataframe() (in module rxnutils.routes.readers)": [[13, "rxnutils.routes.readers.read_aizynthcli_dataframe", false]], "read_csv_batch() (in module rxnutils.data.batch_utils)": [[8, "rxnutils.data.batch_utils.read_csv_batch", false]], "read_rdf_file() (in module rxnutils.routes.readers)": [[13, "rxnutils.routes.readers.read_rdf_file", false]], "read_reaction_lists() (in module rxnutils.routes.readers)": [[13, "rxnutils.routes.readers.read_reaction_lists", false]], "read_reactions_dataframe() (in module rxnutils.routes.readers)": [[13, "rxnutils.routes.readers.read_reactions_dataframe", false]], "reagentstoreactants (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.ReagentsToReactants", false]], "reassign_rsmi_atom_mapping() (in module rxnutils.chem.utils)": [[6, "rxnutils.chem.utils.reassign_rsmi_atom_mapping", false]], "remap() (rxnutils.routes.base.synthesisroute method)": [[13, "rxnutils.routes.base.SynthesisRoute.remap", false]], "remove_atom_mapping() (in module rxnutils.chem.utils)": [[6, "rxnutils.chem.utils.remove_atom_mapping", false]], "remove_atom_mapping() (rxnutils.chem.template.templatemolecule method)": [[6, "rxnutils.chem.template.TemplateMolecule.remove_atom_mapping", false]], "remove_atom_mapping_template() (in module rxnutils.chem.utils)": [[6, "rxnutils.chem.utils.remove_atom_mapping_template", false]], "removeatommapping (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveAtomMapping", false]], "removeextraatommapping (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveExtraAtomMapping", false]], "removestereoinfo (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveStereoInfo", false]], "removeunchangedproducts (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveUnchangedProducts", false]], "removeunsanitizable (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.RemoveUnsanitizable", false]], "rename() (rxnutils.routes.ted.utils.aptedconfig method)": [[15, "rxnutils.routes.ted.utils.AptedConfig.rename", false]], "renamecolumns (class in rxnutils.pipeline.actions.dataframe_mod)": [[12, "rxnutils.pipeline.actions.dataframe_mod.RenameColumns", false]], "retro_bleu_score() (in module rxnutils.routes.retro_bleu.scoring)": [[14, "rxnutils.routes.retro_bleu.scoring.retro_bleu_score", false]], "retro_template (rxnutils.chem.reaction.chemicalreaction property)": [[6, "rxnutils.chem.reaction.ChemicalReaction.retro_template", false]], "retro_template_generate_outcome() (rxnutils.chem.reaction.chemicalreaction method)": [[6, "rxnutils.chem.reaction.ChemicalReaction.retro_template_generate_outcome", false]], "retro_template_selectivity() (rxnutils.chem.reaction.chemicalreaction method)": [[6, "rxnutils.chem.reaction.ChemicalReaction.retro_template_selectivity", false]], "retrotemplatereproduction (class in rxnutils.pipeline.actions.templates)": [[12, "rxnutils.pipeline.actions.templates.RetroTemplateReproduction", false]], "rinchi (rxnutils.chem.reaction.chemicalreaction property)": [[6, "rxnutils.chem.reaction.ChemicalReaction.rinchi", false]], "rinchi_key_long (rxnutils.chem.reaction.chemicalreaction property)": [[6, "rxnutils.chem.reaction.ChemicalReaction.rinchi_key_long", false]], "rinchi_key_short (rxnutils.chem.reaction.chemicalreaction property)": [[6, "rxnutils.chem.reaction.ChemicalReaction.rinchi_key_short", false]], "rinchierror": [[7, "rxnutils.chem.rinchi.download_rinchi.RInChIError", false]], "rinchistructure (in module rxnutils.chem.rinchi.rinchi_api)": [[7, "rxnutils.chem.rinchi.rinchi_api.RInChIStructure", false]], "ringbondmade (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.RingBondMade", false]], "ringmadesize (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.RingMadeSize", false]], "ringnumberchange (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.RingNumberChange", false]], "route_distances_calculator() (in module rxnutils.routes.comparison)": [[13, "rxnutils.routes.comparison.route_distances_calculator", false]], "route_ranks() (in module rxnutils.routes.scoring)": [[13, "rxnutils.routes.scoring.route_ranks", false]], "route_sorter() (in module rxnutils.routes.scoring)": [[13, "rxnutils.routes.scoring.route_sorter", false]], "routeimagefactory (class in rxnutils.routes.image)": [[13, "rxnutils.routes.image.RouteImageFactory", false]], "rsmi_column (rxnutils.pipeline.actions.reaction_props.hasunsanitizablereactants attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.HasUnsanitizableReactants.rsmi_column", false]], "run_pipeline() (in module rxnutils.pipeline.runner)": [[11, "rxnutils.pipeline.runner.run_pipeline", false]], "rxnmapper (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.RxnMapper", false]], "rxnmapper_command (rxnutils.pipeline.actions.reaction_mod.rxnmapper attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.RxnMapper.rxnmapper_command", false]], "rxnmappingflow (class in rxnutils.data.mapping_pipeline)": [[8, "rxnutils.data.mapping_pipeline.RxnMappingFlow", false]], "rxnutils": [[5, "module-rxnutils", false]], "rxnutils.chem": [[6, "module-rxnutils.chem", false]], "rxnutils.chem.augmentation": [[6, "module-rxnutils.chem.augmentation", false]], "rxnutils.chem.cgr": [[6, "module-rxnutils.chem.cgr", false]], "rxnutils.chem.reaction": [[6, "module-rxnutils.chem.reaction", false]], "rxnutils.chem.rinchi": [[7, "module-rxnutils.chem.rinchi", false]], "rxnutils.chem.rinchi.download_rinchi": [[7, "module-rxnutils.chem.rinchi.download_rinchi", false]], "rxnutils.chem.rinchi.rinchi_api": [[7, "module-rxnutils.chem.rinchi.rinchi_api", false]], "rxnutils.chem.template": [[6, "module-rxnutils.chem.template", false]], "rxnutils.chem.utils": [[6, "module-rxnutils.chem.utils", false]], "rxnutils.data": [[8, "module-rxnutils.data", false]], "rxnutils.data.base_pipeline": [[8, "module-rxnutils.data.base_pipeline", false]], "rxnutils.data.batch_utils": [[8, "module-rxnutils.data.batch_utils", false]], "rxnutils.data.mapping": [[8, "module-rxnutils.data.mapping", false]], "rxnutils.data.mapping_pipeline": [[8, "module-rxnutils.data.mapping_pipeline", false]], "rxnutils.data.ord": [[9, "module-rxnutils.data.ord", false]], "rxnutils.data.ord.import_ord_dataset": [[9, "module-rxnutils.data.ord.import_ord_dataset", false]], "rxnutils.data.ord.preparation_pipeline": [[9, "module-rxnutils.data.ord.preparation_pipeline", false]], "rxnutils.data.uspto": [[10, "module-rxnutils.data.uspto", false]], "rxnutils.data.uspto.combine": [[10, "module-rxnutils.data.uspto.combine", false]], "rxnutils.data.uspto.download": [[10, "module-rxnutils.data.uspto.download", false]], "rxnutils.data.uspto.preparation_pipeline": [[10, "module-rxnutils.data.uspto.preparation_pipeline", false]], "rxnutils.data.uspto.uspto_yield": [[10, "module-rxnutils.data.uspto.uspto_yield", false]], "rxnutils.pipeline": [[11, "module-rxnutils.pipeline", false]], "rxnutils.pipeline.actions": [[12, "module-rxnutils.pipeline.actions", false]], "rxnutils.pipeline.actions.dataframe_mod": [[12, "module-rxnutils.pipeline.actions.dataframe_mod", false]], "rxnutils.pipeline.actions.reaction_mod": [[12, "module-rxnutils.pipeline.actions.reaction_mod", false]], "rxnutils.pipeline.actions.reaction_props": [[12, "module-rxnutils.pipeline.actions.reaction_props", false]], "rxnutils.pipeline.actions.templates": [[12, "module-rxnutils.pipeline.actions.templates", false]], "rxnutils.pipeline.base": [[11, "module-rxnutils.pipeline.base", false]], "rxnutils.pipeline.runner": [[11, "module-rxnutils.pipeline.runner", false]], "rxnutils.routes": [[13, "module-rxnutils.routes", false]], "rxnutils.routes.base": [[13, "module-rxnutils.routes.base", false]], "rxnutils.routes.comparison": [[13, "module-rxnutils.routes.comparison", false]], "rxnutils.routes.image": [[13, "module-rxnutils.routes.image", false]], "rxnutils.routes.readers": [[13, "module-rxnutils.routes.readers", false]], "rxnutils.routes.retro_bleu": [[14, "module-rxnutils.routes.retro_bleu", false]], "rxnutils.routes.retro_bleu.ngram_collection": [[14, "module-rxnutils.routes.retro_bleu.ngram_collection", false]], "rxnutils.routes.retro_bleu.scoring": [[14, "module-rxnutils.routes.retro_bleu.scoring", false]], "rxnutils.routes.scoring": [[13, "module-rxnutils.routes.scoring", false]], "rxnutils.routes.ted": [[15, "module-rxnutils.routes.ted", false]], "rxnutils.routes.ted.distances_calculator": [[15, "module-rxnutils.routes.ted.distances_calculator", false]], "rxnutils.routes.ted.reactiontree": [[15, "module-rxnutils.routes.ted.reactiontree", false]], "rxnutils.routes.ted.utils": [[15, "module-rxnutils.routes.ted.utils", false]], "rxnutils.routes.utils": [[16, "module-rxnutils.routes.utils", false]], "rxnutils.routes.utils.validation": [[16, "module-rxnutils.routes.utils.validation", false]], "same_molecule() (in module rxnutils.chem.utils)": [[6, "rxnutils.chem.utils.same_molecule", false]], "sanitization_check() (rxnutils.chem.reaction.chemicalreaction method)": [[6, "rxnutils.chem.reaction.ChemicalReaction.sanitization_check", false]], "sanitize() (rxnutils.chem.template.templatemolecule method)": [[6, "rxnutils.chem.template.TemplateMolecule.sanitize", false]], "save_to_file() (rxnutils.routes.retro_bleu.ngram_collection.ngramcollection method)": [[14, "rxnutils.routes.retro_bleu.ngram_collection.NgramCollection.save_to_file", false]], "setup_cleaning() (rxnutils.data.ord.preparation_pipeline.orddatapreparationflow method)": [[9, "rxnutils.data.ord.preparation_pipeline.OrdDataPreparationFlow.setup_cleaning", false]], "setup_cleaning() (rxnutils.data.uspto.preparation_pipeline.usptodatapreparationflow method)": [[10, "rxnutils.data.uspto.preparation_pipeline.UsptoDataPreparationFlow.setup_cleaning", false]], "simple_bond_forming_similarity() (in module rxnutils.routes.comparison)": [[13, "rxnutils.routes.comparison.simple_bond_forming_similarity", false]], "simple_route_similarity() (in module rxnutils.routes.comparison)": [[13, "rxnutils.routes.comparison.simple_route_similarity", false]], "single_reactant_augmentation() (in module rxnutils.chem.augmentation)": [[6, "rxnutils.chem.augmentation.single_reactant_augmentation", false]], "smiles (rxnutils.routes.utils.validation.moleculenode attribute)": [[16, "rxnutils.routes.utils.validation.MoleculeNode.smiles", false]], "smiles2inchikey() (in module rxnutils.routes.base)": [[13, "rxnutils.routes.base.smiles2inchikey", false]], "smiles_column (rxnutils.pipeline.actions.templates.retrotemplatereproduction attribute)": [[12, "rxnutils.pipeline.actions.templates.RetroTemplateReproduction.smiles_column", false]], "smiles_column_index (rxnutils.pipeline.actions.reaction_mod.trimrxnsmiles attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.TrimRxnSmiles.smiles_column_index", false]], "smileslength (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.SmilesLength", false]], "smilessanitizable (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.SmilesSanitizable", false]], "split_lists() (rxnutils.pipeline.base.reactionactionmixin method)": [[11, "rxnutils.pipeline.base.ReactionActionMixIn.split_lists", false]], "split_smiles() (rxnutils.pipeline.base.reactionactionmixin method)": [[11, "rxnutils.pipeline.base.ReactionActionMixIn.split_smiles", false]], "split_smiles_from_reaction() (in module rxnutils.chem.utils)": [[6, "rxnutils.chem.utils.split_smiles_from_reaction", false]], "splitreaction (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.SplitReaction", false]], "stack_columns (rxnutils.pipeline.actions.dataframe_mod.stackmulticolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.StackMultiColumns.stack_columns", false]], "stackcolumns (class in rxnutils.pipeline.actions.dataframe_mod)": [[12, "rxnutils.pipeline.actions.dataframe_mod.StackColumns", false]], "stackmulticolumns (class in rxnutils.pipeline.actions.dataframe_mod)": [[12, "rxnutils.pipeline.actions.dataframe_mod.StackMultiColumns", false]], "standardfingerprintfactory (class in rxnutils.routes.ted.utils)": [[15, "rxnutils.routes.ted.utils.StandardFingerprintFactory", false]], "start() (rxnutils.data.mapping_pipeline.rxnmappingflow method)": [[8, "rxnutils.data.mapping_pipeline.RxnMappingFlow.start", false]], "start() (rxnutils.data.ord.preparation_pipeline.orddatapreparationflow method)": [[9, "rxnutils.data.ord.preparation_pipeline.OrdDataPreparationFlow.start", false]], "start() (rxnutils.data.uspto.preparation_pipeline.usptodatapreparationflow method)": [[10, "rxnutils.data.uspto.preparation_pipeline.UsptoDataPreparationFlow.start", false]], "stereo_changes_column (rxnutils.pipeline.actions.reaction_props.stereocentrechanges attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCentreChanges.stereo_changes_column", false]], "stereocenterinreactantpotential (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterInReactantPotential", false]], "stereocenteriscreated (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterIsCreated", false]], "stereocenterisremoved (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterIsRemoved", false]], "stereocenteroutsidereaction (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCenterOutsideReaction", false]], "stereocentrechanges (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoCentreChanges", false]], "stereohaschiralreagent (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoHasChiralReagent", false]], "stereoinvention (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoInvention", false]], "stereomesoproduct (class in rxnutils.pipeline.actions.reaction_props)": [[12, "rxnutils.pipeline.actions.reaction_props.StereoMesoProduct", false]], "sub_regex (rxnutils.pipeline.actions.reaction_mod.isotopeinfo attribute)": [[12, "rxnutils.pipeline.actions.reaction_mod.IsotopeInfo.sub_regex", false]], "synthesisroute (class in rxnutils.routes.base)": [[13, "rxnutils.routes.base.SynthesisRoute", false]], "target_columns (rxnutils.pipeline.actions.dataframe_mod.stackmulticolumns attribute)": [[12, "rxnutils.pipeline.actions.dataframe_mod.StackMultiColumns.target_columns", false]], "ted_distances_calculator() (in module rxnutils.routes.ted.distances_calculator)": [[15, "rxnutils.routes.ted.distances_calculator.ted_distances_calculator", false]], "template_column (rxnutils.pipeline.actions.templates.retrotemplatereproduction attribute)": [[12, "rxnutils.pipeline.actions.templates.RetroTemplateReproduction.template_column", false]], "templatemolecule (class in rxnutils.chem.template)": [[6, "rxnutils.chem.template.TemplateMolecule", false]], "text_yield_column (rxnutils.data.uspto.uspto_yield.usptoyieldcuration attribute)": [[10, "rxnutils.data.uspto.uspto_yield.UsptoYieldCuration.text_yield_column", false]], "total_centers (rxnutils.chem.cgr.condensedgraphreaction property)": [[6, "rxnutils.chem.cgr.CondensedGraphReaction.total_centers", false]], "treecontent (class in rxnutils.routes.ted.utils)": [[15, "rxnutils.routes.ted.utils.TreeContent", false]], "trees (rxnutils.routes.ted.reactiontree.reactiontreewrapper property)": [[15, "rxnutils.routes.ted.reactiontree.ReactionTreeWrapper.trees", false]], "trimrxnsmiles (class in rxnutils.pipeline.actions.reaction_mod)": [[12, "rxnutils.pipeline.actions.reaction_mod.TrimRxnSmiles", false]], "type (rxnutils.routes.utils.validation.moleculenode attribute)": [[16, "rxnutils.routes.utils.validation.MoleculeNode.type", false]], "type (rxnutils.routes.utils.validation.reactionnode attribute)": [[16, "rxnutils.routes.utils.validation.ReactionNode.type", false]], "unmapped_column (rxnutils.pipeline.actions.reaction_props.productatommappingstats attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ProductAtomMappingStats.unmapped_column", false]], "usptodatapreparationflow (class in rxnutils.data.uspto.preparation_pipeline)": [[10, "rxnutils.data.uspto.preparation_pipeline.UsptoDataPreparationFlow", false]], "usptoyieldcuration (class in rxnutils.data.uspto.uspto_yield)": [[10, "rxnutils.data.uspto.uspto_yield.UsptoYieldCuration", false]], "validate_dict() (in module rxnutils.routes.utils.validation)": [[16, "rxnutils.routes.utils.validation.validate_dict", false]], "widow_column (rxnutils.pipeline.actions.reaction_props.productatommappingstats attribute)": [[12, "rxnutils.pipeline.actions.reaction_props.ProductAtomMappingStats.widow_column", false]]}, "objects": {"": [[5, 0, 0, "-", "rxnutils"]], "rxnutils": [[6, 0, 0, "-", "chem"], [8, 0, 0, "-", "data"], [11, 0, 0, "-", "pipeline"], [13, 0, 0, "-", "routes"]], "rxnutils.chem": [[6, 0, 0, "-", "augmentation"], [6, 0, 0, "-", "cgr"], [6, 0, 0, "-", "reaction"], [7, 0, 0, "-", "rinchi"], [6, 0, 0, "-", "template"], [6, 0, 0, "-", "utils"]], "rxnutils.chem.augmentation": [[6, 1, 1, "", "single_reactant_augmentation"]], "rxnutils.chem.cgr": [[6, 2, 1, "", "CondensedGraphReaction"]], "rxnutils.chem.cgr.CondensedGraphReaction": [[6, 3, 1, "", "bonds_broken"], [6, 3, 1, "", "bonds_changed"], [6, 3, 1, "", "bonds_formed"], [6, 4, 1, "", "distance_to"], [6, 3, 1, "", "total_centers"]], "rxnutils.chem.reaction": [[6, 2, 1, "", "ChemicalReaction"], [6, 5, 1, "", "ReactionException"]], "rxnutils.chem.reaction.ChemicalReaction": [[6, 3, 1, "", "agents_list"], [6, 3, 1, "", "canonical_template"], [6, 4, 1, "", "canonical_template_generate_outcome"], [6, 4, 1, "", "generate_coreagent"], [6, 4, 1, "", "generate_reaction_template"], [6, 4, 1, "", "has_partial_mapping"], [6, 3, 1, "", "hashed_rid"], [6, 4, 1, "", "is_complete"], [6, 4, 1, "", "is_fuzzy"], [6, 4, 1, "", "no_change"], [6, 3, 1, "", "products_list"], [6, 3, 1, "", "pseudo_rinchi"], [6, 3, 1, "", "pseudo_rinchi_key"], [6, 3, 1, "", "reactants_list"], [6, 3, 1, "", "retro_template"], [6, 4, 1, "", "retro_template_generate_outcome"], [6, 4, 1, "", "retro_template_selectivity"], [6, 3, 1, "", "rinchi"], [6, 3, 1, "", "rinchi_key_long"], [6, 3, 1, "", "rinchi_key_short"], [6, 4, 1, "", "sanitization_check"]], "rxnutils.chem.rinchi": [[7, 0, 0, "-", "download_rinchi"], [7, 0, 0, "-", "rinchi_api"]], "rxnutils.chem.rinchi.download_rinchi": [[7, 5, 1, "", "RInChIError"], [7, 1, 1, "", "main"]], "rxnutils.chem.rinchi.rinchi_api": [[7, 6, 1, "", "RInChIStructure"], [7, 1, 1, "", "generate_rinchi"]], "rxnutils.chem.template": [[6, 2, 1, "", "ReactionTemplate"], [6, 2, 1, "", "TemplateMolecule"]], "rxnutils.chem.template.ReactionTemplate": [[6, 4, 1, "", "apply"], [6, 4, 1, "", "fingerprint_bits"], [6, 4, 1, "", "fingerprint_vector"], [6, 4, 1, "", "hash_from_bits"], [6, 4, 1, "", "hash_from_smarts"], [6, 4, 1, "", "hash_from_smiles"], [6, 4, 1, "", "rdkit_validation"]], "rxnutils.chem.template.TemplateMolecule": [[6, 4, 1, "", "atom_invariants"], [6, 4, 1, "", "atom_properties"], [6, 4, 1, "", "atoms"], [6, 4, 1, "", "fingerprint_bits"], [6, 4, 1, "", "fingerprint_vector"], [6, 4, 1, "", "fix_atom_properties"], [6, 4, 1, "", "hash_from_smarts"], [6, 4, 1, "", "hash_from_smiles"], [6, 4, 1, "", "remove_atom_mapping"], [6, 4, 1, "", "sanitize"]], "rxnutils.chem.utils": [[6, 1, 1, "", "atom_mapping_numbers"], [6, 1, 1, "", "desalt_molecules"], [6, 1, 1, "", "get_special_groups"], [6, 1, 1, "", "has_atom_mapping"], [6, 1, 1, "", "join_smiles_from_reaction"], [6, 1, 1, "", "neutralize_molecules"], [6, 1, 1, "", "reaction_centres"], [6, 1, 1, "", "reassign_rsmi_atom_mapping"], [6, 1, 1, "", "remove_atom_mapping"], [6, 1, 1, "", "remove_atom_mapping_template"], [6, 1, 1, "", "same_molecule"], [6, 1, 1, "", "split_smiles_from_reaction"]], "rxnutils.data": [[8, 0, 0, "-", "base_pipeline"], [8, 0, 0, "-", "batch_utils"], [8, 0, 0, "-", "mapping"], [8, 0, 0, "-", "mapping_pipeline"], [9, 0, 0, "-", "ord"], [10, 0, 0, "-", "uspto"]], "rxnutils.data.base_pipeline": [[8, 2, 1, "", "DataBaseFlow"], [8, 2, 1, "", "DataPreparationBaseFlow"]], "rxnutils.data.base_pipeline.DataBaseFlow": [[8, 6, 1, "", "folder"], [8, 6, 1, "", "nbatches"]], "rxnutils.data.base_pipeline.DataPreparationBaseFlow": [[8, 6, 1, "", "data_prefix"]], "rxnutils.data.batch_utils": [[8, 1, 1, "", "combine_batches"], [8, 1, 1, "", "combine_csv_batches"], [8, 1, 1, "", "combine_sparse_matrix_batches"], [8, 1, 1, "", "create_csv_batches"], [8, 1, 1, "", "nlines"], [8, 1, 1, "", "read_csv_batch"]], "rxnutils.data.mapping": [[8, 1, 1, "", "main"]], "rxnutils.data.mapping_pipeline": [[8, 2, 1, "", "RxnMappingFlow"]], "rxnutils.data.mapping_pipeline.RxnMappingFlow": [[8, 6, 1, "", "data_prefix"], [8, 4, 1, "", "do_mapping"], [8, 4, 1, "", "end"], [8, 4, 1, "", "join_mapping"], [8, 4, 1, "", "start"]], "rxnutils.data.ord": [[9, 0, 0, "-", "import_ord_dataset"], [9, 0, 0, "-", "preparation_pipeline"]], "rxnutils.data.ord.import_ord_dataset": [[9, 1, 1, "", "main"]], "rxnutils.data.ord.preparation_pipeline": [[9, 2, 1, "", "OrdDataPreparationFlow"]], "rxnutils.data.ord.preparation_pipeline.OrdDataPreparationFlow": [[9, 6, 1, "", "data_prefix"], [9, 4, 1, "", "do_cleaning"], [9, 4, 1, "", "end"], [9, 4, 1, "", "join_cleaning"], [9, 6, 1, "", "ord_data"], [9, 4, 1, "", "setup_cleaning"], [9, 4, 1, "", "start"]], "rxnutils.data.uspto": [[10, 0, 0, "-", "combine"], [10, 0, 0, "-", "download"], [10, 0, 0, "-", "preparation_pipeline"], [10, 0, 0, "-", "uspto_yield"]], "rxnutils.data.uspto.combine": [[10, 1, 1, "", "main"]], "rxnutils.data.uspto.download": [[10, 1, 1, "", "main"]], "rxnutils.data.uspto.preparation_pipeline": [[10, 2, 1, "", "UsptoDataPreparationFlow"]], "rxnutils.data.uspto.preparation_pipeline.UsptoDataPreparationFlow": [[10, 4, 1, "", "combine_files"], [10, 6, 1, "", "data_prefix"], [10, 4, 1, "", "do_cleaning"], [10, 4, 1, "", "end"], [10, 4, 1, "", "join_cleaning"], [10, 4, 1, "", "setup_cleaning"], [10, 4, 1, "", "start"]], "rxnutils.data.uspto.uspto_yield": [[10, 2, 1, "", "UsptoYieldCuration"]], "rxnutils.data.uspto.uspto_yield.UsptoYieldCuration": [[10, 6, 1, "", "calc_yield_column"], [10, 6, 1, "", "out_column"], [10, 6, 1, "", "text_yield_column"]], "rxnutils.pipeline": [[12, 0, 0, "-", "actions"], [11, 0, 0, "-", "base"], [11, 0, 0, "-", "runner"]], "rxnutils.pipeline.actions": [[12, 0, 0, "-", "dataframe_mod"], [12, 0, 0, "-", "reaction_mod"], [12, 0, 0, "-", "reaction_props"], [12, 0, 0, "-", "templates"]], "rxnutils.pipeline.actions.dataframe_mod": [[12, 2, 1, "", "DropColumns"], [12, 2, 1, "", "DropDuplicates"], [12, 2, 1, "", "DropRows"], [12, 2, 1, "", "KeepColumns"], [12, 2, 1, "", "QueryDataframe"], [12, 2, 1, "", "RenameColumns"], [12, 2, 1, "", "StackColumns"], [12, 2, 1, "", "StackMultiColumns"]], "rxnutils.pipeline.actions.dataframe_mod.DropColumns": [[12, 6, 1, "", "columns"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.dataframe_mod.DropDuplicates": [[12, 6, 1, "", "key_columns"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.dataframe_mod.DropRows": [[12, 6, 1, "", "indicator_columns"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.dataframe_mod.KeepColumns": [[12, 6, 1, "", "columns"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.dataframe_mod.QueryDataframe": [[12, 6, 1, "", "pretty_name"], [12, 6, 1, "", "query"]], "rxnutils.pipeline.actions.dataframe_mod.RenameColumns": [[12, 6, 1, "", "in_columns"], [12, 6, 1, "", "out_columns"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.dataframe_mod.StackColumns": [[12, 6, 1, "", "in_columns"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.dataframe_mod.StackMultiColumns": [[12, 6, 1, "", "pretty_name"], [12, 6, 1, "", "stack_columns"], [12, 6, 1, "", "target_columns"]], "rxnutils.pipeline.actions.reaction_mod": [[12, 2, 1, "", "AtomMapTagDisconnectionSite"], [12, 2, 1, "", "ConvertAtomMapDisconnectionTag"], [12, 2, 1, "", "DesaltMolecules"], [12, 2, 1, "", "InvertStereo"], [12, 2, 1, "", "IsotopeInfo"], [12, 2, 1, "", "NameRxn"], [12, 2, 1, "", "NeutralizeMolecules"], [12, 2, 1, "", "RDKitRxnRoles"], [12, 2, 1, "", "ReactantsToReagents"], [12, 2, 1, "", "ReagentsToReactants"], [12, 2, 1, "", "RemoveAtomMapping"], [12, 2, 1, "", "RemoveExtraAtomMapping"], [12, 2, 1, "", "RemoveStereoInfo"], [12, 2, 1, "", "RemoveUnchangedProducts"], [12, 2, 1, "", "RemoveUnsanitizable"], [12, 2, 1, "", "RxnMapper"], [12, 2, 1, "", "SplitReaction"], [12, 2, 1, "", "TrimRxnSmiles"]], "rxnutils.pipeline.actions.reaction_mod.AtomMapTagDisconnectionSite": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.ConvertAtomMapDisconnectionTag": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column_reconstructed"], [12, 6, 1, "", "out_column_tagged"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.DesaltMolecules": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "keep_something"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.InvertStereo": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.IsotopeInfo": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "isotope_column"], [12, 6, 1, "", "match_regex"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"], [12, 6, 1, "", "sub_regex"]], "rxnutils.pipeline.actions.reaction_mod.NameRxn": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "nm_rxn_column"], [12, 6, 1, "", "nmc_column"], [12, 6, 1, "", "options"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.NeutralizeMolecules": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.RDKitRxnRoles": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.ReactantsToReagents": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.ReagentsToReactants": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.RemoveAtomMapping": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.RemoveExtraAtomMapping": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.RemoveStereoInfo": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.RemoveUnchangedProducts": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.RemoveUnsanitizable": [[12, 6, 1, "", "bad_column"], [12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.RxnMapper": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"], [12, 6, 1, "", "rxnmapper_command"]], "rxnutils.pipeline.actions.reaction_mod.SplitReaction": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_columns"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_mod.TrimRxnSmiles": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"], [12, 6, 1, "", "smiles_column_index"]], "rxnutils.pipeline.actions.reaction_props": [[12, 2, 1, "", "CgrCreated"], [12, 2, 1, "", "CgrNumberOfDynamicBonds"], [12, 2, 1, "", "CountComponents"], [12, 2, 1, "", "CountElements"], [12, 2, 1, "", "HasStereoInfo"], [12, 2, 1, "", "HasUnmappedRadicalAtom"], [12, 2, 1, "", "HasUnsanitizableReactants"], [12, 2, 1, "", "MaxRingNumber"], [12, 2, 1, "", "ProductAtomMappingStats"], [12, 2, 1, "", "ProductSize"], [12, 2, 1, "", "PseudoReactionHash"], [12, 2, 1, "", "PseudoSmilesHash"], [12, 2, 1, "", "ReactantProductAtomBalance"], [12, 2, 1, "", "ReactantSize"], [12, 2, 1, "", "RingBondMade"], [12, 2, 1, "", "RingMadeSize"], [12, 2, 1, "", "RingNumberChange"], [12, 2, 1, "", "SmilesLength"], [12, 2, 1, "", "SmilesSanitizable"], [12, 2, 1, "", "StereoCenterInReactantPotential"], [12, 2, 1, "", "StereoCenterIsCreated"], [12, 2, 1, "", "StereoCenterIsRemoved"], [12, 2, 1, "", "StereoCenterOutsideReaction"], [12, 2, 1, "", "StereoCentreChanges"], [12, 2, 1, "", "StereoHasChiralReagent"], [12, 2, 1, "", "StereoInvention"], [12, 2, 1, "", "StereoMesoProduct"]], "rxnutils.pipeline.actions.reaction_props.CgrCreated": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.CgrNumberOfDynamicBonds": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.CountComponents": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "nmapped_products_column"], [12, 6, 1, "", "nmapped_reactants_column"], [12, 6, 1, "", "nmapped_reagents_column"], [12, 6, 1, "", "nproducts_column"], [12, 6, 1, "", "nreactants_column"], [12, 6, 1, "", "nreagents_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.CountElements": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.HasStereoInfo": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.HasUnmappedRadicalAtom": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.HasUnsanitizableReactants": [[12, 6, 1, "", "bad_columns"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"], [12, 6, 1, "", "rsmi_column"]], "rxnutils.pipeline.actions.reaction_props.MaxRingNumber": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.ProductAtomMappingStats": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "pretty_name"], [12, 6, 1, "", "unmapped_column"], [12, 6, 1, "", "widow_column"]], "rxnutils.pipeline.actions.reaction_props.ProductSize": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.PseudoReactionHash": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "no_reagents"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.PseudoSmilesHash": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.ReactantProductAtomBalance": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.ReactantSize": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.RingBondMade": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.RingMadeSize": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.RingNumberChange": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.SmilesLength": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.SmilesSanitizable": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.StereoCenterInReactantPotential": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.StereoCenterIsCreated": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.StereoCenterIsRemoved": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.StereoCenterOutsideReaction": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.StereoCentreChanges": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"], [12, 6, 1, "", "stereo_changes_column"]], "rxnutils.pipeline.actions.reaction_props.StereoHasChiralReagent": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.StereoInvention": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.reaction_props.StereoMesoProduct": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "out_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.templates": [[12, 2, 1, "", "CountTemplateComponents"], [12, 2, 1, "", "RetroTemplateReproduction"]], "rxnutils.pipeline.actions.templates.CountTemplateComponents": [[12, 6, 1, "", "in_column"], [12, 6, 1, "", "nproducts_column"], [12, 6, 1, "", "nreactants_column"], [12, 6, 1, "", "nreagents_column"], [12, 6, 1, "", "pretty_name"]], "rxnutils.pipeline.actions.templates.RetroTemplateReproduction": [[12, 6, 1, "", "expected_reactants_column"], [12, 6, 1, "", "noutcomes_column"], [12, 6, 1, "", "other_reactants_column"], [12, 6, 1, "", "pretty_name"], [12, 6, 1, "", "smiles_column"], [12, 6, 1, "", "template_column"]], "rxnutils.pipeline.base": [[11, 2, 1, "", "ReactionActionMixIn"], [11, 1, 1, "", "action"], [11, 1, 1, "", "create_action"], [11, 1, 1, "", "list_actions"]], "rxnutils.pipeline.base.ReactionActionMixIn": [[11, 4, 1, "", "join_lists"], [11, 4, 1, "", "join_smiles"], [11, 4, 1, "", "split_lists"], [11, 4, 1, "", "split_smiles"]], "rxnutils.pipeline.runner": [[11, 1, 1, "", "main"], [11, 1, 1, "", "run_pipeline"]], "rxnutils.routes": [[13, 0, 0, "-", "base"], [13, 0, 0, "-", "comparison"], [13, 0, 0, "-", "image"], [13, 0, 0, "-", "readers"], [14, 0, 0, "-", "retro_bleu"], [13, 0, 0, "-", "scoring"], [15, 0, 0, "-", "ted"], [16, 0, 0, "-", "utils"]], "rxnutils.routes.base": [[13, 2, 1, "", "SynthesisRoute"], [13, 1, 1, "", "smiles2inchikey"]], "rxnutils.routes.base.SynthesisRoute": [[13, 4, 1, "", "assign_atom_mapping"], [13, 4, 1, "", "atom_mapped_reaction_smiles"], [13, 4, 1, "", "chains"], [13, 4, 1, "", "image"], [13, 4, 1, "", "is_solved"], [13, 4, 1, "", "leaves"], [13, 3, 1, "", "mapped_root_smiles"], [13, 3, 1, "", "nsteps"], [13, 4, 1, "", "reaction_data"], [13, 4, 1, "", "reaction_ngrams"], [13, 4, 1, "", "reaction_smiles"], [13, 4, 1, "", "remap"]], "rxnutils.routes.comparison": [[13, 1, 1, "", "atom_matching_bonanza_similarity"], [13, 1, 1, "", "route_distances_calculator"], [13, 1, 1, "", "simple_bond_forming_similarity"], [13, 1, 1, "", "simple_route_similarity"]], "rxnutils.routes.image": [[13, 2, 1, "", "RouteImageFactory"], [13, 1, 1, "", "crop_image"], [13, 1, 1, "", "draw_rounded_rectangle"], [13, 1, 1, "", "molecule_to_image"], [13, 1, 1, "", "molecules_to_images"]], "rxnutils.routes.readers": [[13, 1, 1, "", "reactions2route"], [13, 1, 1, "", "read_aizynthcli_dataframe"], [13, 1, 1, "", "read_rdf_file"], [13, 1, 1, "", "read_reaction_lists"], [13, 1, 1, "", "read_reactions_dataframe"]], "rxnutils.routes.retro_bleu": [[14, 0, 0, "-", "ngram_collection"], [14, 0, 0, "-", "scoring"]], "rxnutils.routes.retro_bleu.ngram_collection": [[14, 2, 1, "", "NgramCollection"]], "rxnutils.routes.retro_bleu.ngram_collection.NgramCollection": [[14, 4, 1, "", "from_file"], [14, 4, 1, "", "from_tree_collection"], [14, 6, 1, "", "metadata_key"], [14, 6, 1, "", "ngrams"], [14, 6, 1, "", "nitems"], [14, 4, 1, "", "save_to_file"]], "rxnutils.routes.retro_bleu.scoring": [[14, 1, 1, "", "ngram_overlap_score"], [14, 1, 1, "", "retro_bleu_score"]], "rxnutils.routes.scoring": [[13, 1, 1, "", "badowski_route_score"], [13, 1, 1, "", "route_ranks"], [13, 1, 1, "", "route_sorter"]], "rxnutils.routes.ted": [[15, 0, 0, "-", "distances_calculator"], [15, 0, 0, "-", "reactiontree"], [15, 0, 0, "-", "utils"]], "rxnutils.routes.ted.distances_calculator": [[15, 1, 1, "", "ted_distances_calculator"]], "rxnutils.routes.ted.reactiontree": [[15, 2, 1, "", "ReactionTreeWrapper"]], "rxnutils.routes.ted.reactiontree.ReactionTreeWrapper": [[15, 4, 1, "", "distance_iter"], [15, 4, 1, "", "distance_to"], [15, 4, 1, "", "distance_to_with_sorting"], [15, 3, 1, "", "first_tree"], [15, 3, 1, "", "info"], [15, 3, 1, "", "trees"]], "rxnutils.routes.ted.utils": [[15, 2, 1, "", "AptedConfig"], [15, 2, 1, "", "StandardFingerprintFactory"], [15, 2, 1, "", "TreeContent"]], "rxnutils.routes.ted.utils.AptedConfig": [[15, 4, 1, "", "children"], [15, 4, 1, "", "rename"]], "rxnutils.routes.ted.utils.TreeContent": [[15, 6, 1, "", "BOTH"], [15, 6, 1, "", "MOLECULES"], [15, 6, 1, "", "REACTIONS"]], "rxnutils.routes.utils": [[16, 0, 0, "-", "validation"]], "rxnutils.routes.utils.validation": [[16, 2, 1, "", "MoleculeNode"], [16, 2, 1, "", "ReactionNode"], [16, 1, 1, "", "validate_dict"]], "rxnutils.routes.utils.validation.MoleculeNode": [[16, 6, 1, "", "children"], [16, 6, 1, "", "model_computed_fields"], [16, 6, 1, "", "model_config"], [16, 6, 1, "", "model_fields"], [16, 6, 1, "", "smiles"], [16, 6, 1, "", "type"]], "rxnutils.routes.utils.validation.ReactionNode": [[16, 6, 1, "", "children"], [16, 6, 1, "", "model_computed_fields"], [16, 6, 1, "", "model_config"], [16, 6, 1, "", "model_fields"], [16, 6, 1, "", "type"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"], "2": ["py", "class", "Python class"], "3": ["py", "property", "Python property"], "4": ["py", "method", "Python method"], "5": ["py", "exception", "Python exception"], "6": ["py", "attribute", "Python attribute"]}, "objtypes": {"0": "py:module", "1": "py:function", "2": "py:class", "3": "py:property", "4": "py:method", "5": "py:exception", "6": "py:attribute"}, "terms": {"": [3, 6, 7, 12, 17], "0": [2, 3, 4, 6, 12, 13, 17, 18], "03": [2, 18], "0x7fe4e9488d90": 17, "1": [2, 3, 4, 6, 12, 13, 16, 17, 18], "10": [13, 14], "100": 13, "1024": [6, 17], "1039": 14, "1976_sep2016_usptogrants_smil": 18, "2": [3, 6, 13, 14, 15, 17], "20": [13, 15], "200": [2, 3, 18], "2001_sep2016_usptoapplications_smil": 18, "2019": [13, 17], "2020": [2, 18], "2024": 14, "2048": 15, "3": [2, 3, 6, 13, 14, 17, 18], "300": 13, "4": 17, "4640": 13, "482": 14, "4cb9be0738a3a84e7ed4fb661d2efb73c099fc7d6c532a4b294c8d0d": 17, "5": [6, 17], "5b2ff2a69fb7bd6a032938e468684773bcc668928b037bbec0ac8335": 17, "6": [2, 17, 18], "7": 17, "8": [2, 13, 17, 18], "9": [12, 17], "90": 14, "A": [12, 13, 16, 17], "As": 12, "By": 13, "For": [0, 4, 12], "If": [3, 4, 6, 15], "It": [2, 10, 13, 15, 18], "No": 12, "On": [2, 18], "The": [0, 2, 3, 4, 6, 8, 11, 13, 15, 17, 18], "Then": 0, "There": [4, 15], "These": 17, "To": [3, 13, 17], "Will": [6, 12, 13], "_": [3, 8, 9, 10], "__call__": 3, "__fields__": 16, "__str__": 3, "_row_act": 3, "a1727cc9ed68a6411bfd02873c1615c22baa1af4957f14ae942e2c85caf9adb5": 17, "abl": [2, 18], "about": [3, 15, 16], "abov": 17, "absolut": 6, "accord": [2, 12, 14, 18], "account": 6, "accur": 13, "action": [0, 5, 10, 11], "activ": [0, 2, 18], "actual": [3, 6], "actuali": 6, "ad": [3, 13], "add": [4, 6, 10, 13], "addit": [0, 6, 13, 17], "after": [2, 3, 11, 12, 18], "agent": [6, 17], "agents_list": [5, 6, 17], "aizynthcli": [4, 13], "aizynthfind": [13, 16], "al": [13, 17], "algorithm": 12, "alia": 7, "all": [2, 3, 6, 11, 12, 13, 15, 18], "also": [4, 6, 13], "altern": 3, "among": 6, "an": [4, 6, 7, 8, 9, 10, 11, 13, 14, 15, 17], "analys": 4, "analysi": 14, "analyz": [0, 13], "ani": [2, 8, 11, 12, 13, 15, 16, 18], "annot": 16, "anoth": [6, 15], "api": [0, 7], "appear": 6, "appli": [5, 6, 11, 15, 17], "applic": 7, "appropri": [7, 12, 13], "apt": 15, "aptedconfig": [13, 15], "ar": [0, 2, 3, 4, 6, 8, 11, 12, 13, 15, 17, 18], "arc_siz": 13, "arg": [10, 11], "argument": [3, 11, 13, 17], "arithmet": 12, "aromat": 6, "around": [6, 13], "arrai": [6, 17], "as_smil": 6, "assign": [3, 12, 13], "assign_atom_map": [4, 5, 13], "atom": [2, 3, 4, 5, 6, 8, 12, 13, 17, 18], "atom_invari": [5, 6], "atom_map_tag_disconnection_sit": 12, "atom_mapped_reaction_smil": [5, 13], "atom_mapping_numb": [5, 6], "atom_matching_bonanza_similar": [5, 13], "atom_properti": [5, 6], "atombal": 12, "atomidx": 6, "atommaptagdisconnectionsit": [11, 12], "attribut": [11, 13], "augment": [1, 5, 13], "auto": 0, "automat": 13, "avail": [0, 2, 3, 4, 11, 18], "averag": 13, "average_yield": 13, "awai": 6, "axi": 3, "b": 13, "bad_column": [11, 12], "badmolecul": [2, 12, 18], "badowski": 13, "badowski_route_scor": [5, 13], "balanc": 12, "base": [1, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17], "base_pipelin": [1, 5], "basemodel": 16, "batch": [8, 9, 10], "batch_util": [1, 5], "bauer": 6, "becaus": [2, 17, 18], "been": [13, 15, 17], "befor": 12, "being": 13, "belong": 6, "below": 15, "between": [6, 13, 15], "bit": [6, 17], "bleu": 14, "blob": 6, "block": [2, 18], "bonanza": 13, "bond": [6, 12, 13], "bonds_broken": [5, 6], "bonds_chang": [5, 6], "bonds_form": [5, 6], "bool": [6, 11, 12, 13, 15], "boolean": [12, 13], "both": [13, 15], "bottom": 15, "br": 17, "bracket": 6, "branch": 13, "brc1ccoc1": 4, "broken": 6, "build": [0, 13], "c": [2, 4, 13, 17, 18], "calc_yield_column": [8, 10], "calcul": [6, 12, 13, 14, 15], "calculatedyield": 10, "call": [3, 4, 11, 12, 13], "callabl": [11, 13, 15], "can": [2, 3, 4, 6, 11, 12, 13, 14, 15, 17, 18], "cannot": 13, "canon": [6, 17], "canonic": 6, "canonical_templ": [5, 6], "canonical_template_generate_outcom": [5, 6], "capabl": [0, 3, 17], "care": 6, "carri": 6, "case": [3, 6, 13], "caus": 6, "cc": [4, 17], "ccn": 17, "ccocc": 17, "center": [6, 12], "centr": [6, 12], "cgr": [1, 5, 12], "cgr_contain": 6, "cgr_creat": 12, "cgr_dynamic_bond": 12, "cgrcreat": [11, 12], "cgrnumberofdynamicbond": [11, 12], "cgrtool": 6, "ch2": 17, "ch3": 17, "chain": [5, 13], "chang": [6, 12], "charg": 6, "check": [6, 7, 12, 16], "chem": [0, 1, 3, 5, 13, 17], "chemic": [6, 14], "chemicalreact": [5, 6, 17], "chemistri": 0, "chemreact": 6, "child": 15, "children": [13, 15, 16], "chiral": 6, "christoph": 6, "cl": [4, 12, 17], "class": [3, 4, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16], "classif": [4, 6, 12, 13], "classifi": 13, "classmethod": 14, "classvar": [3, 12, 16], "clc1cccc": 4, "clean": [0, 2, 3, 6, 8, 9, 10, 18], "clean_pipelin": 3, "clean_smil": 6, "clone": [0, 2], "code": [4, 6, 10, 17], "collect": [0, 12, 13, 14], "color": 13, "column": [2, 3, 4, 10, 11, 12, 13, 18], "column1": 12, "column1_renam": 12, "column2": 12, "column2_renam": 12, "com": [2, 6, 10, 18], "combin": [5, 8, 9, 18], "combine_batch": [5, 8], "combine_csv_batch": [5, 8], "combine_fil": [8, 10], "combine_func": 8, "combine_sparse_matrix_batch": [5, 8], "command": [0, 2, 3, 4, 7, 8, 9, 10, 11, 18], "commit": 0, "common": 0, "comp_degre": 6, "compar": [6, 12, 13, 15], "comparison": [1, 5, 6, 12], "complet": [2, 11, 18], "complex": [6, 13], "complexity_func": 13, "compon": [6, 11, 12], "compos": 6, "compound": [12, 13], "comput": [3, 6, 12, 13, 15, 16, 17], "computedfieldinfo": 16, "concaten": [11, 18], "conda": [0, 2, 12, 18], "condens": 6, "condensedgraphreact": [5, 6], "confid": [2, 18], "config": [15, 16], "configdict": 16, "configur": 16, "conform": [12, 16], "conlist": 16, "connect": 6, "connorcolei": 6, "consid": [6, 12, 15], "consist": 13, "constant": 13, "conta": 11, "contain": [2, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], "content": 1, "contrib": 0, "control": 12, "converg": 13, "convert": [12, 13], "convert_atom_map_disconnection_tag": 12, "convertatommapdisconnectiontag": [11, 12], "convini": 13, "copi": 6, "corner": 13, "correspond": [2, 16, 18], "cost": [13, 15], "could": 10, "count": [3, 6, 8, 12], "count_compon": 12, "count_el": 12, "count_template_compon": 12, "countcompon": [11, 12], "countel": [11, 12], "counttemplatecompon": [11, 12], "coupl": [2, 18], "cpp": 6, "cpu": [2, 18], "creat": [0, 2, 6, 8, 10, 11, 12, 13, 14, 15, 17, 18], "create_act": [5, 11], "create_csv_batch": [5, 8], "criterion": 6, "crop": 13, "crop_imag": [5, 13], "csv": [2, 3, 8, 9, 11, 18], "curat": [10, 17], "curatedyield": 10, "current": [0, 3], "custom": 6, "d": 13, "d1": 17, "d2": 17, "d3dd00219e": 14, "d4": 17, "data": [0, 1, 2, 3, 4, 5, 6, 11, 12, 13, 16, 18], "data_prefix": [5, 8, 9, 10], "databas": [0, 6, 9], "databaseflow": [5, 8], "dataclass": 3, "datafram": [3, 4, 6, 8, 11, 12, 13], "dataframe_mod": [3, 5, 11], "dataframe_prop": 3, "datapreparationbaseflow": [5, 8, 9, 10], "dataset": [2, 8, 9, 11], "date": 2, "daylightpars": 6, "deal": 15, "decor": [3, 11], "def": 3, "default": [3, 6, 8, 13, 15, 16], "defin": [3, 11, 13, 15, 16], "degre": 6, "dep": [2, 18], "depend": [0, 2, 15, 18], "depict": 13, "depth": 13, "desalt": [6, 12], "desalt_molecul": [5, 6, 12], "desaltmolecul": [11, 12], "descript": 12, "design": [2, 18], "destin": 15, "determin": [6, 12, 15], "dev": 0, "develop": 0, "dict": [6, 11, 13, 15, 16], "dict_": 16, "dictionari": [6, 13, 15, 16], "did": 0, "differ": [3, 4, 6, 12, 13, 15], "digit": 14, "direct": 6, "disc": 8, "discard": 13, "disconnect": 12, "discoveri": 14, "disregard": 13, "dist_func": 15, "distanc": [6, 13, 15], "distance_it": [13, 15], "distance_to": [5, 6, 13, 15], "distance_to_with_sort": [13, 15], "distances_calcul": [5, 13], "distinct": 6, "divid": [0, 2, 18], "do": [4, 6, 7, 8, 9, 10, 12, 15], "do_clean": [8, 9, 10], "do_map": [5, 8], "docminu": 10, "doesn": 12, "doi": 14, "don": 3, "done": [2, 6, 18], "down": 2, "download": [2, 5, 7, 8, 18], "download_rinchi": [5, 6], "draw": [6, 13], "draw_kwarg": 13, "draw_rounded_rectangl": [5, 13], "drop": 12, "drop_column": 12, "drop_dupl": 12, "drop_row": 12, "dropcolumn": [11, 12], "dropdupl": [11, 12], "droprow": [11, 12], "due": 6, "duplic": 12, "dure": 12, "dynam": 12, "e": [3, 6, 13, 15], "each": [3, 4, 6, 13, 14, 15, 18], "easi": 12, "easili": 3, "edit": [0, 15], "either": [12, 17], "element": 12, "elementcount": 12, "els": [3, 6, 13], "empti": [6, 13], "enabl": 12, "encapsul": [13, 17], "encapuls": 17, "end": [2, 5, 6, 8, 9, 10, 18], "enivron": 6, "ensur": 13, "enum": 15, "enumer": 15, "env": [0, 2, 4, 18], "environ": [0, 2, 4, 6, 8, 9, 10, 18], "eq": 14, "equal": 6, "error": 7, "et": [13, 17], "etc": 6, "everi": 0, "exampl": [6, 12, 13], "except": [6, 7, 13, 15], "exclam": 12, "execut": [0, 2, 3, 7, 18], "exemplifi": 3, "exhaustive_limit": 15, "exist": [2, 13, 18], "expand_hetero": 6, "expand_r": 6, "expect": 17, "expected_reactants_column": [11, 12], "expens": 6, "experi": 2, "explicit": 6, "extend": [2, 6, 18], "extra": [6, 12, 13], "extract": [0, 6, 9, 13, 14], "f": [0, 3], "factor": 17, "factori": [13, 15], "factory_kwarg": 13, "fail": 6, "fals": [6, 8, 9, 11, 12, 13, 15, 16], "fang": 14, "field": 16, "fieldinfo": 16, "figshar": [10, 18], "file": [2, 3, 4, 8, 9, 10, 11, 12, 13, 14, 18], "filenam": [8, 11, 13, 14], "filter": [2, 6, 18], "final": [8, 9, 10, 11], "find": [3, 13], "finger": 6, "fingerprint": [6, 15, 17], "fingerprint_bit": [5, 6], "fingerprint_vector": [5, 6, 17], "first": [0, 2, 3, 4, 6, 13, 15, 17], "first_tre": [13, 15], "fix": 6, "fix_atom_properti": [5, 6], "flag": [2, 6, 12, 18], "float": [6, 13, 14, 15], "flowspec": 8, "folder": [0, 2, 5, 7, 8, 18], "follow": [0, 2, 3, 4, 13, 18], "form": [6, 8, 12, 13], "formal": 6, "format": [4, 13], "forward": [6, 13, 17], "found": 6, "four": 3, "fp_factori": 15, "fraction": [6, 14], "fragment": 6, "frame": 13, "frame_color": 13, "framecolor": 13, "framework": [3, 11], "from": [2, 3, 4, 6, 7, 8, 10, 12, 13, 14, 15, 16, 17, 18], "from_fil": [13, 14], "from_tree_collect": [13, 14], "full": [2, 18], "fulli": 15, "function": [6, 8, 9, 10, 11, 13, 15], "further": 13, "fuzzi": 6, "g": [3, 6, 12], "gener": [0, 6, 7, 17], "generate_coreag": [5, 6], "generate_reaction_templ": [5, 6, 17], "generate_rinchi": [6, 7], "geometr": 13, "get_special_group": [5, 6], "getnumheavyatom": 3, "git": [0, 2], "github": [2, 6, 10, 18], "give": 6, "given": [2, 3, 6, 11, 13, 14, 15], "global": 3, "global_appli": 3, "gpu": [2, 18], "gram": [13, 14], "graph": 6, "graphmol": 6, "green": 13, "greg": 6, "group": [6, 13], "group_bi": [4, 13], "groupabl": 13, "guang": 14, "guarante": 15, "guard": 6, "guid": 0, "h0": 17, "ha": [3, 4, 6, 12, 13, 15], "handl": [0, 6], "hang": 6, "has_atom_map": [5, 6], "has_partial_map": [5, 6], "has_stereo": 12, "has_stereo_info": 12, "haschiralreag": 12, "hash": [6, 12, 17], "hash_from_bit": [5, 6, 17], "hash_from_smart": [5, 6, 17], "hash_from_smil": [5, 6, 17], "hashed_rid": [5, 6], "hashkei": 6, "hasstereo": 12, "hasstereochang": 12, "hasstereoinfo": [11, 12], "hasunmappedradicalatom": [11, 12], "hasunsanitizablereact": [11, 12], "have": [2, 3, 4, 11, 13, 17, 18], "hcl": 12, "heavi": 3, "helper": 15, "here": [2, 10], "hetero": 6, "heurist": 15, "hidden": 13, "hold": [4, 13], "home": [4, 12], "hour": [2, 18], "how": 15, "http": [2, 6, 10, 14, 18], "hydrogen": 6, "hyperparamet": 14, "i": [0, 2, 3, 4, 6, 7, 12, 13, 15, 16, 17, 18], "id": [2, 6, 10, 12, 18], "id_": 6, "ideal_step": 14, "ident": 17, "identifi": [3, 4, 13], "ignor": [2, 6, 18], "ignore_stereo": 13, "imag": [1, 5], "img": 13, "implement": [3, 6, 15], "impli": [12, 17], "import": [2, 3, 4, 6, 9, 17], "import_ord_dataset": [5, 8], "in_column": [3, 11, 12], "in_column_tag": 12, "in_column_untag": 12, "in_stock": 13, "in_stock_color": 13, "inchi": [6, 7, 12, 13], "includ": [0, 6, 15], "incompat": [2, 18], "index": [8, 10, 13, 18], "indic": [8, 12], "indicator_column": [11, 12], "individu": [4, 6], "info": [12, 13, 15], "inform": [2, 3, 8, 9, 10, 12, 15, 18], "initi": 6, "initial": 13, "input": [3, 16], "input_arg": [8, 9], "inspect": 17, "inspir": [6, 10], "instal": [2, 4, 8, 9, 10, 18], "instanc": 4, "instansi": 6, "instanti": 11, "instruct": [2, 18], "int": [6, 8, 12, 13, 14, 15], "interfac": 11, "intermedi": 11, "intern": 15, "interpret": 6, "intra": 6, "invari": 6, "invert": 12, "invert_stereo": 12, "invertstereo": [11, 12], "investig": 13, "invok": 3, "is_complet": [5, 6], "is_fuzzi": [5, 6], "is_sanitiz": 12, "is_sanitizable2": 12, "is_smart": 6, "is_solv": [5, 13], "isaromat": 6, "isotop": 12, "isotope_column": [11, 12], "isotope_info": 12, "isotopeinfo": [11, 12], "item": 17, "iter": [6, 15], "jaccard": 15, "jian": 14, "join": [6, 8, 11], "join_clean": [8, 9, 10], "join_list": [5, 11], "join_map": [5, 8], "join_smil": [5, 11], "join_smiles_from_react": [5, 6], "json": 14, "junren": 14, "just": [8, 9, 10, 13], "keep": [6, 12], "keep_column": 12, "keep_someth": [6, 11, 12], "keepcolumn": [11, 12], "kei": [6, 12, 13, 14], "kept": 13, "key_column": [11, 12], "keyword": 13, "kwarg": [8, 9, 11, 13], "label": 15, "landrum": 6, "last": [2, 3, 4, 18], "lastli": [0, 3], "leaf": 13, "least": 6, "leav": [5, 13], "left": 0, "lei": 14, "len": 16, "length": [6, 12, 13, 14, 15], "let": [3, 17], "level": 13, "li": 14, "librari": [3, 6], "like": [0, 3, 4, 16], "limit": 15, "line": [4, 7, 8, 9, 10, 11, 13], "linear": 13, "list": [3, 6, 8, 11, 12, 13, 14, 15, 16, 17], "list_act": [5, 11], "ll": 13, "long": 6, "longer": 15, "longest": 13, "look": 3, "lou": 14, "lower": 6, "m": [2, 3, 14, 18], "maco": 0, "made": 12, "main": [3, 5, 6, 7, 8, 9, 10, 11], "make": [0, 4, 8, 10, 13, 14], "manipul": 0, "map": [1, 2, 4, 5, 6, 12, 13, 16, 17, 18], "mapped_root_smil": [5, 13], "mapped_rxn": [2, 18], "mapper": [2, 18], "mapping_pipelin": [1, 2, 5, 18], "margin": 13, "mark": [12, 13], "mass": [6, 12], "master": [6, 8], "match": [3, 6, 13], "match_regex": [11, 12], "materi": 13, "matrix": [8, 13, 15], "max": [2, 18], "max_depth": 13, "max_length": 16, "maximum": [2, 12, 18], "maxr": 12, "maxringnumb": [11, 12], "mean": [6, 13], "menu": 0, "meso": 12, "meso_product": 12, "mesoproduct": 12, "metadata": [13, 14, 16], "metadata_column": [4, 13], "metadata_kei": [13, 14], "metaflow": [2, 8, 9, 18], "method": [3, 6, 13, 15], "metric": 13, "might": [3, 6], "min_length": 16, "miniconda": 4, "minimum": 15, "mismatch": 6, "mixin": 11, "mode": 0, "model": [2, 13, 16, 18], "model_computed_field": [13, 16], "model_config": [13, 16], "model_field": [13, 16], "modifi": [0, 3, 6, 12], "modul": [1, 3], "mol": [6, 13, 16], "mol1": 6, "mol2": 6, "mol_cost": 13, "mol_draw_kwarg": 13, "mol_siz": 13, "molecul": [2, 6, 12, 13, 15, 16, 17, 18], "molecular": 6, "molecule_to_imag": [5, 13], "moleculenod": [13, 16], "molecules_to_imag": [5, 13], "molfromsmil": 3, "molstogridimag": 13, "more": [2, 6, 13, 18], "morgan": [6, 15, 17], "most": [0, 13, 15], "move": [2, 17, 18], "multipli": 12, "must": 12, "my_mol": 6, "n": [2, 4, 13, 14, 18], "n1": 4, "name": [2, 8, 9, 11, 12, 13, 16], "namedtupl": 7, "namerxn": [4, 11, 12, 13], "namrxn": 12, "nbatch": [2, 5, 8, 18], "nbit": [6, 15, 17], "nc": 4, "nc1cccc": 4, "nc2ccoc2": 4, "ndarrai": [6, 13, 15], "ndynamicbond": 12, "necessari": 6, "need": [2, 3, 8, 9, 10, 11, 13, 18], "neighbour": 6, "neutral": [6, 12], "neutralize_molecul": [5, 6, 12], "neutralizemolecul": [11, 12], "new": [2, 3, 4, 11, 12, 13, 18], "newli": 12, "next": [6, 15], "nextmov": 4, "nextmoverxnsmil": 12, "ngram": [13, 14], "ngram_collect": [5, 13], "ngram_overlap_scor": [13, 14], "ngramcollect": [13, 14], "nice": [3, 11], "nitem": [13, 14], "nline": [5, 8], "nm_rxn_column": [11, 12], "nmapped_products_column": [11, 12], "nmapped_reactants_column": [11, 12], "nmapped_reagents_column": [11, 12], "nmappedproduct": 12, "nmappedreact": 12, "nmappedreag": 12, "nmc": 12, "nmc_column": [11, 12], "no_chang": [5, 6], "no_reag": [11, 12], "node": [13, 15, 16], "node1": 15, "node2": 15, "non": 12, "none": [6, 8, 9, 10, 11, 13, 14, 15, 16], "nonetyp": 16, "notat": 6, "note": 2, "noth": 13, "noutcomes_column": [11, 12], "now": [0, 10, 17], "np": 15, "nproduct": 12, "nproducts_column": [11, 12], "nr": 14, "nreactant": 12, "nreactants_column": [11, 12], "nreagent": 12, "nreagents_column": [11, 12], "nringchang": 12, "nstep": [5, 13], "num": [2, 18], "number": [2, 3, 4, 6, 8, 12, 13, 15, 17, 18], "o": [4, 17], "obj": 11, "object": [4, 6, 10, 11, 12, 13, 14, 15, 16, 17], "obtain": 15, "occbr": 17, "och": 14, "ochem_predict_nn": 6, "oh": 17, "old": 0, "one": [3, 6, 8, 13, 17], "onli": [3, 6, 10, 12, 13, 17], "only_rxnmapp": [4, 13], "open": [0, 9], "oper": 6, "option": [6, 11, 12, 13, 15, 17], "orang": 13, "ord": [2, 5, 8], "ord_data": [2, 8, 9], "ord_data_clean": 2, "ord_data_map": 2, "ord_data_repo_path": 2, "orddatapreparationflow": [8, 9], "order": 15, "org": 14, "origin": [2, 6, 10, 18], "other": [3, 4, 6, 13, 15, 17], "other_reactants_column": [11, 12], "otherwis": 6, "out": [3, 6], "out_column": [3, 8, 10, 11, 12], "out_column_reconstruct": [11, 12], "out_column_tag": [11, 12], "outcom": [2, 6], "output": [3, 4, 11, 13, 14], "output_filenam": 8, "outsid": 12, "over": [6, 15], "overlap": [13, 14], "overwrit": 13, "p": 12, "packag": [0, 1, 2, 17, 18], "pad": 13, "pair": 15, "pairwis": [13, 15], "panda": [3, 6, 11, 12, 13], "paper": 14, "paragraph": 18, "paragraphnum": 10, "param": [6, 13], "paramet": [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "parenthesi": 6, "part": [6, 8, 15], "partial": 13, "partner": 6, "patent": 18, "patentnumb": 10, "path": [2, 4, 7, 8, 11, 13, 14], "pattern": 16, "pd": 3, "penal": 14, "perform": [2, 3, 8, 9, 10, 18], "pilcolor": 13, "pilimag": 13, "pip": [0, 2, 18], "pipelin": [0, 1, 2, 5, 8, 9, 10, 18], "piplin": 0, "plausibl": 14, "plenti": 15, "poetri": 0, "posit": 12, "possibl": [6, 13, 15], "possiblti": 13, "postfix": 3, "potenti": [6, 10, 12], "potential_stereo_cent": 12, "potentialstereocentr": 12, "pre": 0, "precursor": 6, "prefix": [2, 8, 18], "prepar": [2, 8, 18], "preparation_pipelin": [2, 5, 8, 18], "present": [6, 7], "preserv": 10, "pretti": 13, "pretty_nam": [3, 11, 12], "prevent": 0, "print": [3, 8, 9, 10], "probabl": 13, "problem": 6, "procedur": 6, "process": [3, 6, 8, 13], "produc": [6, 12, 13, 17], "product": [2, 3, 6, 11, 12, 13, 15, 18], "product_atom_count": 3, "product_atommapping_stat": 12, "productatommappingstat": [11, 12], "products": [2, 3, 11, 12, 18], "products_atom_map_tag": 12, "products_list": [5, 6, 11], "products_mol": 3, "products_reconstruct": 12, "products_tag": 12, "program": 7, "proper": 13, "properti": [3, 6, 12, 13, 15, 17], "proton": 12, "provid": [2, 3, 6, 13, 17, 18], "pseudo": 6, "pseudo_reaction_hash": 12, "pseudo_rinchi": [5, 6], "pseudo_rinchi_kei": [5, 6], "pseudo_smiles_hash": 12, "pseudohash": 12, "pseudohash_inverted_stereo": 12, "pseudoreactionhash": [11, 12], "pseudosmileshash": [11, 12], "py": [6, 12], "pydant": 16, "pypi": 0, "python": [0, 2, 3, 12, 14, 18], "quantifi": 14, "queri": [3, 11, 12], "query_datafram": [3, 12], "query_dataframe1": 3, "query_dataframe2": 3, "query_dataframe3": 3, "querydatafram": [11, 12], "ractant": 6, "radic": 12, "radiu": [6, 15, 17], "rais": [6, 7, 13, 15], "random": 15, "rank": 13, "raw": [10, 13], "rd_mol": 6, "rdchem": 13, "rdchiral": [6, 17], "rdkit": [0, 2, 6, 12, 18], "rdkit_rxnroleassign": [0, 12], "rdkit_valid": [5, 6], "rdkitrxnrol": [11, 12], "re": [13, 17], "reactant": [2, 6, 11, 12, 13, 17, 18], "reactant_list": 17, "reactantproductatombal": [11, 12], "reactants": [2, 3, 11, 12, 18], "reactants2reag": 12, "reactants_list": [5, 6, 11, 17], "reactantstoreag": [11, 12], "reactent": 6, "reaction": [0, 1, 3, 4, 5, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18], "reaction_centr": [5, 6], "reaction_contain": 6, "reaction_cost": 13, "reaction_data": [5, 13], "reaction_mod": [3, 5, 11], "reaction_ngram": [5, 13], "reaction_prop": [5, 11], "reaction_smil": [4, 5, 7, 13], "reaction_tre": 13, "reaction_util": 12, "reactionactionmixin": [5, 11, 12], "reactionexcept": [5, 6], "reactionnod": [13, 16], "reactions2rout": [5, 13], "reactionsmil": [2, 3, 10, 18], "reactionsmilesclean": [2, 3, 18], "reactiontempl": [5, 6, 17], "reactiontre": [5, 13], "reactiontreewrapp": [13, 15], "read": [8, 13, 14], "read_aizynthcli_datafram": [4, 5, 13], "read_csv_batch": [5, 8], "read_func": 8, "read_rdf_fil": [5, 13], "read_reaction_list": [4, 5, 13], "read_reactions_datafram": [4, 5, 13], "reader": [1, 4, 5], "readi": [2, 18], "readm": [2, 18], "reagent": [2, 6, 11, 12, 13, 18], "reagents2react": [3, 12], "reagents_list": 11, "reagentstoreact": [11, 12], "reason": [2, 18], "reassign": 6, "reassign_rsmi_atom_map": [5, 6], "record": 6, "rectangl": 13, "ref": [13, 14], "refer": [6, 13, 14], "regist": [3, 11], "remap": [4, 5, 13], "remov": [2, 3, 6, 8, 12, 13, 18], "remove_atom_map": [3, 5, 6, 12], "remove_atom_mapping_templ": [5, 6], "remove_extra_atom_map": 12, "remove_stereo_info": 12, "remove_unchanged_product": 12, "remove_unsanitiz": [3, 12], "removeatommap": [11, 12], "removeextraatommap": [11, 12], "removestereoinfo": [11, 12], "removeunchangedproduct": [11, 12], "removeunsanitiz": [11, 12], "renam": [12, 13, 15], "rename_column": 12, "renamecolumn": [11, 12], "replac": [13, 16], "replace_mol_func": 13, "repo": [2, 18], "repositori": [0, 2], "repres": [6, 13, 16], "represent": [6, 13], "reproduc": [2, 18], "reproduct": 12, "requir": [0, 2, 7, 8, 9, 16, 18], "resid": 10, "resiz": 13, "respect": 17, "rest": 12, "result": 11, "retro": [6, 14, 17], "retro_bleu": [5, 13], "retro_bleu_scor": [13, 14], "retro_templ": [5, 6, 17], "retro_template_generate_outcom": [5, 6], "retro_template_reproduct": 12, "retro_template_select": [5, 6], "retrosynthesi": [13, 14], "retrosynthet": 6, "retrotemplatereproduct": [11, 12], "return": [3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], "revers": 6, "rinchi": [0, 5, 6], "rinchi_api": [5, 6], "rinchi_key_long": [5, 6], "rinchi_key_short": [5, 6], "rinchierror": [6, 7], "rinchistructur": [6, 7], "ring": [6, 12], "ringbondmad": [11, 12], "ringmades": [11, 12], "ringnumberchang": [11, 12], "role": 12, "root": [0, 13], "roughli": [2, 18], "round": 13, "rout": [0, 1, 5], "route_distances_calcul": [5, 13], "route_id": 4, "route_rank": [5, 13], "route_sort": [5, 13], "routeimagefactori": [5, 13], "routin": [0, 4, 6, 11, 13, 14, 17], "row": [3, 10, 11, 12, 13, 18], "rsmi": [6, 18], "rsmi_column": [11, 12], "rsmi_inverted_stereo": 12, "rsmi_process": 12, "rule": [6, 15], "run": [0, 2, 3, 8, 9, 10, 11, 12, 14, 18], "run_pipelin": [5, 11], "runner": [1, 3, 5, 12], "rxn": [0, 2, 6, 17, 18], "rxn4chemistri": [2, 18], "rxnatombal": 12, "rxndesalt": 12, "rxnmapper": [2, 4, 8, 11, 12, 13, 18], "rxnmapper_command": [11, 12], "rxnmapper_env_path": [4, 12], "rxnmapperrxnsmil": 12, "rxnmappingflow": [5, 8], "rxnneutral": 12, "rxnnounchangedprod": 12, "rxnroleassign": 12, "rxnsanitiz": 12, "rxnsmile": 12, "rxnsmilesallreact": 12, "rxnsmilesclean": 12, "rxnsmilesinvertedstereo": 12, "rxnsmilesnoatommap": 12, "rxnsmilesnostereo": 12, "rxnsmilesreassignedatommap": 12, "rxnsmileswithoutisotop": 12, "rxnsmileswithtruereag": 12, "rxnutil": [2, 3, 4, 17, 18], "salt": 6, "same": [3, 6, 11], "same_molecul": [5, 6], "sanit": [5, 6], "sanitiz": [2, 12, 18], "sanitization_check": [5, 6], "sanitize_adjusth": 6, "sanitize_al": 6, "sanitize_cleanup": 6, "sanitize_cleanupchir": 6, "sanitize_findrad": 6, "sanitize_kekul": 6, "sanitize_non": 6, "sanitize_properti": 6, "sanitize_setaromat": 6, "sanitize_setconjug": 6, "sanitize_sethybrid": 6, "sanitize_symmr": 6, "save": [3, 4, 11, 14], "save_intermedi": 11, "save_to_fil": [13, 14], "schema": 2, "sci": [13, 17], "score": [1, 4, 5], "scorer": 13, "script": [8, 9, 10], "second": [0, 3, 4, 6, 13], "see": [0, 6, 14, 17], "select": [6, 18], "self": [3, 15], "sen": 10, "sent": 13, "separ": [2, 3, 4, 11, 13, 18], "sequenc": [8, 9, 10, 11, 13, 14, 15], "sequenti": [3, 11], "seri": [3, 11, 13], "set": [2, 4, 6, 13, 14, 17, 18], "setup": [0, 2, 8, 9, 10, 18], "setup_clean": [8, 9, 10], "share": 4, "short": [6, 11], "should": [2, 3, 6, 13, 16, 18], "show": 13, "show_al": 13, "show_atom_map": 13, "show_default": [8, 9], "shuffl": 15, "similar": [6, 13], "simpl": [0, 3, 13, 15, 17], "simple_bond_forming_similar": [5, 13], "simple_route_similar": [5, 13], "simplest": 4, "sinc": [10, 15], "singl": [6, 13], "single_reactant_augment": [5, 6], "site": 12, "size": [2, 3, 12, 13, 18], "skip": 6, "smaller": 12, "smart": [6, 17], "smile": [2, 3, 4, 6, 7, 11, 12, 13, 16, 17, 18], "smiles2inchikei": [5, 13], "smiles_col": 3, "smiles_column": [11, 12, 13], "smiles_column_index": [11, 12], "smiles_length": 12, "smiles_list": [6, 13], "smiles_sanitiz": 12, "smileslength": [11, 12], "smilessanitiz": [11, 12], "so": [2, 7, 13, 18], "softwar": 4, "solv": 13, "some": [0, 6, 9, 10, 12, 17], "someth": 4, "sort": [13, 15], "sort_children": 15, "sourc": [0, 10, 15], "space": 13, "spars": 8, "spec": 12, "special": 6, "specif": [6, 8, 11, 17], "specifi": [3, 6, 8, 12, 13, 17], "split": [2, 3, 6, 8, 11, 12, 18], "split_list": [5, 11], "split_react": 12, "split_smil": [5, 11], "split_smiles_from_react": [5, 6], "splitreact": [11, 12], "squar": [13, 15], "stack": 12, "stack_column": [11, 12], "stack_multi_column": 12, "stackcolumn": [11, 12], "stackedcolumn": 12, "stackmulticolumn": [11, 12], "standard": [3, 6, 11], "standardfingerprintfactori": [13, 15], "start": [5, 6, 8, 9, 10, 13, 17], "statist": [6, 12], "step": [8, 9, 10, 13], "stereo": 12, "stereo_centre_chang": 12, "stereo_centre_cr": 12, "stereo_centre_outsid": 12, "stereo_centre_remov": 12, "stereo_changes_column": [11, 12], "stereo_chiral_reag": 12, "stereo_invent": 12, "stereocenterinreactantpotenti": [11, 12], "stereocenteriscr": [11, 12], "stereocenterisremov": [11, 12], "stereocenteroutsidereact": [11, 12], "stereocentrechang": [11, 12], "stereocentrecr": 12, "stereocentreremov": 12, "stereochang": 12, "stereochemistri": 12, "stereogen": 12, "stereohaschiralreag": [11, 12], "stereoinvent": [11, 12], "stereomesoproduct": [11, 12], "stereooutsid": 12, "stero": 12, "stock": 13, "store": [4, 6, 13], "str": [3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "strdict": 15, "strict": 16, "string": [2, 6, 13, 17, 18], "stringconstraint": 16, "strip_whitespac": 16, "structur": [13, 16], "sub": [0, 13], "sub_regex": [11, 12], "submodul": [1, 5], "subpackag": 1, "subset": 13, "substitut": 15, "substructur": 6, "successfulli": 6, "sum": [2, 18], "support": [0, 4], "sure": [0, 4], "symbol": 12, "synthesi": [0, 4, 13, 14, 15], "synthesisrout": [5, 13, 14, 15], "system": 7, "t": [3, 12], "tab": [2, 3, 11, 18], "tabl": 11, "tag": 12, "take": [2, 3, 6, 13, 15, 18], "taken": [2, 6], "target_column": [11, 12], "target_smil": 4, "task": [0, 2, 3, 18], "technic": 17, "ted": [5, 13], "ted_distances_calcul": [13, 15], "templat": [0, 1, 3, 5, 11, 14], "template_column": [11, 12], "template_extractor": 6, "template_hash": 14, "template_smart": 6, "templategivesnoutcom": 12, "templategivesotherreact": 12, "templategivestruereact": 12, "templatemolecul": [5, 6], "test": 6, "text": 4, "text_yield_column": [8, 10], "textminedyield": 10, "thakkar": 17, "than": [2, 18], "thei": [3, 11, 13, 17], "them": [10, 12, 13, 14, 15], "therefor": [2, 3, 18], "thi": [0, 2, 3, 4, 6, 8, 9, 10, 12, 13, 15, 16, 17, 18], "thoroughli": 13, "three": [0, 3, 8, 15], "through": 14, "throughout": 13, "time": 15, "timeout": 15, "to_low": 16, "to_upp": 16, "togeth": [2, 6, 18], "token": [2, 18], "tool": [8, 9, 10, 12, 13], "top": [12, 15], "total": 6, "total_cent": [5, 6], "train": [2, 18], "transform": [9, 10, 13], "transpar": [2, 18], "tree": [13, 15], "treecont": [13, 15], "trigger": 6, "trim": 12, "trim_rxn_smil": [3, 12], "trimrxnsmil": [11, 12], "true": [4, 6, 8, 9, 10, 11, 12, 13, 15, 16], "trust": 7, "tsv": 3, "tupl": [6, 8, 11, 13, 14, 17], "turn": 12, "tutori": 6, "two": [2, 3, 6, 12, 13, 15, 17, 18], "txt": 4, "type": [3, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16], "typic": 13, "un": [6, 13], "unchang": 12, "under": 12, "unimport": 6, "union": [15, 16], "uniqu": [2, 6, 13, 18], "unmap": 12, "unmapped_column": [11, 12], "unmappedprodatom": 12, "unord": 15, "unsanitiz": 12, "unsanitizablereact": 12, "up": [6, 8, 9, 10, 13], "upon": 13, "upsto": 10, "us": [0, 2, 3, 4, 6, 10, 12, 13, 14, 15, 17, 18], "usag": 0, "use_chir": 6, "use_cli": [8, 9, 10], "user": 0, "usernam": 4, "uspo_data_map": 18, "uspto": [0, 3, 5, 8], "uspto_clean": 3, "uspto_data": [3, 18], "uspto_data_clean": 18, "uspto_data_map": 18, "uspto_yield": [5, 8], "usptodatapreparationflow": [8, 10], "usptoyieldcur": [8, 10], "util": [0, 1, 5, 13, 17], "v": 6, "v1": 16, "valid": [5, 6, 11, 12, 13], "validate_dict": [13, 16], "validation_runn": 3, "valu": [3, 15], "valueerror": 6, "variabl": [3, 6], "variat": 6, "variou": [0, 6, 13], "vector": 6, "versa": 6, "version": 6, "vice": 6, "wa": [2, 12, 17, 18], "wai": [3, 12], "we": [3, 6, 17], "well": [0, 4, 13], "were": 6, "what": [3, 4, 15], "wheel": 0, "when": [2, 3, 6, 7, 15, 18], "whenev": 13, "where": [4, 6, 12, 13], "wherea": 17, "whether": [6, 13], "which": [2, 3, 6, 13], "white": 13, "whole": 6, "widow_column": [11, 12], "widowatom": 12, "without": [2, 6, 12, 18], "work": [0, 3, 12, 17], "worker": [2, 18], "wrap": 15, "wrapper": [6, 15], "write": 14, "write_func": 8, "written": [4, 11], "x": 13, "y": [2, 13, 18], "yaml": [3, 12], "year": [10, 18], "yield": [2, 6, 10, 13, 15], "yield_curation_uspto": 10, "yml": [0, 3], "you": [0, 2, 3, 4, 17, 18], "your": 4, "z": [12, 13], "za": 12}, "titles": ["rxnutils documentation", "rxnutils", "Open reaction database", "Pipeline", "Routes", "rxnutils package", "rxnutils.chem package", "rxnutils.chem.rinchi package", "rxnutils.data package", "rxnutils.data.ord package", "rxnutils.data.uspto package", "rxnutils.pipeline package", "rxnutils.pipeline.actions package", "rxnutils.routes package", "rxnutils.routes.retro_bleu package", "rxnutils.routes.ted package", "rxnutils.routes.utils package", "Templates", "USPTO"], "titleterms": {"action": [3, 12], "artifact": [2, 18], "augment": 6, "base": [11, 13], "base_pipelin": 8, "batch_util": 8, "cgr": 6, "chem": [6, 7], "combin": 10, "comparison": 13, "content": [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "data": [8, 9, 10], "databas": 2, "dataframe_mod": 12, "develop": 3, "distances_calcul": 15, "document": 0, "download": 10, "download_rinchi": 7, "extract": 17, "imag": 13, "import_ord_dataset": 9, "instal": 0, "introduct": 0, "limit": 0, "manipul": 17, "map": 8, "mapping_pipelin": 8, "modul": [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "ngram_collect": 14, "open": 2, "ord": 9, "packag": [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "pipelin": [3, 11, 12], "pre": [2, 18], "preparation_pipelin": [9, 10], "reaction": [2, 6], "reaction_mod": 12, "reaction_prop": 12, "reactiontre": 15, "read": 4, "reader": 13, "requisit": [2, 18], "retro_bleu": 14, "rinchi": 7, "rinchi_api": 7, "rout": [4, 13, 14, 15, 16], "runner": 11, "rxnutil": [0, 1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "score": [13, 14], "submodul": [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "subpackag": [5, 6, 8, 11, 13], "ted": 15, "templat": [6, 12, 17], "usag": [2, 3, 18], "uspto": [10, 18], "uspto_yield": 10, "util": [6, 15, 16], "valid": 16}}) \ No newline at end of file diff --git a/templates.html b/templates.html new file mode 100644 index 0000000..932e30b --- /dev/null +++ b/templates.html @@ -0,0 +1,190 @@ + + + + + + + + Templates — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

Templates

+

reaction utils contains routines for extracting reaction templates using the RDchiral package. +This code is based on the work of Thakkar et al. (Chem. Sci., 2019) but with some re-factoring and +other additions.

+
+

Template extraction

+

Let’s start with this atom-mapped reaction

+_images/sample_reaction.PNG +
CCN(CC)CC.CCOCC.Cl[S:3]([CH2:2][CH3:1])(=[O:4])=[O:5].[OH:6][CH2:7][CH2:8][Br:9]>>[CH3:1][CH2:2][S:3](=[O:4])(=[O:5])[O:6][CH2:7][CH2:8][Br:9]
+
+
+

First we create a ChemicalReaction object that is encapsulating the reaction and provides some +simple curation routines.

+
from rxnutils.chem.reaction import ChemicalReaction
+
+reaction = "CCN(CC)CC.CCOCC.Cl[S:3]([CH2:2][CH3:1])(=[O:4])=[O:5].[OH:6][CH2:7][CH2:8][Br:9]>>[CH3:1][CH2:2][S:3](=[O:4])(=[O:5])[O:6][CH2:7][CH2:8][Br:9]"
+rxn = ChemicalReaction(reaction)
+
+
+

if you inspect the reactants_list property, you will see that two of the reactants from the reaction +SMILES have been moved to the list of agents because they are not mapped.

+
rxn.reactants_list
+>> ['Cl[S:3]([CH2:2][CH3:1])(=[O:4])=[O:5]', '[OH:6][CH2:7][CH2:8][Br:9]']
+
+rxn.agents_list
+>> ['CCN(CC)CC', 'CCOCC']
+
+
+

Now we can extract a reaction template

+
rxn.generate_reaction_template(radius=1)
+
+rxn.retro_template
+>> <rxnutils.chem.template.ReactionTemplate at 0x7fe4e9488d90>
+
+rxn.retro_template.smarts
+>> '[C:2]-[S;H0;D4;+0:1](=[O;D1;H0:3])(=[O;D1;H0:4])-[O;H0;D2;+0:6]-[C:5]>>Cl-[S;H0;D4;+0:1](-[C:2])(=[O;D1;H0:3])=[O;D1;H0:4].[C:5]-[OH;D1;+0:6]'
+
+
+

The radius is an optional argument, specifying the radius of the template.

+
+
+

Template manipulation

+

The reaction template, either the canonical (forward) or retro template is encapulsated in a +ReactionTemplate object that can be used to apply the template to a molecule or to generate +fingerprints or hash strings.

+

Let’s see if the template generated above is capable of re-generating the expected reactants.

+
smiles="CCS(=O)(=O)OCCBr"
+reactant_list = rxn.retro_template.apply(smiles)
+reactant_list
+>> (('CCS(=O)(=O)Cl', 'OCCBr'),)
+
+
+

we see that returned list (technically a tuple) contains one item, implying that the template +was specific and only produced one set of reactants. These reactants as you see are identical +to the reactants in the reaction SMILES above.

+

To create a hash string for the template, there are a number of routines

+
rxn.retro_template.hash_from_bits()
+>> 'a1727cc9ed68a6411bfd02873c1615c22baa1af4957f14ae942e2c85caf9adb5'
+
+rxn.retro_template.hash_from_smarts()
+>> '4cb9be0738a3a84e7ed4fb661d2efb73c099fc7d6c532a4b294c8d0d'
+
+rxn.retro_template.hash_from_smiles()
+>> '5b2ff2a69fb7bd6a032938e468684773bcc668928b037bbec0ac8335'
+
+
+

The first one is creating the hash string from the fingerprint bits that are one, whereas the +other two creates it by hashing the SMARTS and the SMILES string, respectively.

+

A Morgan fingerprint can be computed for a reaction template:

+
rxn.retro_template.fingerprint_vector(radius=2, nbits=1024)
+>> array([0., 0., 0., ..., 0., 0., 0.])
+
+
+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/uspto.html b/uspto.html new file mode 100644 index 0000000..1eaed8d --- /dev/null +++ b/uspto.html @@ -0,0 +1,195 @@ + + + + + + + + USPTO — ReactionUtils 1.6.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ +
+

USPTO

+

rxnutils contain two pipelines that together downloads and prepares the USPTO reaction data so that it can be used on modelling.

+

It is a complete end-to-end pipeline that is designed to be transparent and reproducible.

+
+

Pre-requisites

+

The reason the pipeline is divided into two blocks is because the dependencies of the atom-mapper package (rxnmapper) is incompatible with +the dependencies rxnutils package. Therefore, to be able to use to full pipeline, you need to setup two python environment.

+
    +
  1. Install rxnutils according to the instructions in the README-file

  2. +
  3. Install rxnmapper according to the instructions in the repo: https://github.com/rxn4chemistry/rxnmapper

  4. +
+
conda create -n rxnmapper python=3.6 -y
+conda activate rxnmapper
+conda install -c rdkit rdkit=2020.03.3.0
+python -m pip install rxnmapper
+
+
+
    +
  1. Install Metaflow and rxnutils in the new environment

  2. +
+
python -m pip install metaflow
+python -m pip install --no-deps --ignore-requires-python .
+
+
+
+
+

Usage

+

Create a folder for the USPTO data and in that folder execute this command in the rxnutils environment

+
conda activate rxn-env
+python -m rxnutils.data.uspto.preparation_pipeline run --nbatches 200  --max-workers 8 --max-num-splits 200
+
+
+

and then in the environment with the rxnmapper run

+
conda activate rxnmapper
+python -m rxnutils.data.mapping_pipeline run --data-prefix uspto --nbatches 200  --max-workers 8 --max-num-splits 200
+
+
+

The -max-workers flag should be set to the number of CPUs available.

+

On 8 CPUs and 1 GPU the pipeline takes a couple of hours.

+
+
+

Artifacts

+

The pipelines creates a number of tab-separated CSV files:

+
+
    +
  • 1976_Sep2016_USPTOgrants_smiles.rsmi and 2001_Sep2016_USPTOapplications_smiles.rsmi is the original USPTO data downloaded from Figshare

  • +
  • uspto_data.csv is the combined USPTO data, with selected columns and a unique ID for each reaction

  • +
  • uspto_data_cleaned.csv is the cleaned and filter data

  • +
  • uspto_data_mapped.csv is the atom-mapped, modelling-ready data

  • +
+
+
+
The cleaning is done to be able to atom-map the reactions and are performing the following tasks:
    +
  • Ignore extended SMILES information in the SMILES strings

  • +
  • Remove molecules not sanitizable by RDKit

  • +
  • Remove reactions without any reactants or products

  • +
  • Move all reagents to reactants

  • +
  • Remove the existing atom-mapping

  • +
  • Remove reactions with more than 200 atoms when summing reactants and products

  • +
+
+
+

(the last is a requisite for rxnmapper that was trained on a maximum token size roughly corresponding to 200 atoms)

+

The uspo_data_mapped.csv files will have the following columns:

+
+
    +
  • ID - unique ID created by concatenated patent number, paragraph and row index in the original data file

  • +
  • Year - the year of the patent filing

  • +
  • ReactionSmiles - the original reaction SMILES

  • +
  • ReactionSmilesClean - the reaction SMILES after cleaning

  • +
  • BadMolecules - molecules not sanitizable by RDKit

  • +
  • ReactantSize - number of atoms in reactants

  • +
  • ProductSize - number of atoms in products

  • +
  • mapped_rxn - the mapped reaction SMILES

  • +
  • confidence - the confidence of the mapping as provided by rxnmapper

  • +
+
+
+
+ + +
+ +
+
+
+
+ + + + + + + \ No newline at end of file