2021-03-26 Wagner/Thompson Biopolymer Topology working session
Date
Mar 26, 2021
Participants
@Jeffrey Wagner
@Matt Thompson
Discussion topics
Notes |
---|
class OFFBioTop(OFFTop):
def __init__(self, mdtrajtop, *args, **kwargs):
self.mdtrajtop = mdtrajtop
super().__init__(*args, **kwargs)
off_top = Topology.from_openmm(omm_top, unique_molecule=[molecules])
off_biotop = OFFBioTop(mdtraj_top, off_top)
off_biotop.mdtrajtop.atoms[0].type
>>> "CG"
ff = ForceField('openff-1.3.0.offxml')
off_sys = ff.create_openff_system(off_biotop)
[atom.index for atom in off_sys.topology.mdtrajtop.residues[0]]
>>> [1,2,3,4,54,5,7,8]
[atom.type for atom in off_sys.topology.mdtrajtop.residues[0]]
>>> ['CA', 'CB', "NH", "HN", ...]
[atom.index for atom in off_sys.topology.mdtrajtop.selectAtoms('ALA')]
>>> [14,32,53,43,54,15,74,84]
|
|-OFFTop (which can contain arbitrary hierarchy info like residues/chains)
|---OFFAtomTypeTop
|---OFFCheminfTop
|