Review previous meeting / progress on questions and tests | https://openforcefield.atlassian.net/wiki/spaces/IN/pages/edit-v2/1531215881 Discussion: What’s the difference between a Topology and a list of molecules? Discussion: How could we simulate a protein starting from PDB? JW – We’re not going to do protein prep (missing atom placement, protation state assignment) as part of this refactor. We’ll wrap other toolks that can do this, or plan for our users to show up with a very well conditioned PDB (with protons are good residue names), or show up with SDF proteins. JW – So, we’ll need some “PDB to SDF” tool that can take a nice PDB and assign bond orders .RDKit or another tool (ambpdb?) may have this, or we could make one ourselves (with a dictionary of bond order-less substructures) We’d also want something like the reverse – “Given an SDF file of a protein, find all of its residues, and give them names and numbers that that a user can go run an AMBER/GROMACS simulation”
Future plans: Play around with openff-system?
New task: Give IP a code snippet to create a structure, the IP will describe its contents in terms of other packages' Molecule/Topology/System
Warming up with Pydantic Try to make a copy of the openff.toolkit.topology.molecule.Atom class using Pydantic. Github link macro |
---|
link | https://github.com/openforcefield/openff-toolkit/blob/56d2530e00d854337817ad3cff99a6cd9c3198f4/openff/toolkit/tests/test_molecule.py#L279-L323 |
---|
|
Can use EITHER simtk.unit and simtk.openmm.app.element package, OR Pint. If you use Pint, be sure to change the tests to not compare to simtk classes.
Opening a practice PR for TopologyAtom.element
|
Notebook on topology | Code Block |
---|
| from openff.toolkit.topology import Molecule, Topology
smileses = ['CCO', 'OCC', "C1CCCCC1", "C1=CC=CC=C1", "c1ccccc1", "O", "O", "O", "[H]O[H]"]
mols = [Molecule.from_smiles(smi) for smi in smileses]
print(mols) |
Code Block |
---|
[Molecule with name '' and SMILES '[H][O][C]([H])([H])[C]([H])([H])[H]', Molecule with name '' and SMILES '[H][O][C]([H])([H])[C]([H])([H])[H]', Molecule with name '' and SMILES '[H][C]1([H])[C]([H])([H])[C]([H])([H])[C]([H])([H])[C]([H])([H])[C]1([H])[H]', Molecule with name '' and SMILES '[H][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]', Molecule with name '' and SMILES '[H][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]', Molecule with name '' and SMILES '[H][O][H]', Molecule with name '' and SMILES '[H][O][H]', Molecule with name '' and SMILES '[H][O][H]', Molecule with name '' and SMILES '[H][O][H]'] |
Code Block |
---|
[Atom(name=, atomic number=6),
Atom(name=, atomic number=6),
Atom(name=, atomic number=8),
Atom(name=, atomic number=1),
Atom(name=, atomic number=1),
Atom(name=, atomic number=1),
Atom(name=, atomic number=1),
Atom(name=, atomic number=1),
Atom(name=, atomic number=1)] |
Code Block |
---|
[Atom(name=, atomic number=8),
Atom(name=, atomic number=6),
Atom(name=, atomic number=6),
Atom(name=, atomic number=1),
Atom(name=, atomic number=1),
Atom(name=, atomic number=1),
Atom(name=, atomic number=1),
Atom(name=, atomic number=1),
Atom(name=, atomic number=1)] |
Code Block |
---|
| top = Topology.from_molecules(mols)
print(top) |
Code Block |
---|
<openff.toolkit.topology.topology.Topology object at 0x144e459d0> |
Code Block |
---|
| for tm in top.topology_molecules:
print(tm)
print(tm.reference_molecule) |
Code Block |
---|
<openff.toolkit.topology.topology.TopologyMolecule object at 0x144e45e80>
Molecule with name '' and SMILES '[H][O][C]([H])([H])[C]([H])([H])[H]'
<openff.toolkit.topology.topology.TopologyMolecule object at 0x144746c70>
Molecule with name '' and SMILES '[H][O][C]([H])([H])[C]([H])([H])[H]'
<openff.toolkit.topology.topology.TopologyMolecule object at 0x144e45970>
Molecule with name '' and SMILES '[H][C]1([H])[C]([H])([H])[C]([H])([H])[C]([H])([H])[C]([H])([H])[C]1([H])[H]'
<openff.toolkit.topology.topology.TopologyMolecule object at 0x144e45850>
Molecule with name '' and SMILES '[H][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]'
<openff.toolkit.topology.topology.TopologyMolecule object at 0x144af14c0>
Molecule with name '' and SMILES '[H][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]'
<openff.toolkit.topology.topology.TopologyMolecule object at 0x144af1490>
Molecule with name '' and SMILES '[H][O][H]'
<openff.toolkit.topology.topology.TopologyMolecule object at 0x14477fca0>
Molecule with name '' and SMILES '[H][O][H]'
<openff.toolkit.topology.topology.TopologyMolecule object at 0x14477fd00>
Molecule with name '' and SMILES '[H][O][H]'
<openff.toolkit.topology.topology.TopologyMolecule object at 0x14477fe20>
Molecule with name '' and SMILES '[H][O][H]' |
Code Block |
---|
| for rm in top.reference_molecules:
print(rm) |
Code Block |
---|
Molecule with name '' and SMILES '[H][O][C]([H])([H])[C]([H])([H])[H]'
Molecule with name '' and SMILES '[H][C]1([H])[C]([H])([H])[C]([H])([H])[C]([H])([H])[C]([H])([H])[C]1([H])[H]'
Molecule with name '' and SMILES '[H][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]'
Molecule with name '' and SMILES '[H][O][H]' |
Code Block |
---|
| top.topology_molecules[0].atom(0).atomic_number |
Code Block |
---|
| top.topology_molecules[1].atom(0).atomic_number |
Code Block |
---|
| top.topology_molecules[0]._top_to_ref_index |
Code Block |
---|
{0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8} |
Code Block |
---|
| top.topology_molecules[1]._top_to_ref_index |
Code Block |
---|
{0: 2, 1: 1, 2: 0, 3: 8, 4: 6, 5: 7, 6: 4, 7: 5, 8: 3} |
|