drugex.molecules package
Subpackages
- drugex.molecules.converters package
- Submodules
- drugex.molecules.converters.default module
- drugex.molecules.converters.dummy_molecules module
- drugex.molecules.converters.fragmenters module
- drugex.molecules.converters.interfaces module
- drugex.molecules.converters.standardizers module
- drugex.molecules.converters.tests module
- Module contents
Submodules
drugex.molecules.interfaces module
interfaces
Created by: Martin Sicho On: 06.04.22, 16:54
- class drugex.molecules.interfaces.BaseMolSupplier(converter, hide_duplicates=False)[source]
Bases:
MolSupplier,ABCExtended
MolSupplierthat produces instances ofDrExMolthat implements identification of duplicates and other useful features.- convert(representation)[source]
Can be used to convert a molecule from the supplied representation to a different one. This method is called automatically on the output of
next. By default, it returns the produced representation as is.- Parameters:
next (representation - the output produced by) –
- Return type:
molecule - molecule converted from “representation” to the desired output
- class drugex.molecules.interfaces.MolSupplier[source]
Bases:
ABCGeneric class that defines the interface for data suppliers from molecules. Implementations of this class are used to wrap functionality that can be reused and evaluated in parallel with the
ParallelSupplierEvaluator.Suppliers are simply just Python generators that produce the desired output one item at a time. It is also possible to implement the
convertmethod to customize the produced output.- convert(representation)[source]
Can be used to convert a molecule from the supplied representation to a different one. This method is called automatically on the output of
next. By default, it returns the produced representation as is.- Parameters:
next (representation - the output produced by) –
- Return type:
molecule - molecule converted from “representation” to the desired output
- abstract next()[source]
Implement this method so that it provides iteration over molecules item by item. It should fetch next item from a generator, line from a file or next item from a remote API. If there are no more items, raise
StopIteration.- Raises:
StopIteration – no more items to return
- Returns:
one instance of a molecule annotations (optional): molecule associated metadata as a
dict- Return type:
molecule
drugex.molecules.mol module
core
Created by: Martin Sicho On: 21.04.22, 22:03
drugex.molecules.suppliers module
suppliers
Created by: Martin Sicho On: 22.04.22, 13:50
- class drugex.molecules.suppliers.ListSupplier(mols, converter=<drugex.molecules.converters.default.SmilesToDrEx object>, hide_duplicates=False)[source]
Bases:
BaseMolSupplierBasic supplier that converts molecules in a list to the desired representation (SMILES string to
DrExMolby default).- next()[source]
Implement this method so that it provides iteration over molecules item by item. It should fetch next item from a generator, line from a file or next item from a remote API. If there are no more items, raise
StopIteration.- Raises:
StopIteration – no more items to return
- Returns:
one instance of a molecule annotations (optional): molecule associated metadata as a
dict- Return type:
molecule
- class drugex.molecules.suppliers.StandardizedSupplier(mols, standardizer)[source]
Bases:
BaseMolSupplierSupplies standardized molecules from the input molecules. It requires a standardizer.
Module contents
__init__.py
Created by: Martin Sicho On: 06.04.22, 16:53