question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pass to restrain_atoms a list of atom indices

See original GitHub issue

I came across a case where creating a DSL selection string for the atoms I need to restrain is quite a pain. I’m thinking of making forcefactories.restrain_atoms() a little more flexible by changing its signature from

def restrain_atoms(..., topology, atoms_dsl,...):

to

def restrain_atoms(..., restrained_atoms, ...):

where restrained_atoms is a simple list of atom indices. Any objections to this?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Lnadencommented, Sep 8, 2017

Better. I really think having both functionalities, or at bare minimum a DSL processing is much better from a user standpoint than just atom indices.

0reactions
andrrizzicommented, Sep 8, 2017

I like that better (I hate not having proper overloading in Python)! Although, I’d do only 2 methods

def restrain_atoms_by_dsl(..., topology, atoms_dsl, ...):
    restrained_atoms = topology.select(atoms_dsl).list()
    return restrain_atoms(...,restrained_atoms,...)

def restrain_atoms(..., atom_indices, ...):
    # Stuff
Read more comments on GitHub >

github_iconTop Results From Across the Web

Atom Selection — MDTraj 1.9.4 documentation
In this example, we'll go over the basics of atom and reside selection in MDTraj. ... indexed atom index print('Where is the fifth...
Read more >
Atom selection language - MDAnalysis User Guide
AtomGroups can be created by selecting atoms using the MDAnalysis atom ... returns an AtomGroup with atoms sorted according to their index in...
Read more >
atomselect
list : Return a list of all undeleted atom selections. ... list: Return a list of the atom indices in the selection (BTW,...
Read more >
3. Lists - Q for Mortals
These are the lists of atoms of homogenous type, called simple lists – known in ... Instead, we can ask for a list...
Read more >
The Phenix atom selection syntax
Atoms to leave out for omit map calculation; Subset of atoms to modify properties for (in PDBTools); Harmonically restrain atoms during refinement. All...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found