Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#388 closed defect (fixed)

surface doesn't notice when some of its atoms are deleted

Reported by: Elaine Meng Owned by: Tom Goddard
Priority: major Milestone:
Component: Surface Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

for example

open 2gbp
surf
color :lys yellow targ as
delete :lys

... yellow stuff still shown. Actually I wasn't sure if the surface was supposed to adjust instantly but if you try to do other stuff, there is a traceback, e.g.

color pink

Traceback (most recent call last):
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/cmd_line/gui.py", line 195, in execute
cmd.run(cmd_text)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/cli.py", line 2194, in run
results.append(ci.function(session, kw_args))
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/color.py", line 107, in color
ns = _set_surface_colors(session, satoms, color, opacity, bgcolor)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/color.py", line 232, in _set_surface_colors
ns = scolor(session, atoms, color, opacity=opacity)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/commands/scolor.py", line 50, in scolor
v = ai[v2a] # Vertices for the given atoms
IndexError: index 2082 is out of bounds for axis 0 with size 2069

Change History (3)

comment:1 by Tom Goddard, 9 years ago

Currently molecular surfaces don't notice when their atoms are deleted. This leads to the error reported here because the surface keeps track of the atom associated with each surface vertex and when some of those atoms are deleted it does not updating the mapping.

One solution is to recompute the surface whenever some atoms used to compute the surface are deleted or moved. This is what Chimera 1 does.

Another idea is to leave the surface as is and either try to fix the association between vertices and atoms, or remove any association between atoms and vertices. Would be nice to keep the associations with existing atoms and leave the vertices associated with deleted atoms, no longer associated with any atom. That would take some work -- currently every vertex has to be associated with an atom, or no vertex is associated with an atom.

comment:2 by Tom Goddard, 9 years ago

Resolution: fixed
Status: newclosed

Fixed.

If atoms are deleted then any molecular surfaces that were computed using those atoms lose their associations between surface points and atoms. The surface is unchanged.
I also made gaussian surfaces (resolution option given) not have associations between atoms and surface points. Selecting a surface with ctrl-click with no atom associations
selects the whole surface. Commands that use atom associations like "color :10 blue", "transp :10 50" won't dork on surfaces without atom associations unless all the atoms
that define the surface are specified. Show and hide of individual surface patches also does not apply (does nothing) for surfaces without atom associations.

comment:3 by Elaine Meng, 9 years ago

I think it would be less confusing simply to close/delete a molecular surface if any of its atoms are deleted.  When the molecular surface remains but not its atomic associations, its behavior is confusing, and users may try ~surf/surf and not realize they have to close the model to get rid of the zombie.  If the surface is closed, it becomes clear that one must use “surface” again to get one that is synced with the structure.  I haven’t worked with the Gaussian surfaces much, but being able to color/show/hide patches of Gaussian surfaces by their atom associations sounds like very useful functionality that I would hate to lose because of the relatively rare action of deleting atoms after creating the surface.
Note: See TracTickets for help on using tickets.