Opened 6 years ago

Closed 6 years ago

#2381 closed enhancement (fixed)

Add hbonds clear and distance clear subcommands

Reported by: goddard@… Owned by: pett
Priority: normal Milestone:
Component: Command Line Version:
Keywords: Cc: Elaine Meng
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description (last modified by Tom Goddard)

The following bug report has been submitted:
Platform:        Darwin-18.7.0-x86_64-i386-64bit
ChimeraX Version: 0.91 (2019-09-05)
Description
Should probably have an "hbonds clear" command that acts like ~hbonds keeping with the pattern of most of our other commands use.

Log:
UCSF ChimeraX version: 0.91 (2019-09-05)  
© 2016-2019 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open 6h6b format mmCIF fromDatabase pdb

6h6b title:  
Structure of alpha-synuclein fibrils [more info...]  
  
Chain information for 6h6b #1  
---  
Chain | Description  
A B C D E F G H I J | Alpha-synuclein  
  
  

> hide atoms

> show cartoons

> set bgColor white

> lighting simple

> graphics silhouettes true

> save /Users/goddard/Desktop/image1.png supersample 3

> close

> open 6h6b format mmCIF fromDatabase pdb

6h6b title:  
Structure of alpha-synuclein fibrils [more info...]  
  
Chain information for 6h6b #1  
---  
Chain | Description  
A B C D E F G H I J | Alpha-synuclein  
  
  

> save /Users/goddard/Desktop/image1.png supersample 3

> hide atoms

> show ribbons

> save /Users/goddard/Desktop/image1.png supersample 3

> show /A only

> show /A ribbons only

> hide /A

> show ribbons

> show /A ribbons only

> show ribbons

> save /Users/goddard/Desktop/image1.png supersample 3

> select clear

> color /D,E,F,I,J tan

> color /A,B,C,G,H pink

> save /Users/goddard/Desktop/image1.png supersample 3

> select /A

806 atoms, 808 bonds, 1 model selected  

> show /A ribbons only

> select clear

> save /Users/goddard/Desktop/image1.png supersample 3

> show /A atoms

> style stick

Changed 8060 atom styles  

> color byhetero

> save /Users/goddard/Desktop/image1.png supersample 3

> log metadata #1

Metadata for 6h6b #1  
---  
Title | Structure of alpha-synuclein fibrils  
Citation | Guerrero-Ferreira, R., Taylor, N.M., Mona, D., Ringler, P., Lauer,
M.E., Riek, R., Britschgi, M., Stahlberg, H. (2018). Cryo-EM structure of
alpha-synuclein fibrils. Elife, 7. PMID: 29969391. DOI: 10.7554/eLife.36402  
Gene source | Homo sapiens  
Experimental method | Electron microscopy  
Resolution | 3.4Å  
  
> sequence chain #1/A#1/B#1/C#1/D#1/E#1/F#1/G#1/H#1/I#1/J

Alignment identifier is 1  

> select clear

> color sel orange

> color /D,E,F,I,J tan

> color /A,B,C,G,H pink

> color byhetero

> select clear

Traceback (most recent call last):  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/ui/gui.py", line 1666, in <lambda>  
dw.closeEvent = lambda e, tw=tool_window, mw=mw: mw.close_request(tw, e)  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/ui/gui.py", line 549, in close_request  
tool_instance.delete()  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seq-view/tool.py", line 495, in delete  
self.alignment.detach_viewer(self)  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seqalign/alignment.py", line 325, in detach_viewer  
self.session.alignments.destroy_alignment(self)  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seqalign/manager.py", line 110, in destroy_alignment  
alignment._destroy()  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seqalign/alignment.py", line 498, in _destroy  
aseq.match_maps[sseq].mod_handler.remove()  
KeyError: <chimerax.atomic.molobject.Chain object at 0x129c06550>  
  
KeyError:  
  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seqalign/alignment.py", line 498, in _destroy  
aseq.match_maps[sseq].mod_handler.remove()  
  
See log for complete Python traceback.  
  

> save /Users/goddard/Desktop/seqbug.cxs

> sequence chain #1/A#1/B#1/C#1/D#1/E#1/F#1/G#1/H#1/I#1/J

Alignment identifier is 1  
Traceback (most recent call last):  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/ui/gui.py", line 1666, in <lambda>  
dw.closeEvent = lambda e, tw=tool_window, mw=mw: mw.close_request(tw, e)  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/ui/gui.py", line 549, in close_request  
tool_instance.delete()  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seq-view/tool.py", line 495, in delete  
self.alignment.detach_viewer(self)  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seqalign/alignment.py", line 325, in detach_viewer  
self.session.alignments.destroy_alignment(self)  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seqalign/manager.py", line 110, in destroy_alignment  
alignment._destroy()  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seqalign/alignment.py", line 498, in _destroy  
aseq.match_maps[sseq].mod_handler.remove()  
KeyError: <chimerax.atomic.molobject.Chain object at 0x129c06550>  
  
KeyError:  
  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seqalign/alignment.py", line 498, in _destroy  
aseq.match_maps[sseq].mod_handler.remove()  
  
See log for complete Python traceback.  
  

> sequence chain #1/A#1/B#1/C#1/D#1/E#1/F#1/G#1/H#1/I#1/J

Alignment identifier is 1  

> select clear

> select /A:52

16 atoms, 15 bonds, 1 model selected  

> select up

144 atoms, 144 bonds, 1 model selected  

> graphics selection width 4

> save /Users/goddard/Desktop/image1.png supersample 3

> select clear

> select strand

3540 atoms, 3500 bonds, 1 model selected  

> select clear

> label /A

> label height 1.4

> hide atoms

> show /A

> graphics silhouettes false

> hide H

> save /Users/goddard/Desktop/image1.png supersample 3

> save /Users/goddard/Desktop/image1.png supersample 3

> usage label

label [objects] [objectType] [text text] [offset offset] [color color]
[bgColor bgColor] [size size] [height height] [font a text string] [onTop true
or false]  
— Create atom labels  
objects: an objects specifier or nothing  
objectType: one of atoms, bonds, pseudobonds, or residues  
text: default or a text string  
offset: default or some numbers  
color: default or a color  
bgColor: none or a color  
size: default or an integer  
height: fixed or a number

label delete [objects] [objectType]  
— Delete atom labels  
objects: an objects specifier or nothing  
objectType: one of atoms, bonds, pseudobonds, or residues

label listfonts  
— List available fonts

label orient [orient]  
— Set label orientation updating  
orient: a number  

> label delete

> cofr

Center of rotation: 121.58 120.4 94.561 front center  
Traceback (most recent call last):  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/ui/gui.py", line 1666, in <lambda>  
dw.closeEvent = lambda e, tw=tool_window, mw=mw: mw.close_request(tw, e)  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/ui/gui.py", line 549, in close_request  
tool_instance.delete()  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seq-view/tool.py", line 495, in delete  
self.alignment.detach_viewer(self)  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seqalign/alignment.py", line 325, in detach_viewer  
self.session.alignments.destroy_alignment(self)  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seqalign/manager.py", line 110, in destroy_alignment  
alignment._destroy()  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seqalign/alignment.py", line 498, in _destroy  
aseq.match_maps[sseq].mod_handler.remove()  
KeyError: <chimerax.atomic.molobject.Chain object at 0x129c06550>  
  
KeyError:  
  
File "/Users/goddard/Desktop/ChimeraX Sep 5
2019.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/seqalign/alignment.py", line 498, in _destroy  
aseq.match_maps[sseq].mod_handler.remove()  
  
See log for complete Python traceback.  
  

> cofr frontCenter

> show ribbons

> lighting simple

> graphics silhouettes true

> hbonds

295 hydrogen bonds found  

> hide atoms

> save /Users/goddard/Desktop/image1.png supersample 3

> ~hbonds

> usage hbonds

hbonds [atoms] [makePseudobonds true or false] [radius a number] [color a
color] [showDist true or false] [restrict restrict] [interSubmodel true or
false] [interModel true or false] [intraModel true or false] [intraMol true or
false] [intraRes true or false] [cacheDa a number] [relax true or false]
[distSlop a number] [angleSlop a number] [twoColors true or false] [slopColor
a color] [reveal true or false] [retainCurrent true or false] [saveFile name
of a file to save/write] [log true or false] [namingStyle namingStyle] [batch
true or false] [dashes dashes] [saltOnly true or false] [name a text string]
[coordsets true or false]  
— Find hydrogen bonds  
atoms: an atoms specifier or nothing  
restrict: one of any, both, or cross or an atoms specifier  
namingStyle: one of command, serial, or simple  
dashes: an integer ≥ 0  

> usage ~hbonds

~hbonds [name a text string]  
— Clear hydrogen bonds  




OpenGL version: 4.1 ATI-2.11.20
OpenGL renderer: AMD Radeon Pro 580 OpenGL Engine
OpenGL vendor: ATI Technologies Inc.

Change History (8)

comment:1 by Tom Goddard, 6 years ago

Description: modified (diff)
Platform: all
Project: ChimeraX

distance clear command would also be desirable.

comment:2 by Tom Goddard, 6 years ago

Component: UnassignedCommand Line
Owner: set to pett
Status: newassigned
Summary: ChimeraX bug report submissionAdd hbonds clear and distance clear subcommands
Type: defectenhancement

comment:3 by pett, 6 years ago

Cc: Elaine Meng added
Status: assignedaccepted

in reply to:  4 ; comment:4 by Elaine Meng, 6 years ago

I guess you know there are already ~hbonds and ~dist commands?

in reply to:  5 ; comment:5 by goddard@…, 6 years ago

Yes I know of ~dist and ~hbonds.  In the past I advocated for not relying on arcana like "~" in front of commands, and I think we agreed that having subcommands like "distance clear" would be a good idea, and ~distance could be an alias to that.

in reply to:  6 ; comment:6 by Elaine Meng, 6 years ago

I find the tildes a lot easier to remember and type, personally, but I can see your point of not wanting to use special characters.  However, “delete” may be better than “clear”... the only other command with a “clear” subcommand is selection, which is somewhat different, and“clearing the selection” is common terminology.  I Surface has a “close” subcommand, whereas label has a “delete” subcommand.  Choosing a different word every time makes it hard to remember, but at least “close” or “delete” make it clear that you aren’t simply hiding the item.

in reply to:  7 ; comment:7 by goddard@…, 6 years ago

clear, delete, close are all ok with me, but I agree it would be nice if we used the same word for the various commands.

comment:8 by pett, 6 years ago

Resolution: fixed
Status: acceptedclosed

Implemented "dist/hb delete" as equivalents for ~dist/~hb

Note: See TracTickets for help on using tickets.