Closed mikemhenry closed 2 years ago
This should definitely work but as you mentioned, it's not as easy as it could be. If you're interested in diving into this we should probably have a chat some time with @tcmoore3 @summeraz and anyone in your group interested in this.
The two things that we would need to implement:
Something visual could be handy but doesn't let you automate things as nicely.
One idea that could be pretty sleek is using SMARTS patterns to specify the beads you want to break your big compound into. Something roughly along the lines of:
c12_aa = mb.load('c12.pdb')
c12_ua = mb.coarse_grain(c12_aa, particles=['C(H)(H)(H)', 'C(H)(H)'])
The groundwork for this is in this PR. I haven't really thought this through yet and there are definitely a lot of caveats attached to this for more complicated chemistries. Even the example above would require CH3 to get matched before CH2 because one is a subset of the other.
I'm excited about potentially using SMARTS patterns to coarse grain morphologies. I think using an xml file analogous to to the forcefield file to describe coarse grain beads by defining their components would be very powerful, since we could then leverage the concepts of overrides then to solve the problem of CH3 and CH2 both getting matched. Something like:
<Type name="A" class="A" element="CH2" mass="13" def="C(H)(H)" overrides="B" />
Then the same file could have the forcefield parameters for the coarse grain beads.
This would allow a user to define a bunch of coarse grain beads to convert all atom systems into coarse grained ones.
I'm starting to poke around in mbuild's coarse graining capabilities. Did the coarse graining stuff use to include things like 2to1 or something?
I actually really like the direction coarse graining is going. It looks like you provide the compound you want to coarse grain and a list of particle classes that make up the compound that you want to turn into coarse grain simulation beads. This works really well if you construct your mbuild compound from logical groups.
However if I already have a complex molecule (say defined in a
.pdb
file) wrapped in mBuild compound class, is there an easy way to break it into logical pieces?Right now my approach would be:
Now I will be able to coarse grain this compound using mBuild tools, as well as easily modify the compound by swapping out sub-compounds.
Is this approach reasonable?
Related #270