Comments (11)
I think Modeller.delete() is exactly what you're looking for.
from openmm.
I want to remove atoms from a topology that I have no positions for. I guess I could give fake positions to modeller, but that seems silly.
from openmm.
Modeller doesn't care what positions you give it. It edits the topology and positions at the same time, because often you do have positions you need to keep in sync. But if they're fake positions that you'll never look at, it doesn't care.
from openmm.
I think I would use these methods. Sometimes we need to manipulate topologies without necessarily having coordinates.
Alternatively, we could propose that Modeller add a method to build coordinates from any existing coordinate data and idealized internal coordinates.
from openmm.
Modeller doesn't care what positions you give it. It edits the topology and positions at the same time, because often you do have positions you need to keep in sync. But if they're fake positions that you'll never look at, it doesn't care.
If the positions are irrelevant in making these operations, why shouldn't Topology
also support these kinds of manipulations?
from openmm.
It's definitely possible to access this functionality now via Modeller
-- but IMO it would be nice to have the symmetry of the remove methods, since Topology
has addAtom
, addResidue
, etc.
from openmm.
I'll also use whatever comes out of this. Agree w/ @rmcgibbo that having more finely divided methods is a bit more intuitive. That said I think it's a small deal!
Good to know about Modeller.delete()
from openmm.
If the positions are irrelevant in making these operations, why shouldn't Topology also support these kinds of
manipulations?
We can't actually remove pieces from an existing Topology. That would break all sorts of things. For example, every atom, chain, or residue has an index field that would no longer be valid. That's why Modeller creates a new Topology for every editing call, leaving the old one unchanged.
from openmm.
But we could have member functions that return a new topology. They could
accept coordinates as an optional input as well...
from openmm.
Yes, but why would we want two completely independent but parallel topology editing facilities? That would just add complexity and create confusion. What problem is this supposed to solve?
Also, can you imagine the confusion that would ensue from having a removeAtom() method on a Topology object that actually leaves the object unchanged, returning a new object? That's certainly not what I would expect a method like that to do.
from openmm.
@peastman: It would be straightforward to maintain the invariants when removing an atom. You would have obviously have to reindex the remaining atoms. It is not impossible. But clearly returning a new topology is the wrong solution -- that's what modeller is for.
from openmm.
Related Issues (20)
- A code question about calculating forces HOT 4
- Multiple Constraints with different k and maximum value of k HOT 15
- Question: harmonic position constraints of protein HOT 2
- NumPy 2.0 support HOT 2
- Calculating electrostatic potential/field HOT 1
- Issue with CustomExternalForce going from 7.4.1 to 7.7.0 HOT 2
- AMOEBA pitorsion API HOT 2
- Unexpected behavior of the `Context.reinitialize` method HOT 1
- Particle Coordinate is NaN occasionally upon molecule hitting PBCs HOT 5
- simulation.step(n) will raise a TypeError when n is a float when n%1 != 0 after all but the last step HOT 1
- Dynamic dielectric constant for a coarse grain model HOT 7
- adapting processTinkerForceField.py for small molecules HOT 2
- How to set a periodic infinite long DNA system? by setUsesPeriodicBoundaryConditions HOT 9
- How can I perform rigidbody simulation? HOT 3
- module not found HOT 7
- How can I manipulate epsilon of the atoms to turn off LJ force during the simualtion? HOT 8
- No template found for residue 645 (G) and Error on using gromacs inputs HOT 4
- Load empirical force filed like EAM in OpenMM HOT 1
- A code issue about force plugin HOT 4
- Reproducing simulations with truncated octahedron box & "Periodic box vectors must be in reduced form" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openmm.