New topology for porous organic cage with part of inward vertices #426
-
Hi, thanks for your great work for building cage in silico so conveniently! However, I met a problem nowadays when I am using it. I want to add a new topology called Pen4Di10(4+10) with the method of appointing coordination for every vertices. The 4+10 porous organic cage can form successfully, yet some of the diamine vertices has inappropriate orintation. For the topology file, I have double check to assure there is no problem with the corrdination. In my opinion, it seems that the diamine vertices doesn't go through the align process when the cage is assembled. I really don't know how to solve it. Could you please help me with it? Any help or suggestions I would be very thankful !! Here are the topology file I wrote, and the script for assambling cage. from ..cage import Cage
from ..vertices import LinearVertex, NonLinearVertex
from ...topology_graph import Edge
class FourPlusTen(Cage):
_vertex_prototypes = (
NonLinearVertex(0, [1.78064, 1.34416, 0.1529465]),
NonLinearVertex(1, [1.20514, 1.3974, 1.13758]),
NonLinearVertex(2, [2.032, 0.63994, 1.35246]),
NonLinearVertex(3, [2.59602, 1.53754, 0.92842]),
LinearVertex(4, [1.9178, 0.0412, 0.1921], False),
LinearVertex(5, [2.8813, 1.2922, -0.0516], False),
LinearVertex(6, [2.35, 2.2228, 0.0764], False),
LinearVertex(7, [1.0537, 2.0922, 0.2714], False),
LinearVertex(8, [0.7004, 1.0724, 0.2764], False),
LinearVertex(9, [3.1156, 0.6358, 1.0664], False),
LinearVertex(10, [0.9347, 0.4161, 1.3943], False),
LinearVertex(11, [2.7441, 1.1186, 1.9573], False),
LinearVertex(12, [1.4478, 0.988, 2.1522], False),
LinearVertex(13, [1.8891, 2.4183, 1.5936], False)
)
_edge_prototypes = (
Edge(0, _vertex_prototypes[0], _vertex_prototypes[4]),
Edge(1, _vertex_prototypes[0], _vertex_prototypes[5]),
Edge(2, _vertex_prototypes[0], _vertex_prototypes[6]),
Edge(3, _vertex_prototypes[0], _vertex_prototypes[7]),
Edge(4, _vertex_prototypes[0], _vertex_prototypes[8]),
Edge(5, _vertex_prototypes[1], _vertex_prototypes[7]),
Edge(6, _vertex_prototypes[1], _vertex_prototypes[8]),
Edge(7, _vertex_prototypes[1], _vertex_prototypes[10]),
Edge(8, _vertex_prototypes[1], _vertex_prototypes[12]),
Edge(9, _vertex_prototypes[1], _vertex_prototypes[13]),
Edge(10, _vertex_prototypes[2], _vertex_prototypes[4]),
Edge(11, _vertex_prototypes[2], _vertex_prototypes[9]),
Edge(12, _vertex_prototypes[2], _vertex_prototypes[10]),
Edge(13, _vertex_prototypes[2], _vertex_prototypes[11]),
Edge(14, _vertex_prototypes[2], _vertex_prototypes[12]),
Edge(15, _vertex_prototypes[3], _vertex_prototypes[5]),
Edge(16, _vertex_prototypes[3], _vertex_prototypes[6]),
Edge(17, _vertex_prototypes[3], _vertex_prototypes[9]),
Edge(18, _vertex_prototypes[3], _vertex_prototypes[11]),
Edge(19, _vertex_prototypes[3], _vertex_prototypes[13]),
)
_num_windows = 8
_num_window_types = 2 import stk
from rdkit import Chem
import rdkit.Chem.AllChem as rdkit
bb1 = stk.BuildingBlock('O=CC1C(C=O)=C(C=O)C(C=O)=C1C=O', [stk.AldehydeFactory()])
bb2 = stk.BuildingBlock('NC1CCCCC1N', [stk.PrimaryAminoFactory()])
cage_name = 'B2_test'
cage = stk.ConstructedMolecule(
topology_graph=stk.cage.FourPlusTen(
building_blocks=(bb1, bb2),
# optimizer=stk.MCHammer(),
),
)
writer = stk.MolWriter()
writer.write(molecule=cage, path=f'{cage_name}.mol') |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @suex2016 Do you have a model of a target structure for us to compare to? That way we can see how the structure is getting it wrong? If not, I can have a look at this in a few days to see what the issue is. Thank you, Andrew |
Beta Was this translation helpful? Give feedback.
-
Hey @suex2016 , Below is a minimum working example that improves the BuildingBlock alignment of your model by using the new AngledVertex instead of the Linear vertex, which was introduced for 2-connected building blocks that were not linear in structure. Does this provide a useful outcome? Also, you will see that the code is written outside of the stk source code. import stk
class FourPlusTen(stk.cage.Cage):
_vertex_prototypes = (
stk.cage.NonLinearVertex(0, [1.78064, 1.34416, 0.1529465]),
stk.cage.NonLinearVertex(1, [1.20514, 1.3974, 1.13758]),
stk.cage.NonLinearVertex(2, [2.032, 0.63994, 1.35246]),
stk.cage.NonLinearVertex(3, [2.59602, 1.53754, 0.92842]),
stk.cage.AngledVertex(4, [1.9178, 0.0412, 0.1921], False),
stk.cage.AngledVertex(5, [2.8813, 1.2922, -0.0516], False),
stk.cage.AngledVertex(6, [2.35, 2.2228, 0.0764], False),
stk.cage.AngledVertex(7, [1.0537, 2.0922, 0.2714], False),
stk.cage.AngledVertex(8, [0.7004, 1.0724, 0.2764], False),
stk.cage.AngledVertex(9, [3.1156, 0.6358, 1.0664], False),
stk.cage.AngledVertex(10, [0.9347, 0.4161, 1.3943], False),
stk.cage.AngledVertex(11, [2.7441, 1.1186, 1.9573], False),
stk.cage.AngledVertex(12, [1.4478, 0.988, 2.1522], False),
stk.cage.AngledVertex(13, [1.8891, 2.4183, 1.5936], False)
)
_edge_prototypes = (
stk.Edge(0, _vertex_prototypes[0], _vertex_prototypes[4]),
stk.Edge(1, _vertex_prototypes[0], _vertex_prototypes[5]),
stk.Edge(2, _vertex_prototypes[0], _vertex_prototypes[6]),
stk.Edge(3, _vertex_prototypes[0], _vertex_prototypes[7]),
stk.Edge(4, _vertex_prototypes[0], _vertex_prototypes[8]),
stk.Edge(5, _vertex_prototypes[1], _vertex_prototypes[7]),
stk.Edge(6, _vertex_prototypes[1], _vertex_prototypes[8]),
stk.Edge(7, _vertex_prototypes[1], _vertex_prototypes[10]),
stk.Edge(8, _vertex_prototypes[1], _vertex_prototypes[12]),
stk.Edge(9, _vertex_prototypes[1], _vertex_prototypes[13]),
stk.Edge(10, _vertex_prototypes[2], _vertex_prototypes[4]),
stk.Edge(11, _vertex_prototypes[2], _vertex_prototypes[9]),
stk.Edge(12, _vertex_prototypes[2], _vertex_prototypes[10]),
stk.Edge(13, _vertex_prototypes[2], _vertex_prototypes[11]),
stk.Edge(14, _vertex_prototypes[2], _vertex_prototypes[12]),
stk.Edge(15, _vertex_prototypes[3], _vertex_prototypes[5]),
stk.Edge(16, _vertex_prototypes[3], _vertex_prototypes[6]),
stk.Edge(17, _vertex_prototypes[3], _vertex_prototypes[9]),
stk.Edge(18, _vertex_prototypes[3], _vertex_prototypes[11]),
stk.Edge(19, _vertex_prototypes[3], _vertex_prototypes[13]),
)
_num_windows = 8
_num_window_types = 2
def main():
bb1 = stk.BuildingBlock(
smiles='O=CC1C(C=O)=C(C=O)C(C=O)=C1C=O',
functional_groups=[stk.AldehydeFactory()],
)
bb2 = stk.BuildingBlock(
smiles='NC1CCCCC1N',
functional_groups=[stk.PrimaryAminoFactory()],
)
cage_name = 'B2_test'
cage = stk.ConstructedMolecule(
topology_graph=FourPlusTen(
building_blocks=(bb1, bb2),
optimizer=stk.MCHammer(),
),
)
writer = stk.MolWriter()
writer.write(molecule=cage, path=f'{cage_name}.mol')
if __name__ == "__main__":
main()
|
Beta Was this translation helpful? Give feedback.
Hey @suex2016 ,
Below is a minimum working example that improves the BuildingBlock alignment of your model by using the new AngledVertex instead of the Linear vertex, which was introduced for 2-connected building blocks that were not linear in structure.
Does this provide a useful outcome?
Also, you will see that the code is written outside of the stk source code.