-
Notifications
You must be signed in to change notification settings - Fork 17
/
pymolshortcuts.py
executable file
·15521 lines (12756 loc) · 489 KB
/
pymolshortcuts.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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
'''
DESCRIPTION
Loads functions that enable faster work in PyMOL.
To source this script on startup of PyMOL, include the
following line:
run pymolshortcuts.py
This script defines a number of Python functions or shortcts.
These functions are called shortcuts becasue they are invoked with
shortnames in analogy to keyborad shortcuts. Unlike keyboard
entry. The shortcuts are designed to save time and address some
shortcommings of PyMOL that are annoying like no version control
for output files.
The variant of this file called pymolshortcuts.py does not
depend on Python module beuafitulsoup4 which does not come with
PyMOL.
INSTALLATION
Source this file from your pymolrc file on the mac or linux or
from your pymolrc.pml file on Windows by adding the command
below (adjust the file path as appropriate) on a separate line:
run ~/Scripts/PyMOLscripts/pymolshortcuts.py
Enter "SC" to print to the command history window a list of
shortcuts.
You will need to edit the paths to your installation of several
external applications. See the section "PATHS to Applications"
below.
REQUIREMENTS
Should work for PyMOL running with Python 2.7 and 3.7 interpreters.
Incentive PyMOL built with Anaconda Python3.7 is ideal but not
essential.
HELP
To see the documentation for shortcut, enter at the PyMOL prompt:
help <ShortCutName>
e.g.,
help AO
The documentation for a shortcut includes a 1) description of the
shortcut, 2) one or more examples of its usage, 3) the corresponding
PyMOL Macro Language codeas vertical script, 4) the same as a
horizontal script to ease copying and pasting the code on the
command line, and 5) the corresponding Python code.
Copyright Notice
================
Copyright (c) 2019 Board of Regents for the University of Oklahoma
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Blaine Mooers, PhD
blaine@ouhsc.edu
975 NE 10th St, BRC 466
Department of Biochemistry and Molecular Biology
College of Medicine
Stephenson Cancer Center
University of Oklahoma Health Sciences Center,
Oklahoma City, OK, USA 73104
'''
from __future__ import division, print_function
__author__ = "Blaine Mooers"
__copyright__ = "2019 Board of Regents for the University of Oklahoma"
__license__ = "MIT Licencse"
__version__ = "1.0.0"
# Versioning follows follows MAJOR.MINOR[.PATCH] where major releases
# are not backward compatable.
__credits__ = ["Miriam Shakir", "Safra Shakir"]
# Credits are for people who tested the code, reported bug fixes, made
# suggestions, etc.
__date__ = "6 November 2019"
__maintainer__ = "Blaine Mooers"
__email__ = "blaine-mooers@ouhsc.edu"
__status__ = "Production"
from pymol import cmd, stored, math, cgo, xray
from math import cos, sin, radians, sqrt
import datetime
import time
import webbrowser
import random
import glob
import os
import os.path
import numpy
import subprocess
# Set the background to opaque white.
cmd.set('ray_opaque_background','on')
# ################ Edit PATHS to local directories of files #########
# $HOME/ is the user's main directory:
# /Users/username on Mac OS
# /home/username on Linux
# $HOME is equivalent to ~.
localPDBfilePath = r'$HOME/pdbFiles/'
localEMAPfilePath = r'$HOME/emapFiles/'
localHKLfilePath = r'$HOME/hklFiles/'
AppPaths='''You may have to edit the file paths to your applications
around line 477 in pymolshortcut.py.'''
print(AppPaths)
# #################### Edit PATHS to Applications ######################
#
# Find your operating system from the three sets of paths or
# commands below.
# The default OS is Mac.
# If your computer is not a Mac, comment out the Mac set and uncomment
# the set for your operating system.
# Comment out the paths to the applications that you lack.
#
# The paths are for my Mac OS 10.14 with some applications stored in
# /usr/local and some in /opt/local/bin thanks to macports.
# Some paths can be found by entering "which <program>" in a terminal
# window.
#
# You can replace the file path with a command to open the application.
# For example, you can use the command "open -a bbedit" on the Mac.
# This approach is the preferred one: it avoids the spinning ball.
# The analogous command is "start" on Windows.
#
# ########## Mac Open Commands and PATHS to Applications ##############
# Data analysis
DBBrowserSQLiteOpen = ['open','-a','DBBrowserForSQLite']
excelOpen = ['open','-a','Microsoft Excel']
JabRefOpen = ['open','-a','JabRef.app']
jaspOpen = ['open','-a','JASP.app']
jmpOpen = ['open','-a','JMP Pro 14.app']
juliaOpen = ['open','-a','Julia-1.2.app']
juliaproOpen = ['open','-a','JuliaPro-1.2.0-1.app']
octaveOpen = ['open',
'-n',
'-a',
'/Applications/MacPorts/Octave.app/Contents/MacOS/Octave']
ROpen = ['open','-a','R']
RStudioOpen = ['open','-a','RStudio']
# Image manipulation programs
gimpOpen=['/opt/local/bin/gimp','-n']
inkscapeCommand = ['/opt/local/bin/inkscape','--file=','fileName']
inkscapeOpen = ['/opt/local/bin/inkscape']
pptOpen = ['open','-a','Microsoft PowerPoint']
# Molecular graphics programs
ccp4mgOpen = ['open','-n','-a','QtMG.app']
chimeraOpen = ['open','-a','Chimera.app']
cootOpen =['open','-a','coot.app']
jmolOpen = ['java','-jar','/Applications/jars/jmol-14.29.54/Jmol.jar']
yasaraOpen = ['open','-a','YASARA.app']
vmdOpen = ['open','-a','VMD194.app']
# Text editors
atomOpen = ['open','-a','atom']
atomStart = ['start','atom']
bbeditOpen = ['open','-a','bbedit']
codeOpen = ['/usr/local/bin/code']
emacsCommand = ['open','-a','Emacs.app', '"$@"']
emacsOpen = ['open','-a','Emacs.app']
geditOpen = ['open','-a','gedit2.30.2.app']
jeditOpen = ['open','-a','jEdit.app']
neovimOpen = ['open',
'-n',
'-a',
'/Users/blaine/software/nvim-osx64/bin/nvim']
nppOpen = ['open','-a','Notepad++.app']
oniOpen = ['open','-a','Oni.app']
pdbeditorOpen = ['java',
'-jar',
'/Applications/jars/PDB_Editor_FIX090203.jar']
sublimeText3Open = ['/usr/local/bin/subl','test.pml']
textMateOpen = ['open','-a','TextMate']
vimOpen = ['open','-a','MacVim.app']
#Terminals
itermOpen = ['open','-n','-a','iTerm.app']
terminalOpen = ['open','-n','-a','Terminal.app']
xquartzOpen = ['open','-n','-a','XQuartz.app']
x11Open = ['open','-n','-a','X11.app']
# Web sites
gcalURL = 'https://calendar.google.com/calendar/r'
gmailURL = 'https://mail.google.com/mail/u/0/#inbox'
webmailURL = 'https://webmail.ouhsc.edu/owa/auth/logon.aspx?replaceCurrent=1&url=http%3a%2f%2fwebmail.ouhsc.edu%2fowa%2f'
weatherServiceRadarURL = 'https://radar.weather.gov/radar.php?rid=TLX'
# Web static sites
atsasURL = 'https://www.embl-hamburg.de/biosaxs/download.html'
scatterURL = 'http://www.bioisis.net/tutorial/9'
bioxtasrawURL = 'https://bioxtas-raw.readthedocs.io/en/latest/manual/Introduction_to_RAW_and_this_documentation.html'
acaURL = 'http://www.amercrystalassn.org'
alsURL = 'https://als.lbl.gov/'
apsURL = 'https://www.aps.anl.gov/'
biocatURL = 'https://www.bio.aps.anl.gov/pages/links.html'
sasbdbURL = 'https://www.sasbdb.org/'
chimeriaURL = 'https://www.cgl.ucsf.edu/chimera/'
chessURL = 'https://www.chess.cornell.edu'
emdbURL = 'https://www.ebi.ac.uk/pdbe/emdb/'
epURL = 'https://github.com/MooersLab/EasyPyMOL'
jmURL = 'http://wiki.jmol.org/index.php/Main_Page'
lbsfURL = 'https://research.ouhsc.edu/CoreFacilities/LaboratoryofBiomolecularStructureandFunction.aspx'
ouMCLURL = 'http://structuralbiology.ou.edu/mcl'
molgrURL = 'https://www.oumedicine.com/docs/default-source/ad-biochemistry-workfiles/moleculargraphicslinks.html'
molgrwikiURL = 'https://en.wikipedia.org/wiki/List_of_molecular_graphics_systems'
nslsIIURL = 'https://www.bnl.gov/ps/'
ndbURL = 'http://ndbserver.rutgers.edu'
ppcURL = 'http://www.ou.edu/cas/chemistry/research/research-support-services/protein-production-core'
psURL = 'https://www.proteinsociety.org/'
rsURL = 'https://www.rnasociety.org/'
saxsURL = 'https://www.oumedicine.com/docs/default-source/ad-biochemistry-workfiles/small-angle-scattering-links-27aug2014.html?sfvrsn=0'
saxierURL = 'https://www.saxier.org/forum/'
ssrlbl42URL = 'https://www-ssrl.slac.stanford.edu/~saxs/'
sbgridURL= 'https://www.youtube.com/user/SBGridTV/videos'
ssrlsmbURL = 'http://smb.slac.stanford.edu'
ssurfURL = 'http://www.ssurf.org'
scipyURL = 'https://www.scipy2019.scipy.org'
#### Web search sites
# Send search term to Amazon.com
abURL = 'https://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Dstripbooks&field-keywords='
# Send search terms to anaconda
anacondaURL = 'https://anaconda.org/search?q='
# Send search terms to ArXiv
axURL = 'https://arxiv.org/search/?query='
# Send search terms to BioRxiv
bxURL = 'https://www.biorxiv.org/search/'
# Send search terms to Google Books
gbURL = 'https://www.google.com/search?tbm=bks&q='
ghURL = 'https://www.github.com/search?q='
# Send search terms to Google.com.
goURL = 'http://www.google.com/search?btnG=1&q='
# Sweden's Google Scholar.
gsURL = 'https://scholar.google.se/scholar?hl=en&q='
gsnURL = 'https://scholar.google.se/scholar?hl=en&q='
# Send search terms to Google Videos.
gvURL = 'https://www.google.com/videohp/search?btnG=1&q='
# Send search terms to PubMed.
ipmURL = 'https://www.ncbi.nlm.nih.gov/pubmed/?term='
iucrURL = 'https://journals.iucr.org/'
# Send search terms to Stackoverflow.
stackoverflowURL = 'https://stackoverflow.com/search?q='
# Send search terms to Springer.
spnURL = 'https://www.springer.com/gp/search?query='
spURL = 'https://www.springer.com/gp/search?query='
# Send search terms to Science Direct.
scienceDirectURL1 = 'https://www.sciencedirect.com/search/advanced?qs='
scienceDirectURL2 = '&show=100&sortBy=relevance'
# Send search terms to Research Gate.
rgnURL = 'https://www.researchgate.net/search.Search.html?type=researcher&query='
rgURL = 'https://www.researchgate.net/search.Search.html?type=researcher&query='
# Send search terms to PyMOLWiki
pwURL = 'https://pymolwiki.org/index.php/'
pymolURL = 'https://pymolwiki.org/index.php/'
# Send search terms to PyMOL mailing list
pmlURL = 'https://sourceforge.net/p/pymol/mailman/search/?q='
pmlnURL = 'https://sourceforge.net/p/pymol/mailman/search/?q='
# Send search terms to PubMed
pmURL = 'https://www.ncbi.nlm.nih.gov/pubmed/?term='
# Send search terms to RCSB
pdbURL = 'https://www.rcsb.org/structure/'
pdbnURL = 'https://www.rcsb.org/structure/'
# Send search terms to Research Gate
researchGateURL = 'https://www.researchgate.net/search.Search.html?type=researcher&query='
# Send search terms to Science Direct
scienceDirectURL1 = 'https://www.sciencedirect.com/search/advanced?qs='
scienceDirectURL2 = '&show=100&sortBy=relevance'
# Send search terms to SourceForge
sourceForgeURL = "https://sourceforge.net/directory/os:mac/?q="
# Send search terms to Springer Books
springerBooksURL1 = 'https://www.springer.com/gp/search?query='
springerBooksURL2 = '&submit=Submit+Query'
#wordProcessors
wordOpen = ['open','-a','Microsoft Word.app']
# Optional local mirror of the PDB
local_mirror_divided = '/mnt/bio/db/pdb.divided'
# ############ Linux run commands and PATHS to Applications ###########
#
# # Data analysis
# DBBrowserSQLiteStart = ['DBBrowserForSQLite']
# DBBrowserSQLitePath = '/Applications/DBBrowserForSQLite/
# Contents/MacOS/DB Browser for SQLite'
# excelOpen = ['Microsoft Excel']
# excelPath = '/Applications/Microsoft Excel/
# Contents/MacOS/Microsoft Excel'
# jabrefOpen = ['JabRef'] '/Applications/JabRef/
# Contents/MacOS/JavaApplicationStub'
# jabrefPath = '/Applications/JabRef/Contents/MacOS/JavaApplicationStub'
# jaspOpen = ['JASP']
# jaspPath = 'Applications/JASP/Contents/MacOS/JASP'
# jmpOpen = ['JMP Pro 14']
# jmpPath = '/Applications JMP Pro 14/Contents/MacOS/JMP'
# juliaOpen = ['Julia-1.2']
# juliaPath = '/Applications/Julia-1.2/Contents/MacOS/applet'
# jupyterPath = '/opt/local/Library/Frameworks/Python.framework/
# Versions/3.7/bin/jupyter-notebook'
# RstudioPathOpen = ['RStudio']
# RstudioPath = '/Applications/RStudio/Contents/MacOS/Rstudio'
#
#
# # Local files
# localPDBfilePath = '$HOME/pdbFiles/'
# localEMAPfilePath = '$HOME/emapFiles/'
# localHKLfilePath = '$HOME/hklFiles/'
#
# # Image manipulation programs
# gimp = '/usr/local/bin/gimp'
# inkscapePath = '/opt/local/bin/inkscape'
# pptOpen = ['Microsoft PowerPoint']
# pptPath = '/Applications/Microsoft Excel/
# Contents/MacOS/Microsoft PowerPoint'
#
#
# # Molecular graphics programs
# ccp4mgPath = '/Applications/ccp4-7.0/ccp4i2/Contents/MacOS/ccp4mg'
# chimeraOpen = ['Chimera']
# chimeraPath = '/Applications/Chimera/Contents/MacOS/chimera'
# cootPath = '/usr/local/bin/coot'
# jmolPath = 'java -jar /Applications/jars/jmol-14.29.52/Jmol.jar'
# yasaraOpen = ['YASARA']
# yasaraPath = '/Applications/YASARA/Contents/MacOS/yasara'
# vmdOpen = ['VMD194']
# vmdPath = '/Applications/VMD194/Contents/MacOS/startup.command'
#
#
# # Text editors
# atomOpen = ['atom']
# atomPath = '/usr/local/bin/atom'
# atomStart = ['start','atom']
# codeOpen = ['code']
# codePath = '/usr/local/bin/code'
# emacsOpen = ['emacs']
# emacsPath = '/opt/local/bin/emacs'
# geditOpen = ['gedit2.30.2']
# geditPath = '/Applications/gedit2.30.2/Contents/MacOS/gedit'
# jeditOpen = ['jEdit']
# jeditPath = '/usr/local/bin/jEdit'
# neovimPath = '$HOME/software/nvim-osx64/bin/nvim'
# nppOpen = ['Notepad++']
# nppPath = '/usr/local//Notepad++/Contents/MacOS/startwine'
# oniOpen = ['Oni']
# oniPath = '/Applications/Oni/Contents/MacOS/Oni'
# pdbedPath = 'java -jar /Applications/jars/PDB_Editor_FIX090203.jar'
# sublOpen = ['subl']
# sublimeText3Path = '/usr/local/bin/subl'
# textmatePath = '/usr/local/bin/mate'
# textmateOpen = ['mate']
# vimPath = '/usr/local/bin/vim'
#
#
# #Terminals
# itermOpen = ['iTerm','-n','"`pwd`"']
# terminalOpen = ['Terminal','-n','"`pwd`"']
# x11termOpen = ['XQuartz','-n','"`pwd`"']
#
#
# # Web sites
# gcalPath = 'firefox https://calendar.google.com/calendar/r'
# gmailPath = 'firefox https://mail.google.com/mail/u/0/#inbox'
# webmailPath = 'firefox https://webmail.ouhsc.edu'
# weatherServicePath = 'firefox https://radar.weather.gov/
# radar.php?rid=TLX'
#
# wordProcessor
# wordOpen = ['open','-a','Microsoft Word']
#
# # Optional local mirror of the PDB
# local_mirror_divided = '/mnt/bio/db/pdb.divided'
# ########## Windows Start Commands and PATHS to Applications #########
#
# # Data analysis
# DBBrowserSQLiteStart = ['start','DBBrowserForSQLite']
# DBBrowserSQLitePath = '/Applications/DBBrowserForSQLite.exe/
# Contents/MacOS/DB Browser for SQLite'
# excelStart = ['start','Microsoft Excel']
# excelPath = '/Applications/Microsoft
# Excel.exe/Contents/MacOS/Microsoft Excel'
# jabrefStart = ['start','JabRef.exe']
# '/Applications/JabRef.exe/Contents/MacOS/JavaApplicationStub'
# jabrefPath = '/Applications/JabRef.exe/Contents/MacOS/
# JavaApplicationStub'
# jaspStart = ['start','JASP.exe']
# jaspPath = 'Applications/JASP.exe/Contents/MacOS/JASP'
# jmpStart = ['start','JMP Pro 14.exe']
# jmpPath = '/Applications/JMP Pro 14.exe/Contents/MacOS/JMP'
# juliaStart = ['start','Julia-1.2.exe']
# juliaPath = '/Applications/Julia-1.2.exe/Contents/MacOS/applet'
# jupyterPath = '/opt/local/Library/Frameworks/
# Python.framework/Versions/3.7/bin/jupyter-notebook'
# RstudioPathStart = ['start','RStudio']
# RstudioPath = '/Applications/RStudio.exe/Contents/MacOS/Rstudio'
#
#
# # Local files
# localPDBfilePath = '$HOME/pdbFiles/'
# localEMAPfilePath = '$HOME/emapFiles/'
# localHKLfilePath = '$HOME/hklFiles/'
#
# # Image manipulation programs
# gimp = '/usr/local/bin/gimp'
# inkscapePath = '/opt/local/bin/inkscape'
# pptStart = ['start','Microsoft PowerPoint']
# pptPath = '/Applications/Microsoft Excel.exe/
# Contents/MacOS/Microsoft PowerPoint'
#
#
# # Molecular graphics programs
# ccp4mgPath = '/Applications/ccp4-7.0/ccp4i2.exe/Contents/MacOS/ccp4mg'
# chimeraStart = ['start','Chimera.exe']
# chimeraPath = '/Applications/Chimera.exe/Contents/MacOS/chimera'
# cootPath = '/usr/local/bin/coot'
# jmolPath = 'java -jar /Applications/jars/jmol-14.29.52/Jmol.jar'
# yasaraStart = ['start','YASARA.exe']
# yasaraPath = '/Applications/YASARA.exe/Contents/MacOS/yasara.exe'
# vmdStart = ['start','VMD194.exe']
# vmdPath = '/Applications/VMD194.exe/Contents/MacOS/startup.command'
#
# # Text editors
# atomStart = ['start','atom']
# atomPath = '/usr/local/bin/atom'
# atomStart = ['start','atom']
# codeStart = ['start','code']
# codePath = '/usr/local/bin/code'
# codeStart = ['start','code']
# emacsStart = ['start','emacs']
# emacsPath = '/opt/local/bin/emacs'
# geditStart = ['start','gedit2.30.2.exe']
# geditPath = '/Applications/gedit2.30.2.exe/Contents/MacOS/gedit'
# jeditStart = ['start','jEdit.exe']
# jeditPath = '/Applications/jEdit.exe/Contents/MacOS/jedit'
# neovimPath = '/Users/blaine/software/nvim-osx64/bin/nvim'
# nppStart = ['start','Notepad++.exe']
# nppPath = '/Applications/Notepad++.exe/Contents/MacOS/startwine'
# oniStart = ['start','Oni.exe']
# oniPath = '/Applications/Oni.exe/Contents/MacOS/Oni'
# pdbedPath = 'java -jar /Applications/jars/PDB_Editor_FIX090203.jar'
# sublStart = ['start','subl']
# sublimeText3Path = '/usr/local/bin/subl'
# textmatePath = '/usr/local/bin/mate'
# textmateStart = ['start','mate']
# vimPath = '/opt/local/bin/vim'
#
#
# # Terminals
# itermStart = ['start','iTerm.exe','-n','"`pwd`"']
# terminalStart = ['start','Terminal','-n','"`pwd`"']
# x11termStart = ['start','XQuartz','-n','"`pwd`"']
#
# # Web sites
# gcalPath = 'open -a Safari.exe https://calendar.google.com/calendar/r'
# gmailPath = 'open -a
# Safari.exe https://mail.google.com/mail/u/0/#inbox'
# webmailPath = 'open -a Safari.exe https://webmail.ouhsc.edu'
# weatherServicePath = 'open -a Safari.exe # https://radar.weather.gov/radar.php?rid=TLX'
#
# #wordProcessor
# wordStart = ['start','Microsoft Word.exe']
# # Optional local mirror of the PDB
# local_mirror_divided = '/mnt/bio/db/pdb.divided'
# ######################################################################
def ACA():
'''
DESCRIPTION:
Open the American Crystallographic Association Annual Meeting webpage.
USAGE:
ACA
ARGUMENTS:
NA
EXAMPLE:
ACA
MORE DETAILS:
Open the American Crystallographic Association Annual Meeting webpage.
VERTICAL PML SCRIPT:
NA
HORIZONTAL PML SCRIPT:
NA
PYTHON CODE:
def ACA():
url=acaURL
try:
print("Trying to open American Crystallographic Association (ACA) homepage.");
# URL must be in single quotes
webbrowser.open_new_tab(url)
print("Success opening ACA homepage.")
except Exception as e:
print("Webbrowser error: " % e) # prints error if browser is not found
cmd.extend('ACA',ACA)
'''
url=acaURL
try:
print("Trying to open American Crystallographic Association (ACA) homepage.");
# URL must be in single quotes
webbrowser.open_new_tab(url)
print("Success opening ACA homepage.")
except Exception as e:
print("Webbrowser error: " % e) # prints error if browser is not found
cmd.extend('ACA',ACA)
def ALS():
'''
DESCRIPTION:
Open website of the Advanced Light Source.
USAGE:
ALS
ARGUMENTS:
NA
EXAMPLE:
ALS
MORE DETAILS:
Open website of the Advanced Light Source.
VERTICAL PML SCRIPT:
NA
HORIZONTAL PML SCRIPT:
NA
PYTHON CODE:
def ALS():
url=alsURL
try:
print("Trying to open Advanced Light Source (ALS) homepage.");
# URL must be in single quotes
webbrowser.open_new_tab(url)
print("Success opening ALS homepage.")
except Exception as e:
print("Webbrowser error: " % e) # prints error if browser is not found
cmd.extend('ALS',ALS)
'''
url=alsURL
try:
print("Trying to open Advanced Light Source (ALS) homepage.");
# URL must be in single quotes
webbrowser.open_new_tab(url)
print("Success opening ALS homepage.")
except Exception as e:
print("Webbrowser error: " % e) # prints error if browser is not found
cmd.extend('ALS',ALS)
def AO():
'''
DESCRIPTION:
Commands to make ambient occlusion image like those in Qutemole.
USAGE:
AO
ARGUMENTS:
None
EXAMPLE:
AO
MORE DETAILS:
Commands to make ambient occlusion image like those in Qutemole.
Works only with the command line immediately under the command
history window at the top of the gui.
VERTICAL PML SCRIPT:
set_color oxygen, [1.0,0.4,0.4];
set_color nitrogen, [0.5,0.5,1.0];
remove solvent;
as spheres;
util.cbaw;
bg white;
set light_count,10;
set spec_count,1;
set shininess, 10;
set specular,0.25;
set ambient,0;
set direct,0;
set reflect,1.5;
set ray_shadow_decay_factor, 0.1;
set ray_shadow_decay_range, 2;
set depth_cue, 0;
ray
HORIZONTAL PML SCRIPT:
set_color oxygen, [1.0,0.4,0.4];set_color nitrogen, [0.5,0.5,1.0];remove solvent;as spheres;util.cbaw;bg white;set light_count,8;set spec_count,1;set shininess, 10;set specular,0.25;set ambient,0;set direct,0;set reflect,1.5;set ray_shadow_decay_factor, 0.1;set ray_shadow_decay_range, 2;set depth_cue,0;color gray20, symbol c;ray
PYTHON CODE:
def AO():
cmd.set_color("oxygen", "[1.0,0.4,0.4]")
cmd.set_color("nitrogen", "[0.5,0.5,1.0]")
cmd.remove("solvent")
cmd.show_as("spheres")
cmd.util.cbaw()
cmd.bg_color("white")
cmd.set("light_count", "8")
cmd.set("spec_count", "1")
cmd.set("shininess", "10")
cmd.set("specular", "0.25")
cmd.set("ambient", "0")
cmd.set("direct", "0")
cmd.set("reflect", "1.5")
cmd.set("ray_shadow_decay_factor", "0.1")
cmd.set("ray_shadow_decay_range", "2")
cmd.set("depth_cue","0")
cmd.set("ray_opaque_background","on")
cmd.ray()
cmd.extend('AO',AO)
'''
cmd.set_color("oxygen", "[1.0,0.4,0.4]")
cmd.set_color("nitrogen", "[0.5,0.5,1.0]")
cmd.remove("solvent")
cmd.show_as("spheres")
cmd.util.cbaw()
cmd.bg_color("white")
cmd.set("light_count", "8")
cmd.set("spec_count", "1")
cmd.set("shininess", "10")
cmd.set("specular", "0.25")
cmd.set("ambient", "0")
cmd.set("direct", "0")
cmd.set("reflect", "1.5")
cmd.set("ray_shadow_decay_factor", "0.1")
cmd.set("ray_shadow_decay_range", "2")
cmd.set("depth_cue","0")
cmd.set("ray_opaque_background","on")
cmd.ray()
cmd.extend('AO',AO)
def AOBW():
'''
DESCRIPTION:
Commands to make ambient occlusion image like those in Qutemole but coloring with grayscale.
USAGE:
AOBW
ARGUMENTS:
None
EXAMPLE:
AOBW
MORE DETAILS:
Type "help AOD" to see this documentation printed to the command history window.
Select from the command history individual lines of code to build a new script.
Select the hortizontal script at the bottom if retaining most of the commands
in your new script. Copy and paste onto the comand line below. Works only
with the command line immediately under the command history window at
the top of the gui.
VERTICAL PML SCRIPT:
set_color oxygen, [1.0,0.4,0.4];
set_color nitrogen, [0.5,0.5,1.0];
remove solvent;
as spheres;
util.cbaw;
bg white;
gscale
set light_count,10;
set spec_count,1;
set shininess, 10;
set specular,0.25;
set ambient,0;
set direct,0;
set reflect,1.5;
set ray_shadow_decay_factor, 0.1;
set ray_shadow_decay_range, 2;
set depth_cue, 0;
ray
HORIZONTAL PML SCRIPT:
set_color oxygen, [1.0,0.4,0.4];set_color nitrogen, [0.5,0.5,1.0];remove solvent;as spheres;util.cbaw;bg white;gscale;set light_count,8;set spec_count,1;set shininess, 10;set specular,0.25;set ambient,0;set direct,0;set reflect,1.5;set ray_shadow_decay_factor, 0.1;set ray_shadow_decay_range, 2;set depth_cue,0;color gray20, symbol c;ray
PYTHON CODE:
def AOBW():
cmd.set_color("oxygen", "[1.0,0.4,0.4]")
cmd.set_color("nitrogen", "[0.5,0.5,1.0]")
cmd.remove("solvent")
cmd.show_as("spheres")
cmd.util.cbaw()
cmd.bg_color("white")
gscale()
cmd.set("light_count", "8")
cmd.set("spec_count", "1")
cmd.set("shininess", "10")
cmd.set("specular", "0.25")
cmd.set("ambient", "0")
cmd.set("direct", "0")
cmd.set("reflect", "1.5")
cmd.set("ray_shadow_decay_factor", "0.1")
cmd.set("ray_shadow_decay_range", "2")
cmd.set("depth_cue","0")
cmd.set("ray_opaque_background","on")
cmd.ray()
cmd.extend('AOBW',AOBW)
'''
cmd.set_color("oxygen", "[1.0,0.4,0.4]")
cmd.set_color("nitrogen", "[0.5,0.5,1.0]")
cmd.remove("solvent")
cmd.show_as("spheres")
cmd.util.cbaw()
cmd.bg_color("white")
gscale()
cmd.set("light_count", "8")
cmd.set("spec_count", "1")
cmd.set("shininess", "10")
cmd.set("specular", "0.25")
cmd.set("ambient", "0")
cmd.set("direct", "0")
cmd.set("reflect", "1.5")
cmd.set("ray_shadow_decay_factor", "0.1")
cmd.set("ray_shadow_decay_range", "2")
cmd.set("depth_cue","0")
cmd.set("ray_opaque_background","on")
cmd.ray()
cmd.extend('AOBW',AOBW)
def AOD():
'''
DESCRIPTION:
Make ambient occlusion image of any with dark carbon atoms.
USAGE:
AOD
ARGUMENTS:
None
EXAMPLE:
AOD
MORE DETAILS:
Type "help AOD" to see this documentation printed to the command history window.
Select from the command history individual lines of code to build a new script.
Select the hortizontal script at the bottom if retaining most of the commands
in your new script. Copy and paste onto the comand line below. Works only
with the command line immediately under the command history window at
the top of the gui.
VERTICAL PML SCRIPT:
set_color oxygen, [1.0,0.4,0.4];
set_color nitrogen, [0.5,0.5,1.0];
remove solvent;
as spheres;
util.cbaw;
bg white;
set light_count,8;
set spec_count,1;
set shininess, 10;
set specular,0.25;
set ambient,0;
set direct,0;
set reflect,1.5;
set ray_shadow_decay_factor, 0.1;
set ray_shadow_decay_range, 2;
set depth_cue, 0;
color gray20, symbol c
color gray90, symbol h
ray
HORIZONTAL PML SCRIPT:
set_color oxygen, [1.0,0.4,0.4];set_color nitrogen, [0.5,0.5,1.0];remove solvent;as spheres;util.cbaw;bg white;set light_count,8;set spec_count,1;set shininess, 10;set specular,0.25;set ambient,0;set direct,0;set reflect,1.5;set ray_shadow_decay_factor, 0.1;set ray_shadow_decay_range, 2;set depth_cue,0;color gray20, symbol c;color gray70, symbol h;ray
PYTHON CODE:
def AOD():
cmd.set_color("oxygen", "[1.0,0.4,0.4]")
cmd.set_color("nitrogen", "[0.5,0.5,1.0]")
cmd.remove("solvent")
cmd.show_as("spheres")
cmd.util.cbaw()
cmd.set_color("carbon", "[0.00 , 0.00 , 0.0]")
cmd.bg_color("white")
cmd.set("light_count","8")
cmd.set("spec_count", "1")
cmd.set("shininess", "10")
cmd.set("specular", "0.25")
cmd.set("ambient", "0")
cmd.set("direct", "0")
cmd.set("reflect", "1.5")
cmd.set("ray_shadow_decay_factor", "0.1")
cmd.set("ray_shadow_decay_range", "2")
cmd.set("depth_cue","0")
cmd.color("gray20", "symbol c")
cmd.color("gray90", "symbol h")
cmd.set("ray_opaque_background","on")
cmd.ray()
cmd.extend("AOD",AOD)
'''
cmd.set_color("oxygen", "[1.0,0.4,0.4]")
cmd.set_color("nitrogen", "[0.5,0.5,1.0]")
cmd.remove("solvent")
cmd.show_as("spheres")
cmd.util.cbaw()
cmd.set_color("carbon", "[0.00 , 0.00 , 0.0]")
cmd.bg_color("white")
cmd.set("light_count","8")
cmd.set("spec_count", "1")
cmd.set("shininess", "10")
cmd.set("specular", "0.25")
cmd.set("ambient", "0")
cmd.set("direct", "0")
cmd.set("reflect", "1.5")
cmd.set("ray_shadow_decay_factor", "0.1")
cmd.set("ray_shadow_decay_range", "2")
cmd.set("depth_cue","0")
cmd.color("gray20", "symbol c")
cmd.color("gray90", "symbol h")
cmd.set("ray_opaque_background","on")
cmd.ray()
cmd.extend("AOD",AOD)
def APS():
'''
DESCRIPTION:
Open website of the Advanced Photon Source.
USAGE:
APS
ARGUMENTS:
NA
EXAMPLE:
APS
MORE DETAILS:
Open website of the Advanced Photon Source.
VERTICAL PML SCRIPT:
NA
HORIZONTAL PML SCRIPT:
NA
PYTHON CODE:
def APS():
url=apsURL
try:
print("Trying to open Advanced Photon Source (APS) homepage.");
# URL must be in single quotes
webbrowser.open_new_tab(url)
print("Success opening APS homepage.")
except Exception as e:
print("Webbrowser error: " % e) # prints error if browser is not found
cmd.extend('APS',APS)
'''
url=apsURL
try:
print("Trying to open Advanced Photon Source (APS) homepage.");
# URL must be in single quotes
webbrowser.open_new_tab(url)
print("Success opening APS homepage.")
except Exception as e:
print("Webbrowser error: " % e) # prints error if browser is not found
cmd.extend('APS',APS)
def BST():
'''
DESCRIPTION:
G2G3/U9U8 base step , PDB code 4PCO.
USAGE:
BST
ARGUMENTS:
None
EXAMPLE:
BST
MORE DETAILS:
G2G3/U9U8 base step , PDB code 4PCO.
From the 1.32 Angstrom resolution structure
of the RNA decamer with 8 GU base pairs.
VERTICAL PML SCRIPT:
delete all;
fetch 4PCO, type=pdb, async=0;
select G2G3, ( ((resi 2 or resi 3) and chain A) or ((resi 8 or resi 9) and chain B));
remove not G2G3;
bg_color white;
show sticks;
set stick_radius=0.14;
set stick_ball, on;
set stick_ball_ratio,1.9;
set_view
(-0.75,0.09,0.66,-0.2,0.92,-0.35,-0.64,-0.39,-0.67,-0.0,-0.0,-43.7,7.24,9.55,11.78,29.46,57.91,-20.0);
remove name H*;
select carbon1, element C and (resi 3 or resi 8)
# select lower base pair;
select carbon2, element C and (resi 2 or resi 9)
#select upper base pair;
color gray70, carbon1;
color gray10, carbon2;
show sticks;
space cmyk;
distance hbond1, /4PCO//B/U`9/N3,/4PCO//A/G`2/O6;
distance hbond2, /4PCO//B/U`9/O2,/4PCO//A/G`2/N1;
distance hbond3, /4PCO//A/U`3/N3,/4PCO//B/G`8/O6;
distance hbond4, /4PCO//A/U`3/O2,/4PCO//B/G`8/N1;
color black, hbond1;
color black, hbond2;
color gray70, hbond3;
color gray70, hbond4;
show nb_spheres;
set nb_spheres_size, 0.35;
hide labels;
ray 1600,1000;
png 4PCO.png
HORIZONTAL PML SCRIPT:
delete all;fetch 4PCO, type=pdb, async=0;select G2G3, ( ((resi 2 or resi 3) and chain A) or ((resi 8 or resi 9) and chain B));hide cartoon;set valence, off;remove not G2G3;bg_color white;show sticks;set stick_radius=0.14;set stick_ball, on;set stick_ball_ratio,1.9;set_view(-0.75,0.09,0.66,-0.2,0.92,-0.35,-0.64,-0.39,-0.67,-0.0,-0.0,-43.7,7. dd24,9.55,11.78,29.46,57.91,-20.0);remove name H*;select carbon1, element C and (resi 3 or resi 8);select carbon2, element C and (resi 2 or resi 9);color gray70, carbon1;color gray10, carbon2;show sticks;space cmyk;distance hbond1, /4PCO//B/U`9/N3,/4PCO//A/G`2/O6;distance hbond2, /4PCO//B/U`9/O2,/4PCO//A/G`2/N1;distance hbond3, /4PCO//A/U`3/N3,/4PCO//B/G`8/O6;distance hbond4, /4PCO//A/U`3/O2,/4PCO//B/G`8/N1;color black, hbond1;color black, hbond2;color gray70, hbond3;color gray70, hbond4;show nb_spheres;set nb_spheres_size, 0.35;hide labels;ray 1600,1000;png 4PCO.png
PYTHON CODE:
def BST():
cmd.reinitialize()
cmd.fetch('4PCO', type='pdb')
cmd.select('G2G3', '( ((resi 2 or resi 3) and chain A)or ((resi 8 or resi 9) and chain B) )')
cmd.hide('cartoon')
cmd.set('valence', 'off')
cmd.remove('not G2G3')
cmd.bg_color('white')
cmd.set('stick_radius', '0.14')