assert smile_to_synthon('COC(=O)c1ccnc(CNC(=O)NCC2(C)CC(N=C=O)CC(C)(C)C2)c1')[0] == [
'CC1(C)CC(N[CH:10]=O)CC(C)(CNC(=O)NCc2cc(C(=O)O)ccn2)C1',
'CC1(C)CC(N[CH:10]=O)CC(C)(CNC(=O)NCc2cc([CH:10]=O)ccn2)C1']
Building Blocks
building block related functions
smile_to_synthon
smile_to_synthon (smile:str, keep_pg:bool=False)
Type | Default | Details | |
---|---|---|---|
smile | str | smiles string to convert | |
keep_pg | bool | False | if True, results include synthons with un-removed protecting groups |
Returns | Tuple[list[str], list[list[str]]] | Returns paired list of SMILES and reaction classes |
get_synthon_marks
get_synthon_marks (smile:str)
extracts reaction tag marks from synthon
ie 'CC1(C)CC(N[CH:10]=O)CC(C)(CNC(=O)NCc2cc([CH:10]=O)ccn2)C1' -> ['C:10']
Type | Details | |
---|---|---|
smile | str | input synthon smiles string |
Returns | list[str] | list of marks |
assert get_synthon_marks('CC1(C)CC(N[CH:10]=O)CC(C)(CNC(=O)NCc2cc([CH:10]=O)ccn2)C1') == ['C:10']
remove_reconstruction_atoms
remove_reconstruction_atoms (smile:str)
removes dummy atoms for fusion
Type | Details | |
---|---|---|
smile | str | synthon reconstruction string |
Returns | str | synthon smiles string |
add_reconstruction_atoms
add_reconstruction_atoms (smile:str)
augments synthon annotations (ie c:10) with dummy atoms for fusion
Type | Details | |
---|---|---|
smile | str | synthon smiles string |
Returns | str | synthon reconstruction string |
assert add_reconstruction_atoms('CC1(C)CC(N[CH:10]=O)CC(C)(CNC(=O)NCc2cc([CH:10]=O)ccn2)C1'
== 'CC1(C)CC(N[C:10](=O)[V])CC(C)(CNC(=O)NCc2cc([C:10](=O)[V])ccn2)C1'
)
assert remove_reconstruction_atoms('CC1(C)CC(N[C:10](=O)[V])CC(C)(CNC(=O)NCc2cc([C:10](=O)[V])ccn2)C1'
== 'CC1(C)CC(N[CH:10]=O)CC(C)(CNC(=O)NCc2cc([CH:10]=O)ccn2)C1'
)
assert remove_reconstruction_atoms(add_reconstruction_atoms(
'CC1(C)CC(N[CH:10]=O)CC(C)(CNC(=O)NCc2cc([CH:10]=O)ccn2)C1'
== 'CC1(C)CC(N[CH:10]=O)CC(C)(CNC(=O)NCc2cc([CH:10]=O)ccn2)C1' ))
Synthon
Synthon (synthon_smile:str, reaction_tags:list[str]=None, parents:Optional[list[Molecule]]=None, data:Optional[dict]=None)
Initialize self. See help(type(self)) for accurate signature.
Type | Default | Details | |
---|---|---|---|
synthon_smile | str | synthon smiles string | |
reaction_tags | list[str] | None | reaction class tags |
parents | Optional[list[Molecule]] | None | parent molecule |
data | Optional[dict] | None | data |
molecule_to_synthon
molecule_to_synthon (molecule:chem_templates.chem.Molecule)
Converts molecule
into a list of corresponding synthons
Type | Details | |
---|---|---|
molecule | Molecule | input Molecule |
Returns | listSynthon | output list of synthons |
= Molecule('COC(=O)c1ccnc(CNC(=O)NCC2(C)CC(N=C=O)CC(C)(C)C2)c1')
molecule = molecule_to_synthon(molecule)
synthons assert len(synthons)==2
assert synthons[0].data['parents'] == [molecule]
assert synthons[0].data['parents'] == synthons[1].data['parents']
assert synthons[0].recon_smile == 'CC1(C)CC(N[C:10](=O)[V])CC(C)(CNC(=O)NCc2cc(C(=O)O)ccn2)C1'
FusionReaction
FusionReaction (name:str, rxn_smarts:str)
Initialize self. See help(type(self)) for accurate signature.
Type | Details | |
---|---|---|
name | str | reaction name |
rxn_smarts | str | reaction smarts |
ReactionGroup
ReactionGroup (name:str, reactions:list[FusionReaction])
holds reactions beloning to the same type of transform
Type | Details | |
---|---|---|
name | str | group name |
reactions | listFusionReaction | list of reactions in group |
ReactionUniverse
ReactionUniverse (name:str, reaction_groups:list[ReactionGroup])
Initialize self. See help(type(self)) for accurate signature.
Type | Details | |
---|---|---|
name | str | rxn universe name |
reaction_groups | listReactionGroup | list of reaction groups |
= ReactionUniverse('all_reactions', REACTION_GROUPS)
rxn_universe = Molecule('COC(=O)c1ccnc(CNC(=O)NCC2(C)CC(N=C=O)CC(C)(C)C2)c1')
molecule = molecule_to_synthon(molecule)
synthons assert len(rxn_universe.get_matching_reactions(synthons[0])) == 9