ViewDock: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (updated code) |
||
Line 3: | Line 3: | ||
== Keyboard shortcuts == | == Keyboard shortcuts == | ||
Using ViewDock | Using ViewDock requires a fair amount of clicking and mouse movement. To reduce these you can use this [https://www.cgl.ucsf.edu/chimera/current/docs/ContributedSoftware/accelerators/accelerators.html#adding Chimera accelerators script], written by Tom Goddard ([http://plato.cgl.ucsf.edu/pipermail/chimera-users/2020-March/016642.html] Chimer user list discussion): | ||
def register_accelerators(): | |||
from Accelerators import standard_accelerators | |||
standard_accelerators.register_accelerators() | |||
from Accelerators import add_accelerator | |||
add_accelerator('cd', 'Mark current View Dock compound deleted', vdock_delete) | |||
add_accelerator('cx', 'Mark current View Dock compound purged', vdock_purged) | |||
add_accelerator('cv', 'Mark current View Dock compound viable', vdock_viable) | |||
add_accelerator('cn', 'Move to next View Dock compound', vdock_next) | |||
add_accelerator('cp', 'Move to next View Dock compound', vdock_previous) | |||
def vdock_delete(): | |||
from ViewDock.Compound import Compound | |||
vdock_set_state(Compound.Deleted) | |||
def vdock_purged(): | |||
from ViewDock.Compound import Compound | |||
vdock_set_state(Compound.Purged) | |||
def vdock_viable(): | |||
from ViewDock.Compound import Compound | |||
vdock_set_state(Compound.Viable) | |||
def vdock_set_state(state): | |||
vd = vdock_dialog() | |||
if vd: | |||
vd.results.setSelectedState(state) | |||
vd._reloadCompounds() | |||
def vdock_next(): | |||
vdock_step(1) | |||
def vdock_previous(): | |||
vdock_step(-1) | |||
def vdock_step(step): | |||
vd = vdock_dialog() | |||
if vd: | |||
r = vd.results | |||
csel = r.selected | |||
if csel: | |||
c = csel[0] | |||
clist = r.compoundList | |||
i = clist.index(c) | |||
if i+step < len(clist) and i+step >= 0: | |||
nextc = clist[i+step] | |||
vd.results.setSelected([nextc]) | |||
def vdock_dialog(): | |||
from ViewDock import ViewDock | |||
from chimera import extension | |||
for vd in extension.manager.instances: | |||
if isinstance(vd, ViewDock): | |||
return vd | |||
return None | |||
To use, [https://www.cgl.ucsf.edu/chimera/current/docs/ContributedSoftware/accelerators/accelerators.html#dialog enable Chimera keyboard shortcuts] and load the new file. | |||
Accelerators "cv" (Viable), "cd" (Delete), "cx" (Purge), work like clicking the radio buttons in the ViewDock dialog box - they change the status of the selected compound. Accelerators "cn" and "cp" | |||
Revision as of 13:51, 30 March 2020
ViewDock is a UCSF Chimera extension for viewing outputs from several docking software packages. There is a tutorial on the Chimera web pages.
Keyboard shortcuts
Using ViewDock requires a fair amount of clicking and mouse movement. To reduce these you can use this Chimera accelerators script, written by Tom Goddard ([1] Chimer user list discussion):
def register_accelerators(): from Accelerators import standard_accelerators standard_accelerators.register_accelerators() from Accelerators import add_accelerator add_accelerator('cd', 'Mark current View Dock compound deleted', vdock_delete) add_accelerator('cx', 'Mark current View Dock compound purged', vdock_purged) add_accelerator('cv', 'Mark current View Dock compound viable', vdock_viable) add_accelerator('cn', 'Move to next View Dock compound', vdock_next) add_accelerator('cp', 'Move to next View Dock compound', vdock_previous) def vdock_delete(): from ViewDock.Compound import Compound vdock_set_state(Compound.Deleted) def vdock_purged(): from ViewDock.Compound import Compound vdock_set_state(Compound.Purged) def vdock_viable(): from ViewDock.Compound import Compound vdock_set_state(Compound.Viable) def vdock_set_state(state): vd = vdock_dialog() if vd: vd.results.setSelectedState(state) vd._reloadCompounds() def vdock_next(): vdock_step(1) def vdock_previous(): vdock_step(-1) def vdock_step(step): vd = vdock_dialog() if vd: r = vd.results csel = r.selected if csel: c = csel[0] clist = r.compoundList i = clist.index(c) if i+step < len(clist) and i+step >= 0: nextc = clist[i+step] vd.results.setSelected([nextc]) def vdock_dialog(): from ViewDock import ViewDock from chimera import extension for vd in extension.manager.instances: if isinstance(vd, ViewDock): return vd return None
To use, enable Chimera keyboard shortcuts and load the new file.
Accelerators "cv" (Viable), "cd" (Delete), "cx" (Purge), work like clicking the radio buttons in the ViewDock dialog box - they change the status of the selected compound. Accelerators "cn" and "cp"