schrodinger.application.dendrogram.core_class module¶
decompose.py: Contains classes to fragment molecules into cores, linkers and side chains.
Version v0.
Copyright Schrodinger, LLC. All rights reserved.
- class schrodinger.application.dendrogram.core_class.RingSysInfo(rep, name, capped_smi, uncapped_smi, capped_st, uncapped_st)¶
Bases:
tuple
- __contains__(key, /)¶
Return key in self.
- __len__()¶
Return len(self).
- capped_smi¶
Alias for field number 2
- capped_st¶
Alias for field number 4
- count(value, /)¶
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.
- name¶
Alias for field number 1
- rep¶
Alias for field number 0
- uncapped_smi¶
Alias for field number 3
- uncapped_st¶
Alias for field number 5
- class schrodinger.application.dendrogram.core_class.Utilities¶
Bases:
object
Class containing methods used by multiple other classes.
- static getRingAtomToRings(ring_atoms, rings)¶
Create a dictionary that associates each ring atom index with a set of indices into the rings arrays:
- static getExtendedRingAtomToRings(st, ring_atom_to_rings)¶
Create a dictionary that includes ring_atom_to_rings and adds off-ring atoms multiple-bonded to any ring atoms. An added off-ring atoms points to the appropriate index into rings, but is not added to the set of ring atoms.
- static molHasRing(mol)¶
Maybe not the most efficient way to do this. Find rings in the new molecule. If there are none, it is not a ring fragment.
- static adjustName(name)¶
Eliminate leading and trailing blanks; replace newlines with ‘; ‘, then replace remaining internal white space with single blanks.
- static capToStar(smi, smiles_gen)¶
Do string replacement in a SMILES, replacing all He with the ‘*’ wildcard. Canonicalize using the smiles_gen method provided.
- static stripBrackets(string)¶
Strip brackets from a string – typically SMARTS or SMILES – to create a more readable version for use as a user-visible name.
- static getRingDataStructures(st)¶
Create and return several commonly used data structures concerning ring systems.
- static getAromaticRingAtoms(rings, ring_atoms, ring_is_aromatic)¶
Return sets of aromatic and nonaromatic ring atoms.
- static getRingSysSt(st)¶
Given a fragmented molecule, turn the fragment containing the ring system into an st and return that st. Make sure there is only one.
- class schrodinger.application.dendrogram.core_class.GetPartitions(st, ist, log_f, smi_f)¶
Bases:
object
- class NameList(name0, name1, name2, name3a, name3b, name4, name5, name6)¶
Bases:
tuple
- __contains__(key, /)¶
Return key in self.
- __len__()¶
Return len(self).
- count(value, /)¶
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.
- name0¶
Alias for field number 0
- name1¶
Alias for field number 1
- name2¶
Alias for field number 2
- name3a¶
Alias for field number 3
- name3b¶
Alias for field number 4
- name4¶
Alias for field number 5
- name5¶
Alias for field number 6
- name6¶
Alias for field number 7
- __init__(st, ist, log_f, smi_f)¶
Decomposes the structure into ring systems and stores an array NameList objects, one for each ring system found.
- getNextFormattedNameArray()¶
On each call, yields an array suitable for passing to the DB for one ring system found in the input structure. The array contains partition names for the ring system for all partitionings.
- getFormattedNames(name_list)¶
- class schrodinger.application.dendrogram.core_class.RingSysStorage¶
Bases:
object
Maintain storage for lookup of ring systems and parent structures by SMILES. Each ring system SMILES is associated with a set of parent SMILES in a dictionary.
Each parent SMILES is associated with a set of names of input structures containing the parent, because duplicate entries, possibly with different names, can occur.
The purpose of all this is to make sure we we don’t add the same ring systems multiple times when they occur in multiple parents.
- ADDED_NOTHING = 0¶
- ADDED_PARENT_NAME = 1¶
- ADDED_PARENT = 2¶
- ADDED_RING_SYS = 3¶
- action_names = ('ADDED_NOTHING', 'ADDED_PARENT_NAME', 'ADDED_PARENT', 'ADDED_RING_SYS')¶
- ring_sys_d = {}¶
- parent_d = {}¶
- nring_sys = 0¶
- nparent = 0¶
- classmethod addParent(parent_smi, parent_name)¶
Update the ring_system dictionary and the parent dictionary and return an ADDED code describing the “biggest” thing we have done.
- classmethod addRingSys(smi, parent_smi)¶
Update the ring_system dictionary and the parent dictionary and return an ADDED code describing the “biggest” thing we have done.
- class schrodinger.application.dendrogram.core_class.Deepest0(st)¶
Bases:
object
Extracts ring systems at the deepest level from a structure.
Starts by setting up method to yield deepest-level ring systems in st. Subsequent method calls can request the ring systems and build representations at higher hierarchical levels.
Internally, the deepest level is level 0, since this is where we start building.
- __init__(st)¶
Precompute and store ring systems from the specified structure so the user can access them later using getRingSys(). self.ring_sys_info_ar is also created for more detailed introspection.
- getRingSysInfo()¶
Each call returns a tuple containing the pre-computed SMILES of the uncapped and capped (respectively) ring system. We return the uncapped one because we may want to use it to compute physical properties, like MW.
- class schrodinger.application.dendrogram.core_class.Deepest1(ring_sys_info0)¶
Bases:
object
Given the Deepest0 information about a ring system, compute the corresponding Deepest1 representation
- __init__(ring_sys_info0)¶
- getRingSysInfo()¶
- class schrodinger.application.dendrogram.core_class.Deepest3a(ring_sys_info0)¶
Bases:
object
Given the Deepest1 information about a ring system, compute the corresponding Deepest3a representation. This is an all-star representation of the ring topology, including ring size, without off-ring atoms and without reference to aromaticity.
- __init__(ring_sys_info0)¶
- getRingSysInfo()¶
- class schrodinger.application.dendrogram.core_class.Deepest2(ring_sys_info)¶
Bases:
object
Given the Deepest3a information about a ring system, compute the corresponding Deepest2 representation. This is a SMARTS that includes the ring skeleton only, but distinguishes between aromatic and aliphatic atoms.
- __init__(ring_sys_info)¶
- getRingSysInfo()¶
- class schrodinger.application.dendrogram.core_class.Deepest4(ring_sys_info)¶
Bases:
object
Create an St that has a topology exhibiting minimal ring sizes while still preserving bridgeheads and condensed bonds. Preserve all atoms, with the broken bonds. Create an “all-star” representation for this.
- __init__(ring_sys_info)¶
- getRingSysInfo()¶
- class schrodinger.application.dendrogram.core_class.Deepest3b(ring_sys_info)¶
Bases:
object
Given the Deepest4 information about a ring system, compute the corresponding Deepest3a representation. This is a SMARTS that includes the ring skeleton only, and distinguishes between aromatic and aliphatic atoms, where we are talking about the skeleton of the Deepest4 represntation, where rings have been reduced to their minimal sizes consistent with saving bridgehead adtoms and condensed bonds.
- __init__(ring_sys_info)¶
- getRingSysInfo()¶
- class schrodinger.application.dendrogram.core_class.Deepest5(ring_sys_info)¶
Bases:
object
Rep is the sssr class (‘1_sssr’, ‘2_sssr’, or whatever) of the ring system.
- __init__(ring_sys_info)¶
- getRingSysInfo()¶
- class schrodinger.application.dendrogram.core_class.Deepest6(ring_sys_info)¶
Bases:
object
Rep is “All_structures”
- __init__(ring_sys_info)¶
- getRingSysInfo()¶
- schrodinger.application.dendrogram.core_class.get_next_partition_array(reader, log_f=<_io.BufferedWriter name='/dev/null'>, smi_f=<_io.BufferedWriter name='/dev/null'>)¶
- schrodinger.application.dendrogram.core_class.main()¶
Requires a single cmdline arg: a structure-file name.
Writes output .smi file using the file-name prefix of the input file, prepended to -cores.smi. So foo.sdf creates foo-cores.sdf; also foo-partitions.sdf and foo.log The .partitions output contains the bare results, which is probably what you want to read into another program.