Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angled vertex #382

Merged
merged 6 commits into from
Aug 29, 2021
Merged

Angled vertex #382

merged 6 commits into from
Aug 29, 2021

Conversation

andrewtarzia
Copy link
Collaborator

@andrewtarzia andrewtarzia commented Aug 4, 2021

Related Issues: #156
Requested Reviewers: @lukasturcani
Note for Reviewers: If you accept the review request add a 馃憤 to this post

Using a set for placer ids, required to solve #156, lead to badly formed structures for M3L3Triangle and M4L4Square. I determined this to be because the LinearVertex was on an "orthogonal" position, so a new Vertex is required.

Most source changes in:

  • src/stk/molecular/topology_graphs/cage/vertices.py: New vertex implemented.

Added new vertex test and new structure tests for the M3L3 Triangle - new position matrices needed.

@andrewtarzia
Copy link
Collaborator Author

A test case:

import stk

metal_atom = stk.BuildingBlock(
    smiles='[Pd+2]',
    functional_groups=(
        stk.SingleAtom(stk.Pd(0, charge=2))
        for i in range(4)
    ),
    position_matrix=[[0., 0., 0.]],
)

ligand = stk.BuildingBlock(
    smiles='NCCN',
    functional_groups=[
        stk.SmartsFunctionalGroupFactory(
            smarts='[#7]~[#6]',
            bonders=(0, ),
            deleters=(),
        ),
    ]
)

metal_complex = stk.ConstructedMolecule(
    stk.metal_complex.CisProtectedSquarePlanar(
        metals=metal_atom,
        ligands=ligand,
    )
)

metal_complex = stk.BuildingBlock.init_from_molecule(
    molecule=metal_complex,
    functional_groups=[
        stk.SmartsFunctionalGroupFactory(
            smarts='[Pd]~[#7]',
            bonders=(0, ),
            deleters=(),
            # The nitrogen atom will be different
            # for each functional group.
            placers=(0, 1),
        ),
    ],
)

linker = stk.BuildingBlock(
    smiles='C1=NC=CC(C2=CC=NC=C2)=C1',
    functional_groups=[
        stk.SmartsFunctionalGroupFactory(
            smarts='[#6]~[#7X2]~[#6]',
            bonders=(1, ),
            deleters=(),
        ),
    ]
)

print(metal_complex)
print(linker)
cage = stk.ConstructedMolecule(
    stk.cage.M3L3Triangle(
        corners=metal_complex,
        linkers=linker,
        reaction_factory=stk.DativeReactionFactory(
            stk.GenericReactionFactory(
                bond_orders={
                    frozenset({
                        stk.GenericFunctionalGroup,
                        stk.GenericFunctionalGroup,
                    }): 9
                }
            )
        ),
    )
)

cage.write('test33.mol')

cage = stk.ConstructedMolecule(
    stk.cage.M4L4Square(
        corners=metal_complex,
        linkers=linker,
        reaction_factory=stk.DativeReactionFactory(
            stk.GenericReactionFactory(
                bond_orders={
                    frozenset({
                        stk.GenericFunctionalGroup,
                        stk.GenericFunctionalGroup,
                    }): 9
                }
            )
        ),
    )
)

cage.write('test44.mol')

@lukasturcani lukasturcani self-requested a review August 29, 2021 13:40
@lukasturcani lukasturcani merged commit 515376a into lukasturcani:master Aug 29, 2021
@andrewtarzia andrewtarzia deleted the angled_vertex branch August 29, 2021 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants