GithubHelp home page GithubHelp logo

Comments (11)

peastman avatar peastman commented on May 13, 2024

I think Modeller.delete() is exactly what you're looking for.

from openmm.

rmcgibbo avatar rmcgibbo commented on May 13, 2024

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.

peastman avatar peastman commented on May 13, 2024

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.

jchodera avatar jchodera commented on May 13, 2024

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.

jchodera avatar jchodera commented on May 13, 2024

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.

rmcgibbo avatar rmcgibbo commented on May 13, 2024

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.

tjlane avatar tjlane commented on May 13, 2024

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.

peastman avatar peastman commented on May 13, 2024

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.

kyleabeauchamp avatar kyleabeauchamp commented on May 13, 2024

But we could have member functions that return a new topology. They could
accept coordinates as an optional input as well...

from openmm.

peastman avatar peastman commented on May 13, 2024

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.

rmcgibbo avatar rmcgibbo commented on May 13, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.