Opened 8 years ago

Closed 8 years ago

#873 closed defect (fixed)

"select ~protein" selects all atoms with pseudobonds

Reported by: Tristan Croll Owned by: pett
Priority: major Milestone:
Component: Command Line Version:
Keywords: Cc: chimera-programmers@…
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

If I do "select ~protein" in the command line, all N and C atoms involved in chain breaks and protein atoms with pseudobonds to metals are part of the resulting selection.

Change History (7)

comment:1 by pett, 8 years ago

Milestone: Alpha 4
Owner: changed from pett to Conrad Huang

comment:2 by Conrad Huang, 8 years ago

Cc: chimera-programmers@… added

Here's what is happening. The ChimeraX selection is essentially a two-tuple of (atoms, models). The latter is needed because there are models which have no atoms. Suppose we use 2gbp as an example. When you open 2gbp, you get two models: 2gbp (atomic) and 2gbp (pseudobond, or pbg).

  1. evaluate ~protein
    1. selects protein -> (all protein atoms in atomic, atomic)
    2. invert = (all non-protein atoms in atomic, atomic + pbg) because pbg is not a Structure (this is in core/objects.py line 67). Not sure this is right, but arguably not wrong.
  2. make this the current selection
    1. clear current selection
    2. add atoms from this to selection
    3. add models from this to selection. This is where things go south. The default action when a pbg is selected is to select all its atoms. So a bunch of extra atoms are added to the selection.

So the question is "how do we fix it?"

  1. We might want to fix 1b, so that pbg does not get into the models list, since its parent model atomic is already on the list. This seems a little strange to me. How can a model not be on either a selection or its inverse?
  2. We might want to fix 2c by changing the behavior of "select" for pbg, but I'm sure there are stuff that depend on this behavior.
  3. We might want to fix 2c by changing the "select" command so that it never selects pbg models. We already divide models into three types: atomic structures, surfaces, and everything else. Adding a fourth type doesn't seem so horrible. The down side is that pbg models will never appear as the selected models, which is potentially a surprise for someone down the road.

So we have three ugly proposals. I'm including chimera-programmers on the cc list so that everyone can chime in. Please speak up.

comment:3 by pett, 8 years ago

I think the answer is #1. Pseudobonds implicitly depend on the selection state of their endpoint atoms to determine their selection state. They don't really have an independent selection state of their own. Pseudobond groups are not really "models which have no atoms" and therefore shouldn't be getting into the models half of the selection tuple. Basically, pseudobond groups don't qualify as a "model" for selection purposes.

comment:4 by pett, 8 years ago

Upon discussion with T.G. I have revised my thinking. The problem with my proposal is that the pseudobond group needs to be in the models result for commands *other* than "select". The long-term solution is to have "edges" (bonds/pseudobonds) individually selectable like in Chimera 1. This will require revising some APIs and consumers of those APIs, but shouldn't be too bad.

We were thinking that an immediate solution would be form the "protein" selector to also select the "missing structure" pseudobond group as appropriate, but other pseudobond groups (e.g. metal coordination) would still wind up selecting protein atoms.

comment:5 by Tom Goddard, 8 years ago

Made bonds and pseudobonds selectable (ticket #879). Formerly selecting a bond or pseudobond (e.g. missing segment pseudobond) just selected the end-point atoms because the pseudobond itself did not have a selection state. Now that it does we don't select the end-point atoms. So "select ~protein" does not cause the protein atoms to get selected due to ~protein pseudobonds. This fixes this bug.

comment:6 by Tom Goddard, 8 years ago

Milestone: Alpha 4
Owner: changed from Conrad Huang to pett

Probably missing segment pseudobonds of a protein should be selected by the "protein" selector. Reassigning to Eric to consider that enhancement.

comment:7 by pett, 8 years ago

Resolution: fixed
Status: assignedclosed

The "protein", "nucleic", and "backbone" selectors now also select the appropriate pseudobonds.

Note: See TracTickets for help on using tickets.