forked from corredD/ePMV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
epmvrc.py
237 lines (180 loc) · 9.38 KB
/
epmvrc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
"""
Copyright (C) <2010> Autin L.
This file ePMV_git/epmvrc.py is part of ePMV.
ePMV is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ePMV is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ePMV. If not, see <http://www.gnu.org/licenses/gpl-3.0.html>.
"""
# Resource file used to customize PMV.
#
# Visit http://mgltools.scripps.edu/documentation/how-to/changing-default-parameters
# to learn how to change default parameters using _pmvrc.
#
# $Header: /opt/cvs/python/packages/share1.5/Pmv/_pmvrc,v 1.78 2010/11/01 17:44:28 sanner Exp $
#
# $Id: _pmvrc,v 1.78 2010/11/01 17:44:28 sanner Exp $
import pickle
import sys
numOfSelectedVerticesToSelectTriangle = 1 # 1 , 2 or 3
# import the python debugger pdb
#import pdb
# load a set of standard commands
self.browseCommands('fileCommands', package="Pmv", topCommand=0)
self.browseCommands('bondsCommands',package='Pmv', topCommand=0)
self.browseCommands('deleteCommands',package='Pmv', topCommand=0)
if sys.version_info <= (2, 7):
self.browseCommands('displayCommands',
commands=['displaySticksAndBalls','undisplaySticksAndBalls',
'displayCPK', 'undisplayCPK',
'displayLines','undisplayLines',
'displayBackboneTrace','undisplayBackboneTrace',
],
package='Pmv', topCommand=0)
self.browseCommands('displayCommands',
commands=['showMolecules'],
package='Pmv', topCommand=0)
self.browseCommands('displayCommands', commands=['DisplayBoundGeom'],package='ePMV.pmv_dev', topCommand=0)
else :
self.browseCommands('displayCommands',
commands=['displaySticksAndBalls','undisplaySticksAndBalls',
'displayCPK', 'undisplayCPK',
'displayLines','undisplayLines',
'displayBackboneTrace','undisplayBackboneTrace',
],
package='Pmv', topCommand=0)
self.browseCommands('displayCommands',
commands=['showMolecules'],
package='Pmv', topCommand=0)
self.browseCommands('displayCommands_3x', commands=['DisplayBoundGeom'],package='ePMV.pmv_dev', topCommand=0)
self.browseCommands('editCommands',package='Pmv', topCommand=0)
if self.hasGui:
self.browseCommands("interactiveCommands", package="Pmv", topCommand=0)
#self.browseCommands("secondaryStructureCommands", package="Pmv", topCommand=0)
if sys.version_info <= (2, 7):
self.browseCommands('secondaryStructureCommands', package='ePMV.pmv_dev', topCommand=0)
else :
self.browseCommands("secondaryStructureCommands", package="Pmv", topCommand=0)
self.browseCommands('beadedRibbonsCommands', package="ePMV.pmv_dev", topCommand=0)
self.browseCommands("splineCommands", package="Pmv", topCommand=0)
#self.browseCommands("coarseMolSurfaceCommands", package="Pmv", topCommand=0)
mslib_import = False
try:#msms is not distributed with commercial version, so we need this to avoid the Traceback
import mslib
mslib_import = True
except ImportError:
mslib_import = False
if mslib_import:
self.browseCommands('msmsCommands',
commands=['computeMSMS',
'displayMSMS', 'undisplayMSMS',
'readMSMS', 'saveMSMS',
'computeSESAndSASArea',
],
package='Pmv', topCommand=0)
self.browseCommands('selectionCommands', commands=['select', 'deselect',
'clearSelection', 'saveSet',
'invertSelection',
'selectSet',
'selectFromString',
'directSelect',
'selectHeteroAtoms'],
package='Pmv', topCommand=0)
if self.hasGui:
self.browseCommands('APBSCommands', package='Pmv', topCommand=0)
else :
if sys.version_info <= (2, 7):
self.browseCommands('APBSCommands_2x', package='ePMV.pmv_dev', topCommand=0)
self.browseCommands('colorCommands',package='ePMV.pmv_dev', topCommand=0)
else :
self.browseCommands('APBSCommands', package='ePMV.pmv_dev', topCommand=0)
self.browseCommands('colorCommands_3x',package='ePMV.pmv_dev', topCommand=0)
self.browseCommands('buildDNACommands',package='ePMV.pmv_dev', topCommand=0)#commands=['buildDNA']
#self.browseCommands('strutsCommands', package='ePMV.pmv_dev',commands=['buildStruts'], topCommand=0)
self.browseCommands('repairCommands', package='Pmv', topCommand=0)
self.browseCommands("dejaVuCommands", package="ViewerFramework", topCommand=0)
#self.browseCommands('helpCommands',package ='Pmv', topCommand =0)
# load command: edit - color palettes - Edit Color By Atom Type Palette
if self.hasGui:
self.browseCommands('colorPaletteCommands',
commands=['editColorPaletteByAtomType', 'editColorPaletteByResidueType',
'editColorPaletteByChain', 'editColorPaletteByMolecule' ],
package='Pmv', topCommand=0)
#self.browseCommands('superimposeCommandsNew', package='Pmv', topCommand=0)
self.browseCommands('setangleCommands', package='Pmv', topCommand=0)
if self.hasGui:
# The following commands will be executed on the molecule when
# loaded in the viewer.
self.setOnAddObjectCommands(['buildBondsByDistance','displayLines','colorByAtomType'],
topCommand=0)
# bind several shortcut to commands
self.bindCmdToKey( 'z', 'Control_L', self.undo, topCommand=0)
# not needed anymore as theese command are set on modifiers at startup
#self.bindCmdToKey( 's', 'Control_L', self.setICOM,
# (self.select,), topCommand=0)
#self.bindCmdToKey( 'd', 'Control_L', self.setICOM,
# (self.deselect,), topCommand=0)
#self.bindCmdToKey( 'p', 'Control_L', self.setICOM,
# (self.printNodeNames,), topCommand=0)
# Set some user preferences
if self.hasGui:
self.setUserPreference(('Transformation Logging', 'final'), topCommand=0)
self.setUserPreference(('Show Progress Bar', 'show'), topCommand=0)
self.setUserPreference(('Sharp Color Boundaries for MSMS', 'blur'), topCommand=0)
#self.GUI.floatCamera()
#self.GUI.addToolBar('large')
if self.hasGui and 'dashboard' in self.commands:
# adding columns to dashboard
self.dashboardSuspendRedraw(True)
#from Pmv.dashboard import visibilityColDescr
#self.addDashboardCmd(visibilityColDescr, log=0)
from Pmv.dashboard import selectColDescr
self.addDashboardCmd(selectColDescr, log=0)
from Pmv.dashboard import displayLinesColDescr
self.addDashboardCmd(displayLinesColDescr, log=0)
from Pmv.dashboard import displaySandBColDescr
self.addDashboardCmd(displaySandBColDescr, log=0)
from Pmv.dashboard import displayCPKColDescr
self.addDashboardCmd(displayCPKColDescr, log=0)
from Pmv.dashboard import displaySSColDescr
self.addDashboardCmd(displaySSColDescr, log=0)
if mslib_import:
from Pmv.dashboard import displayMSMSColDescr
self.addDashboardCmd(displayMSMSColDescr, log=0)
#from Pmv.dashboard import labelColDescr
#self.addDashboardCmd(labelColDescr, log=0)
from Pmv.dashboard import labelMenuColDescr
self.addDashboardCmd(labelMenuColDescr, log=0)
from Pmv.dashboard import colorMenuColDescr
self.addDashboardCmd(colorMenuColDescr, log=0)
## from Pmv.dashboard import colAtColDescr
## self.addDashboardCmd(colAtColDescr, log=0)
## from Pmv.dashboard import colMolColDescr
## self.addDashboardCmd(colMolColDescr, log=0)
## from Pmv.dashboard import colChainColDescr
## self.addDashboardCmd(colChainColDescr, log=0)
## from Pmv.dashboard import colResRASColDescr
## self.addDashboardCmd(colResRASColDescr, log=0)
## from Pmv.dashboard import colResSHAColDescr
## self.addDashboardCmd(colResSHAColDescr, log=0)
## from Pmv.dashboard import colDGColDescr
## self.addDashboardCmd(colDGColDescr, log=0)
## from Pmv.dashboard import colSSColDescr
## self.addDashboardCmd(colSSColDescr, log=0)
## from Pmv.dashboard import colInstColDescr
## self.addDashboardCmd(colInstColDescr, log=0)
self.dashboardSuspendRedraw(False)
self.GUI.ROOT.update()
# set dahboard size
self.dashboard.setNaturalSize()
self.GUI.ROOT.after_idle(self.fetch.checkCache)
#self.browseCommands('serverCommands', commands=[
# 'startServer', 'connectToServer', 'StartWebControlServer'],
# package='ViewerFramework', topCommand=0)
#