drugex.molecules.converters package

Submodules

drugex.molecules.converters.default module

converters

Created by: Martin Sicho On: 21.04.22, 12:20

class drugex.molecules.converters.default.DrExToSMILES[source]

Bases: MolConverter

class drugex.molecules.converters.default.Identity[source]

Bases: MolConverter

class drugex.molecules.converters.default.RDKitToDrEx[source]

Bases: MolConverter

class drugex.molecules.converters.default.SmilesToDrEx[source]

Bases: MolConverter

drugex.molecules.converters.dummy_molecules module

dummy molecules

Created by: Sohvi Luukkonen On: 27.09.22, 13:40

class drugex.molecules.converters.dummy_molecules.dummyMolsFromFragments[source]

Bases: MolConverter

A converter to create dummy molecules from fragments.

static addCCToFragments(frag)[source]

Add CC to a single fragment to build a dummy molecule.

Parameters:

frag – fragment to be converted to a dummy molecule

Returns:

static bridgeFragments(frags)[source]

Bridge multiple fragments together into one dummy molecule.

Parameters:

frags – fragments to be bridged together

Returns:

a str of a SMILES representation of the bridged fragments

drugex.molecules.converters.fragmenters module

fragmenters

Created by: Martin Sicho On: 06.05.22, 12:19

class drugex.molecules.converters.fragmenters.Fragmenter(n_frags: int, n_combs: int, method: str = 'recap', deep_clean: bool = True, max_bonds: int = 75, allow_single: bool = False)[source]

Bases: CleanSMILES

Reference implementation of the original fragmenter used in DrugEx v3.

filterFragments(frags: List[str]) List[str][source]

Filter fragments to remove those that are contained in other fragments or are too small, and keep only the largest ones.

Parameters:

fragslist of fragments

Returns:

list of filtered fragments

getFragments(mol: Mol) array | None[source]

Get fragments form an RDKit molecule

Parameters:

mol – instance of rdkit.Chem.Mol

Returns:

numpy.array of generated fragments

class drugex.molecules.converters.fragmenters.FragmenterWithSelectedFragment(fragment: str, n_frags: int, n_combs: int, method: str = 'recap', deep_clean: bool = True, max_bonds: int = 75, allow_single: bool = False, exclusive: bool = False)[source]

Bases: Fragmenter

Fragmenter that only returns fragments-molecule pairs where the input fragments contain the fragment specified in the constructor.

If exclusive=True, only return fragments that contain the specified fragment and nothing else

drugex.molecules.converters.interfaces module

abc

Created by: Martin Sicho On: 22.04.22, 10:40

exception drugex.molecules.converters.interfaces.ConversionException[source]

Bases: Exception

class drugex.molecules.converters.interfaces.MolConverter[source]

Bases: ABC

drugex.molecules.converters.standardizers module

standardizers

Created by: Martin Sicho On: 21.04.22, 12:19

class drugex.molecules.converters.standardizers.CleanSMILES(is_deep=True)[source]

Bases: MolConverter

Converter used to clean SMILES strings at some places. At the moment the reasons for its existence are unclear…

class drugex.molecules.converters.standardizers.DefaultStandardizer[source]

Bases: MolConverter

Original standardization implementation from the original DrugEx v3.

exception drugex.molecules.converters.standardizers.StandardizationException[source]

Bases: ConversionException

Custom exception class to recognize and catch standardization errors.

drugex.molecules.converters.tests module

tests.py

Created by: Martin Sicho On: 22.04.22, 13:40

class drugex.molecules.converters.tests.TestStandardizer(methodName='runTest')[source]

Bases: TestCase

test_default()[source]

Tests whether the default standardizer is working as expected.

Returns: None

Module contents

__init__.py

Created by: Martin Sicho On: 21.04.22, 21:25