mosdef-hub / gmso

Flexible storage of chemical topology for molecular simulation
https://gmso.mosdef.org
MIT License
52 stars 33 forks source link

Update topology against parts of other objects #71

Open mattwthompson opened 5 years ago

mattwthompson commented 5 years ago

Stemming from a discussion @rmatsum836 and I just had -

The current convert/ module is designed to make a new object from another one, i.e. making a new topology from a mb.Compound that already exists. What if instead of making a completely new object, we allowed part of one to be stored into the other? Like update_coordinates in mbuild but between two objects instead of from disk.

In each case, making a completely new object either would lose some important information, and instead we'd just want to take a part of one and put it into the other. Seem doable piece-by-piece, or crazy?

ahy3nz commented 5 years ago

It's an interesting idea, but I have doubts about how "modular/generalizable" this sort of thing could be. An update coordinate function could be nice, but doing something as niche as "specifically copying the Mie potential parameters for indices [0, 100)" might be hard to make general. Here's a jumble of thoughts

mattwthompson commented 5 years ago

have doubts about how "modular/generalizable" this sort of thing could be.

It's probably a fool's errand to try to handle this generally, but I think it may be useful in some specific cases as they arise.

mattwthompson commented 5 years ago

One way this could take place is with some arguments that specify parts we do and don't want to be updated, i.e.

# if you wanted to use positions from something else, like mb.fill_box
top = from_parmed(parameterization=True, positions=False, connectivity=True) 
# if you wanted to grab parameters from something else
top = from_mbuild(parameterization=False, positions=True, connectivity=True) 
# if you wanted to grab only the connection graph to be passed to foyer's atomtyping routines
top = from_parmed(parameterization=False, positions=False, connectivity=True)