Organic Cage¶
For usage examples see Cage.
-
class
Cage(vertex_alignments=None, num_processes=1)¶ Bases:
stk.molecular.topology_graphs.topology_graph.TopologyGraphRepresents a cage topology graph.
Cage topologies are added by creating a subclass which defines the
vertex_dataandedge_dataclass attributes.A
Cagesubclass will add the attributesnum_windowsandnum_window_typesto eachConstructedMolecule.-
vertex_data¶ A class attribute. Holds the data of the vertices which make up the topology graph.
- Type
tupleofVertexData
-
edge_data¶ A class attribute. Holds the data of the edges which make up the topology graph.
- Type
tupleofEdgeData
Examples
Cageinstances can be made without supplying additional arguments (usingFourPlusSixas an example)import stk bb1 = stk.BuildingBlock('NCCN', ['amine']) bb2 = stk.BuildingBlock('O=CC(C=O)C=O', ['aldehyde']) cage1 = stk.ConstructedMolecule( building_blocks=[bb1, bb2], topology_graph=stk.cage.FourPlusSix() )
Different structural isomers of cages can be made by using the vertex_alignments optional parameter
tetrahedron = stk.cage.FourPlusSix( vertex_alignments={0: 1, 1: 1, 2: 2} ) cage2 = stk.ConstructedMolecule( building_blocks=[bb1, bb2], topology_graph=tetrahedron )
The parameter maps the
idof a vertex to a number between 0 (inclusive) and the number of edges the vertex is connected to (exclusive). So a vertex connected to three edges can be mapped to0,1or2.By changing which edge each vertex is aligned with, a different structural isomer of the cage can be formed.
You can also build cages with multiple building blocks, but you have to assign each building block to a vertex with building_block_vertices.
bb1 = stk.BuildingBlock(‘O=CC(C=O)C=O’, [‘aldehyde’]) bb2 = stk.BuildingBlock(‘O=CC(Cl)(C=O)C=O’, [‘aldehyde’]) bb3 = stk.BuildingBlock(‘NCCN’, [‘amine’]) bb4 = stk.BuildingBlock(‘NCC(Cl)N’, [‘amine’]) bb5 = stk.BuildingBlock(‘NCCCCN’, [‘amine’])
tetrahedron = stk.cage.FourPlusSix() cage = stk.ConstructedMolecule(
building_blocks=[bb1, bb2, bb3, bb4, bb5], topology_graph=tetrahedron, building_block_vertices={
bb1: tetrahedron.vertices[:2], bb2: tetrahedron.vertices[2:4], bb3: tetrahedron.vertices[4:5], bb4: tetrahedron.vertices[5:6], bb5: tetrahedron.vertices[6:]
}
)
Methods
assign_building_blocks_to_vertices(self, …)Assign building_blocks to
vertices.construct(self, mol)Construct a
ConstructedMolecule.-
__init__(self, vertex_alignments=None, num_processes=1)¶ Initialize a
Cage.- Parameters
vertex_alignments (
dict, optional) – A mapping from theVertex.idof aVertexverticesto anEdgeconnected to it. TheEdgeis used to align the firstFunctionalGroupof aBuildingBlockplaced on that vertex. Only vertices which need to have their default edge changed need to be present in thedict. IfNonethen the default edge is used for each vertex. Changing whichEdgeis used will mean that the topology graph represents different structural isomers. The edge is refered to by a number between0(inclusive) and the number of edges the vertex is connected to (exclusive).num_processes (
int, optional) – The number of parallel processes to create duringconstruct().
-
assign_building_blocks_to_vertices(self, building_blocks)¶ Assign building_blocks to
vertices.- Parameters
building_blocks (
listofMolecule) – TheBuildingBlockandConstructedMoleculeinstances which represent the building block molecules used for construction. Only one instance is present per building block molecule, even if multiples of that building block join up to form theConstructedMolecule.- Returns
Maps the building_blocks, to the
Vertexobjects inverticesthey are placed on during construction. Thedicthas the formbuilding_block_vertices = { BuildingBlock(...): [Vertex(...), Vertex(...)], BuildingBlock(...): [ Vertex(...), Vertex(...), Vertex(...), ] ConstructedMolecule(...): [Vertex(...)] }
- Return type
dict- Raises
ValueError – If there is more than one building with a given number of functional groups.
-
construct(self, mol)¶ Construct a
ConstructedMolecule.- Parameters
mol (
ConstructedMolecule) – TheConstructedMoleculeinstance which needs to be constructed.- Returns
None
- Return type
NoneType
-