-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
2827 lines (2279 loc) · 170 KB
/
index.html
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<head>
<!-- official OU colors: crimson #4F1315 cream #FDF908 source: https://alumni.ou.edu/home/webcomm/webguide/designconsiderations.html -->
<!-- off white #f5f4f0 reddish slate #E4D2C1 OU brickred #4F1315 light green #FFEFB2 light blue #F6F8FF light-green #fceeaf royal blue #0D2A70 light-green #FFFCCC light gray F6F4F0 -->
<!--<body bgcolor=#FDF9D8 style="font-family:arial;font-size:15px"> -->
<link rel="stylesheet" href="style.css">
<style type="screen.css">
<style>
a {
text-decoration: none;
}
a:link {
color: #6b5b95;
}
a:visited {
color: #feb236;
}
a:hover {
color: #d64161;
}
</style>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<!-- Format code blocks. Must use code tag inside of pre tags to get the block effect-->
<style type="text/css">
pre code {
background-color: #eee;
border: 1px solid #999;
display: block;
padding: 20px;
}
</style>
<!-- Format the vertical spacing in lists. border:1px solid grey;-->
<style type="text/css">
li{
margin-top: 10px;
}
li:first-child {
margin-top:0;
}
</style>
<!-- Format table -->
<style>
<!--
table.table1 {
border:1px solid #0F2080;
width:100%;
table-layout:fixed;
}
table.table1 caption {
font-family: Arial, Helvetica, sans-serif;
text-align: center;
margin-bottom: 5px;
font-size: 240%;
padding: 5px;
font-weight: bold;
}
table.table1 tbody>tr>:nth-child(1){
color:#0F2080;
text-align:center;
font-size: 2em;
width: 40;
}
table.table1 tbody>tr>:nth-child(2){
text-align:center;
width: 200;
}
table.table1 tbody>tr>:nth-child(3){
color:#0F2080;
text-align:left;
padding: 10px;
font-size: 1.2em;
word-wrap:break-word;
width: 200;
}
table.table1 th {
font-size: 1.4em;
border:1px solid #0F2080;
text-align:center;
}
table.table1 td{
border:1px solid;
color: #0F2080;
}
table.table2 {
border:1px solid black;
width:100%;
table-layout:fixed;
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
table.table2 tbody>tr>:nth-child(1){
color:black;
text-align:left;
font-size: 1em;
border: 1px solid black;
text-align: left;
padding: 8px;
width: 50px;
}
table.table2 tbody>tr>:nth-child(2){
color:black;
text-align:left;
font-size: 1em;
border: 1px solid black;
text-align: left;
padding: 8px;
width: 300px;
}
table.table2 th {
font-size: 1.4em;
border:1px solid black;
text-align:center;
}
table.table2 tr:nth-child(even) {
background-color: #dddddd;
}
-->
</style>
<!--
table.table2 td, th {
border: 1px solid #A95AA1;
text-align: left;
padding: 8px;
}
-->
<style type="text/css">
<!--
.tab { margin-left: 25px; }
-->
</style>
<!-- tab a section -->
<STYLE TYPE="text/css">
<!--
.indented
{
padding-left: 50pt;
padding-right: 50pt;
}
-->
</STYLE>
<!-- tab a section -->
<STYLE TYPE="text/css">
ul {
list-style-position: inside;
padding-left: 0;
}
</STYLE>
<!-- A nice ligth grey: bgcolor=#f5f4f0 -->
</head>
<body style="font-family:Arial, Helvetica, sans-serif; font-size:15px">
<h1> <em>pymolsnips:</em> PyMOL Script Writing with Code Templates</h1>
<h2> <a name="FASTLINKS">Quick links for the impatient</a></h2>
<ul>
<li> <a href="#gallery"> Gallery of examples</a></li>
<li> <a href="#FASTLINKS3"> Snippet categories</a></li>
<li> <a href="#editors"> List of supported text editors</a></li>
<li> <a href="#install"> Demos and installation instructions by text editor</li>
<li> <a href="#Snippet Lists">List of snippets by category and tab trigger name</a></li>
</ul>
<a href="https://github.com/MooersLab/pymolsnips"> <h2> Go back to the MooersLab/pymolsnips GitHub page</h2></a>
<p>
<a href="https://pymol.org/2/">PyMOL</a> is a leading molecular graphics program for making images of proteins and nucleic acids for publication.
PyMOL's vast array of parameters provides exquisite control over the appearance of the output.
PyMOL is often used to make cover images for <a href="https://pymolwiki.org/index.php/Main_Page">scientific journals</a>.
PyMOL is also popular for making movies of molecules.
</p>
<p>
The PyMOL GUI is useful for making the images of global scenes, but PyMOL rapidly becomes tedious to use to make images of detailed scenes.
The PyMOL macro language (pml) can be used to set parameter values and execute commands to make customized scenes of biomolecules in PyMOL's viewport.
These scenes can be made into static images for posters, seminars, and manuscripts, or they can serve as parts of molecular movies.
The macro language sends arguments to Python functions, but its syntax is simpler for non-programmers to understand than the syntax of Python code.
</p>
<p>
Over 100 lines of pml commands and settings are required to make more sophisticated images.
It is difficult to issue so many commands through PyMOL's graphical user interface (GUI) without making mistakes.
If the commands are not saved to an open script file with a <em>.pml</em> file extension, to an opened log file, or to a frequently saved session file, the work can be lost.
(Use the <b>spse</b> function in the <em>pymolshortcuts.py</em> file in the <a href="https://github.com/MooersLab/pymolshortcuts">pymolshortcuts</a> repository to save session files with time stamps to avoid overwriting previously saved session files.)
</p>
<p>
Here are of some figures that are impossible or tedious to make via the PyMOL GUI alone. You may have to refresh the web browser several times to get all of the images to display.
</p>
<!-- ![Gallery](https://github.com/MooersLab/pymolsnips/blob/master/images/Gallery.png?raw=true "Gallery") -->
<link rel="stylesheet" href="style.css">
<a name="gallery"> </a>
<table class="table1">
<caption> Gallery </caption>
<tr>
<th WIDTH="40">Tab trigger</th>
<th WIDTH="200">Output from code </th>
<th WIDTH="100"><b>Category</b> and Description </th>
</tr>
<tr>
<td> ao</td>
<td><img src="./images/ao.png" alt="HTML5 Icon" style="width:600px;height:600px;"> </td>
<td><b>ambient occlusion</b> <p>Applies a photorealistic effect. The effect is not available via a GUI pulldown mean. This code can be applied to any molecule in the sphere representaton. It applies ray tracing so moving the molecule in the viewport ruins the effect. Enter <b>hide spheres</b> to remove the spheres.</p> </td>
</tr>
<tr>
<!-- pdb code 5d99, 27-mer RNA hairpin -->
<td>aod</td>
<td align="center"><img src="./images/5d99AOD.png" alt="HTML5 Icon" style="width:468px;height:741px;"> </td>
<td align="left"><h4>ambient occlusion</h4> <p>This variant of ambient occulusion colors the carbon atoms black. This code can be applied to any molecule in the sphere representation.</p> </td>
</tr>
<tr>
<!-- pdb code 5d99, 27-mer RNA hairpin -->
<td>aobw</td>
<td><img src="./images/AOBWdsRNA.png" alt="HTML5 Icon" style="width:364px;height:630px;"> </td>
<td><h4>ambient occlusion</h4> <p>This is the grayscale verison of ambient occlusions. Grayscale is not an option available through a pulldown in PyMOL. This code can be applied to any molecule in the sphere representation.</p> </td>
</tr>
<tr>
<!-- pdb code 3nd3 -->
<td>aodbw</td>
<td align="center"><img src="./images/U8AODBW.png" alt="HTML5 Icon" style="width:459px;height:874px;"> </td>
<td align="left"><h4>ambient occlusion</h4> <p>This variant of ambient occulusion colors the carbon atoms black and then applies grayscale. Grayscale is not an option available through a pulldown in PyMOL. This code can be applied to any molecule in a sphere representation. (PBD: code 3nd3).</p> </td>
</tr>
<tr>
<td>bsfr</td>
<td align="center"><img src="./images/frbsBluWhiteBG.png" alt="HTML5 Icon" style="width:630px;height:630px;"> </td>
<td align="left"><h4>ball-and-stick plus filled rings</h4> <p>Ball-and-stick plus filled rings applied to only the ligand pralsetinib (FDA approved) from the complex with RET kinase <a href="https://www.rcsb.org/structure/7JU5" >(PDB code 7JU5)</a>. In the snippet, you need to redefine the selection which is mapped to the molecular object that is called <b>ligand</b></p> </td>
</tr>
<tr>
<td>bw</td>
<td align="center"><img src="./images/bw.png" alt="HTML5 Icon" style="width:300px;height:300px;"> </td>
<td align="left"><h4>black and white cartoon</h4> <p>This code can be applied to any molecule in a sphere, surface, or cartoon representation.</p></td>
</tr>
<tr>
<td>carved</td>
<td align="center"><img src="./images/carved.png" alt="HTML5 Icon" style="width:300px;height:246px;"> </td>
<td align="left"><h4>carved electron density</h4> <p>A 2Fo-Fc electron density map is carved around a glycan.</p></td>
</tr>
<tr>
<td>coordinate</td>
<td align="center"><img src="./images/coordinate.png" alt="HTML5 Icon" style="width:300px;height:224px;"> </td>
<td align="left"><h4>coordinate covalent bonds</h4> <p>Example of specifying coordinate covalent bonds between RNA and a sodium (colored purple). The coordinate covalent bonds are not diplayed by default in PyMOL; each atom pair in a coordinate covlent bond has to be specficied. The H-bonds were also specifid. This snippet can be used as a template for the commands needed to display coordinate covalent bonds and H-bonds.</p> </td>
</tr>
<tr>
<td>filledring</td>
<td align="center"><img src="./images/filledring.png" alt="HTML5 Icon" style="width:284px;height:300px;"> </td>
<td align="left"><h4>filled-ring cartoon for nucleic acids</h4> <p>Filled ring cartoon for nucleic acids with the backbone highlighted by a flat ribbon.</p> </td>
</tr>
<tr>
<td>sc222</td>
<td align="center"><img src="./images/sc222.png" alt="HTML5 Icon" style="width:300px;height:200px;"> </td>
<td align="left"><h4>Generate 2 x 2 x 2 array of unit cells with symmetry mates.</h4> <p>Run Thomas Holder's script supercell.py to generate 2 x 2 x 2 array of unit cells with symmetry mates filling the unit cells.</p> </td>
</tr>
<tr>
<td>stack</td>
<td align="center"><img src="./images/stack.png" alt="HTML5 Icon" style="width:300px;height:166px;"> </td>
<td align="left"><h4>Base stacking</h4> <p>Base stacking figure for a pair of base pairs with the top base pair colored dark to enhance the depth perception. The major groove is on the top.</p> </td>
</tr>
</table>
<p>
It is challenging to recall the pml syntax when you are not using PyMOL every day, which is the situtation for most PyMOL users.
One solution to this problem is to use a library of code fragments, called <b>snippets</b> or <b>templates</b>, to build a script in a text editor.
</p>
<h3>Brief Notes on Installation and Updates</h3>
<p>
Users may want to update their copy of the library as new snippets are added to the library on GitHub.
The date of the last update and its nature are recorded in the GitHub repository.
GitHub has only experimental support for downloading part of a repository.
In the meantime, users must download the entire repository either as a zip file via the <b>code → download zip</b> pull-down menu or by entering the command <b>git clone https://github.com/MooersLab/pymolsnips.git</b> if they have git on their computer.
The second option enables subsequent updating of the library via the <b>git pull origin master</b> command.
</p>
<h3>Navigating this document</h3>
<p>
This document has over 12,000 words.
You do not need to read much of it to get started.
Just go to the section below about your favorite text editor to learn how to learn the snippet library.
</p>
<p>
This long document has a large number of hyperlinks that enable rapid movement to desired sites below and the return to the menus at the top of the file.
The hyperlinks reduce the need to scroll through the document.
Some of the text is hidden from view and has to be toggled or unfolded to expose it.
</p>
<p>
If you are considering switching text editors or have never used one, then you should invest an hour in reading the synopses of the 18 supported text editors.
This can serve as a guide to selecting a text editor.
</p>
<p>
<em>pymolsnips</em> is a library of pml code fragments that have been formatted for several popular <em>text editors</em>.
Note that the word processors (e.g., MS Word, Libre Office, Open Office) are not included here: <em>word processors should never be used to store computer code!</em>
If you do so, you can inadvertently pick up hidden characters that are hard to find and remove during debugging.
In addition, word processing documents are usually binary files that are difficult to put under version control.
</p>
<p>
Text editors have tools for supporting the editing of computer code files.
Although these files have many different file extensions that map them to the programming language of the code that they contain, they are all plain text files.
One of the editing tools available in text editors is support for the retrieval and insertion of computer code fragments (i.e, snippets) to save time and reduce errors while assembling a new script file.
</p>
<p>
Protocols for snippet installation for each text editor are found <a href="#install"> below</a>.
Some editors take snippet libraries in one file while other editors require that each snippet resides in a separate file.
Most editors have their own format for snippets.
The user downloads the file or folder of snippet files for their text editor and then installs the snippets according to the requirements for a particular text editor.
The one exception is the CudaText editor.
The pymolsnips snippets come pre-installed with this editor.
</p>
<p>
Each code fragment has a unique name that also serves as a tab trigger.
The user enters the name of the code snippet and hits the <b>tab</b> key to insert the lines of code.
Tab stops exist at sites where parameters can be edited.
Tab stops are mirrored when the parameters are identical.
Mirroring enable the simultaneous editing of these sites to reduce the chance of overlooking a site that needed editing.
</p>
<p>
The animation below demonstrates the use of the <b>ao</b> tab trigger in <em>Visual Studio Code</em> to insert 16 lines of code for generating the ambient occlusion effect.
You can learn how this is done <a href="#VisualStudioCode"> here </a>.
Two-levels of cascading menus appear.
The menu on the left shows the alternate tab triggers that contain the letters <b>a</b> and <b>o</b>.
The corresponding code for the selected tab trigger is displayed in the right window.
By entering these two letters, you have inserted 16 lines of code!
</p>
<p align="center"><img src="gifs/VSCaoSnip.gif"></p>
<p>
One thing to note when using tab stops is that the mirrored selections are very <em>fragile</em>:
Before you begin typing, make sure that the mirrored sections are all highlighted.
It is easy to exit the tab stop selections by the click of a mouse or even a keyboard movement!
Getting your selections re-highlighted is not difficult, but the required steps vary between text editors.
Find more information about mirrored tab stops in the installation instructions for each text editor.
</p>
<p>
The animation below demonstrates the use of mirrored tab stops where changed default values are mirrored at identical sites.
If mirrored tab stops are available for a text editor, you can learn more about them in the installation instructions of that text editor.
</p>
<p align="center"><img src="gifs/VSCMirror.gif"></p>
<a href=#FASTLINKS>Return to quick links section at top</a>
<hr>
<a name="FASTLINKS3"> <h2> Snippet categories: </h2></a>
<p>
Each snippet is described below.
The snippets are grouped into categories.
Hyperlinks will take you to a particular category.
</p>
<ul>
<li><a href="#Alternate locators"> Alternate locators </a></li>
<li><a href="#Change orientation"> Change orientation </a></li>
<li><a href="#Color scheme"> Color scheme </a></li>
<li><a href="#Electron density"> Electron density </a></li>
<li><a href="#FileIO"> FileIO</a></li>
<li><a href="#H-bonds">H-bonds</a></li>
<li><a href="#Help">Help</a></li>
<li><a href="#Jupyter">Jupyter</a></li>
<li><a href="#Labels">Labels</a></li>
<li><a href="#List Snippets">List Snippets</a></li>
<li><a href="#Measurements">Measurements</a></li>
<li><a href="#Molecular representation">Molecular representation</a></li>
<li><a href="#Nucleic Acids">Nucleic Acids</a></li>
<li><a href="#Objects">Objects</a></li>
<li><a href="#Print">Print</a></li>
<li><a href="#Programming">Programming</a></li>
<li><a href="#Pymolrc">Pymolrc</a></li>
<li><a href="#Selection">Selection</a></li>
<li><a href="#Settings">Settings</a></li>
<li><a href="#Stereo">Stereo</a></li>
<li><a href="#Trajectories">Trajectories</a></li>
<li><a href="#Workshop">Workshop</a></li>
</ul>
<a href=#FASTLINKS>Return to quick links section at top</a>
<hr>
<h2> <a name="editors">Supported text editors:</a> </h2>
<a name="FASTLINKS2"></a>
<p>
PyMOL scripts can be coded in electronic notebook, integrated development environments, and text editors.
All three types of coding platforms support the use of snippets to varying degrees.
Here, we foucs on text editors because the support for editing *pml* code is the strongest with this category of coding environment.
</p>
<p>
Note that some text editors use the same library of snippets.
For example, <em>Emacs</em> and <em>spacemacs</em> can use the same snippet library that is managed by the yasnippets package.
Likewise, <em>Vim</em> and <em>neovim</em> share some of the same plugin managers and snippet libraries.
There are at least three kinds of snippet systems available for <em>Vim</em> and <em>neovim</em>.
</p>
<ul>
<li> <a href="#ATOM"> Atom </a></li>
<li><a href="#bbedit"> BBEdit (limited to Mac OS)</a></li>
<li><a href="#brackets"> Brackets </a></li>
<li> <a href="#cudatext"> CudaText </a></li>
<li> <a href="#emacs"> Emacs (uses <a href="#yasnippets">yasnippets</a> package)</li>
<li> <a href="#espresso"> Espresso </a></li>
<li> <a href="#geany"> Geany </a></li>
<li> <a href="#gedit"> Gedit </a></li>
<li> <a href="#kate"> Kate </a></li>
<li> <a href="#komodo"> Komodo Edit </a></li>
<li> <a href="#LightTable"> Light Table </a></li>
<li> <a href="#micro"> Micro </a></li>
<li> <a href="#Neovim"> Neovim</a> uses the following to manage snippet plugins</li>
<ol>
<li><a href="#Ultisnips">Ultisnips</a></li>
<li><a href="#Neosnippets">Neosnippets</a></li>
<li><a href="#Snipmate">Snipmate</a> plugins to manage snippets) </a></li>
</ol>
<li> <a href="#spacemacs"> Spacemacs (uses yasnippets)</a></li>
<li> <a href="#SublimeText3"> Sublime Text 3 </a></li>
<li> <a href="#TextMate"> TextMate (limited to Mac OS)</a></li>
<li> <a href="#Vim"> Vim </a>(uses Ultisnips, Neosnippets, or Snipmate plugins to manage snippets)</li>
<ol>
<li><a href="#Ultisnips">Ultisnips</a></li>
<li><a href="#Neosnippets">Neosnippets</a></li>
<li><a href="#Snipmate">Snipmate</a> plugins to manage snippets) </a></li>
</ol>
<li> <a href="#VisualStudioCode"> Visual Studio Code </a></li>
</ul>
<a href=#FASTLINKS2>Return to list of editors above.</a ><br>
<a href=#FASTLINKS>Return to the quick links section at top.</a>
<p>
If you are considering switching editors, we recommend Visual Studio Code (VSC).
You do have to install plugins, but the process of doing so is quite painless.
Our second tier of text editors includes would be Sublime Text, Textmate, and Atom.
</p>
<p>
You might also consider <em>Geany</em>.
It is very lightweight, very fast, and very easily configurable.
It is a good editor if you care about agility.
See the following for second opinions on the best Python editor <a href="https://www.slant.co/topics/18408/~python-ides-or-editors-for-beginners">for beginners</a> and <a href="https://www.slant.co/topics/366/~best-python-ides-or-editors"> for all users </a>.
Note that the <em>thonny</em> editor that was recommended for beginners is more of a training tool than a productive tool.
It does not support code snippets, yet.
</p>
<p>
If your favorite editor is not listed, please post an issue <a href="https://github.com/MooersLab/pymolsnips/issues">here</a>.
I will be notified immediately by e-mail and will try to develop a snippet library for the requested editor.
</p>
<p>
Note that some editors that are available as binaries only for Windows like <em>Notepad++</em> can be run on Mac OS or Linux by using wine or wine bottler.
</p>
<p>
Some of these text editors can take hours to customize to fit your needs; however, you only need to know about 5% of the options to become productive with these editors.
</p>
<h1> <a name="install"></a>Installaton instructions by editor</h1>
<a name='ATOM'><h2> Atom (Universal) </h2></a>
<p>
<a href="https://atom.io"><b>Atom</b></a> is a favorite of professional programmers because it is easily extended and customized.
Atom advertises itself to be the "hackable text editor".
It integrates with GitHub nicely, and the GUI is attractive.
</p>
<p>
<em>Atom's</em> startup speed bogs down as more plugins are added.
The work-around is to keep <em>Atom</em> open all of the time.
</p>
<p>
There is an extensive collection of plugins available for <em>Atom</em>.
The installation and updating of plugins can be slow compared to other editors.
</p>
<h3>Installing and using snippets with Atom</h3>
<p>
You will need the <em>snippets</em> package to be able to use the pymolpy snippets.
The package installer is very intuitive.
Go to <b>Packages → Settings View → Install packages/themes</b>.
Search for <em>snippets</em> and click the install button.
It may already be installed, but you must make sure that the snippets package is enabled (green bar along the button).
</p>
<p>
Shown below is an enabled <em>snippets</em> package.
</p>
<p align="center"><img src="gifs/atomSnippetsEnable.gif"></p>
<p>
Others have developed a PyMOL lexer for *Atom* so that you can enjoy syntax highlighting.
Go to <b>Packages → Settings View → Install packages/theme</b> and search for <em>.language-pymol</em>.
Click install.
</p>
<p align="center"><img src="gifs/atomPyLanguageInstall.gif"></p>
<p>
The snippets for all programming languages are stored in a single file that is called <em>snippets.cson</em>.
The snippets for different languages are separated by the first line of a snippet library for a specific language.
This line contains a specification of the scope.
That is the kinds of script files to which a set of snippets applies.
The <em>snippets.cson</em> file is stored in a hidden folder on your home directory called <em>~.atom/snippets.cson</em>.
</p>
<p>
You can concatenate <a href="https://github.com/MooersLab/pymolsnips/tree/master/atompymolsnips">this</a> file of PyMOL snippets for <em>Atom</em> to your existing <em>snippets.cson</em> file.
</p>
<p>
To do this, Mac users enter: <code>cp -a ~/pymolsnips/atompymolsnips/pymolsnippets.cson ~/.atom/snippets.cson</code>
</p>
<p>
You can also access the <em>snippets.cson</em> file via the <b>Welcome Guide</b> of <b>Atom</b>, under the section called <b>Add a Snippet → Open your snippets</b>.
Or, you can access the <em>snippets.cson</em> file through <b>Atom (menu) → Snippets...</b>.
</p>
<p>
For windows users, it might be easiest to access the <em>snippets.cson</em> file via the <em>Welcome Guide</em>.
Paste the <em>snippets.cson</em> provided <a href="https://github.com/MooersLab/pymolsnips/tree/master/atompymolsnips">here</a> into this file.
</p>
<p>
A third option available for windows users, is to navigate to the <em>.atom</em> folder through the GUI of <b>File Explorer</b> and open the <em>snippets.cson</em> file.
</p>
<p>
Below is an example of the <em>threeMaps</em> snippet and a demonstration of its mirrored tab stops.
</p>
<p align="center"><img src="gifs/AtomSnipsUse.gif"></p>
<a href=#FASTLINKS2>Return to list of editors above.</a >
<a name='bbedit'><h2> BBEdit (Mac only) </h2></a>
<p>
<a href="https://www.barebones.com/products/bbedit/index.html"><b>BBEdit</b></a> requires a license and a one-time fee.
Major upgrades require additional fees. You will need macOS 10.14.2 or later.
</p>
<p>
The snippet system for <em>BBedit</em> is simple and elegant.
The snippets are stored as clippings with one snippet or clipping per file.
The PyMOL pml snippets end with the file extension <em>*.pml</em>.
The clippings can be stored in folders by language.
</p>
<h3>Installing and using snippets with BBEdit</h3>
<p>
Users can create nested subfolders for groups of related snippets.
The folders of clippings are stored in <code>~/Library/Application\ Support/BBEdit/Clippings</code>.
You will need to add <a href="https://github.com/MooersLab/pymolsnips/tree/master/bbeditpymolsnips">this</a> snippets folder to your BBEdit clippings.
</p>
<p>
To do this, enter <code>cp -a ~/pymolsnips/bbeditpymolsnips ~/Library/Application\ Support/BBEdit/Clippings/</code>.
</p>
<p>
The disadvantages of these clippings include the lack of tab triggers and tab stops.
There is also presently the lack of a PyMOL lexer for syntax highlighting.
</p>
<a href=#FASTLINKS2>Return to list of editors above.</a >
<a name='brackets'><h2> Brackets (Universal) </h2></a>
<p>
The development of <a href="http://brackets.io"><em>Brackets</em></a> is lead by a team at Adobe.
*Brackets* was designed for web developers with a focus on HTML, CSS, and JavaScript.
However, <em>Brackets</em> now has support for a large number of languages.
<em>Brackets</em> provides a Quick Edit and a Live Preview mode that run simultaneously, so changes in the <em>pml</em> code are dispayed immediately in the preview window.
</p>
<p>
<em>Brackets</em> has icons, located on the right panel, for navigating to the interactive settings on the application.
The zig-zag line launches the Live Preview.
The lego piece launches the extension manager.
Once you install an extension, a light bulb icon will appear that launches the <b>Snippets Manager</b>.
</p>
<h3>Installing and using snippets with Brackets</h3>
<p>
Go to <b>File → Extension Manager</b> or press the lego piece in the right panel.
Search for <b>Brackets Snippets (by edc)</b> and install it.
This is the snippet manager.
It has a GUI that enables the manual creation of user-defined snippets.
</p>
<p align="center"><img src="gifs/bracketsExtInstall.gif"></p>
<p>
The GUI should automatically refresh, but if not, close and reopen *Brackets*.
The light bulb icon will now appear in the right panel.
Click on the light bulb to open the <b>Snippets Manager</b>.
</p>
<p>
The <b>settings</b> tab opens a menu with an import button.
Click <b>import</b> and choose the <a href="https://github.com/MooersLab/pymolsnips/tree/master/bracketspymolsnips"><em>bracketspymolsnips.yml</em></a> file that is available at the top of this page.
You have to download the file to your computer.
</p>
<p>
All of the snippets for PyMOL are in this single file.
The next step is to choose the import scheme.
I chose the recommended option to skip snippets with the same tab trigger name.
</p>
<p align="center"><img src="gifs/bracketsSnipsInstall.gif"></p>
<p>
Until the PyMOL language is available via a lexer for <em>Brackets</em>, use Python for the scope of the pml files.
The Python lexer will provide some syntax highlighting.
This means that the PyMOL file needs to have a file extension of <em>.py</em> while it is being edited in *Brackets*.
When finished, save this file with the <em>.pml</em> extension to be able to use it in PyMOL.
</p>
<p>
In the example of snippet use shown below, notice how all snippets that begin with <b>a</b> are suggested.
Only when I press <b>o</b> do the suggestions narrow.
This is helpful when you cannot remember the short-hand for a snippet.
</p>
<p align="center"><img src="gifs/bracketsSnipsUse.gif"></p>
<p>
Unfortunately, <em>Brackets</em> does not currently support tab stops.
</p>
<a href=#FASTLINKS2>Return to list of editors above.</a>
<a name='cudatext'><h2> CudaText (Universal)</h2></a>
<p>
<a href="http://uvviewsoft.com/cudatext/"><em>CudaText</em></a> is a free, cross-platform editor that is written in Lazarus, a variant of Pascal.
<em>Cudatext</em> is open source.
Its predecessor was <em>SynWrite</em>, which is no longer supported.
<em>CudaText</em> has numerous plugins available to it.
A PyMOL lexer and PyMOL snippets are available through the <em>CudaText</em> add-ons manager (thank you Alexey T.!).
The documentation for <em>CudaText</em> is located <a href="http://wiki.freepascal.org/CudaText">here</a>.
</p>
<h3>Installing and using snippets with CudaText</h3>
<p>
<em>CudaText</em> uses Python3 based plugins.
<em>CudaText</em> expects to find the Python3.X from <a href="https://www.python.org/downloads/release/python-374/">Python.org</a>.
I downloaded the 64-bit version of Python3.7.4 from Python.org and used the installer to install the binary in about five minutes.
This Python interpreter is installed in the <em>/Applications</em> directory on the Mac.
When I started <em>CudaText</em>, I did not have to edit any configuration files.
The snippets are stored one per file.
The files have the extensions of <em>.cuda-snippet</em>.
<em>CudaText</em> snippets have names (i.e., descriptions), ids (i.e., tab triggers), and markers (i.e., tab stops).
<em>CudaText</em> snippets are stored in the user's Library on the Mac: <b>./Library/Application\ Support/CudaText/data/snippets/Std.PML</b> folder.
</p>
<p>
You may have to create the <em>Std.PML</em> folder by giving the following bash command: <code>$ mkdir ./Library/Application\ Support/CudaText/data/snippets/Std.PML/</code>
</p>
<p>
When executing <em>CudaText</em> for the first time on Windows, it will prompt you with the need for the extraction of files.
Proceed with the extraction and choose where you want the files to be extracted.
I chose to store it under <code>C:\Users\YOURUSERNAME\AppData\Roaming\CudaText</code> where I created the folder CudaText.
</p>
<p>
Create the <em>Std.PML</em> sub directory under <code>C:\Users\YOURUSERNAME\AppData\Roaming\CudaText\data\snippets</code>.
</p>
<p>
Any snippet add-on will automatically be installed in this directory.
Paste the files (not the folder) of <em>cudatextpymolsnips</em> into the <em>Std.PML</em> folder.
</p>
<p>
After starting <em>CudaText</em>, install the snippets plugin by navigating to the <b>Plugins → Addons Manager → Install</b> and search for <b>plugin: Snippets</b> and select it.
A pop-up window will appear asking you if you would like to install, click OK.
I could not screen capture this pop-up window.
</p>
<p align="center"><img src="gifs/CudaTextpluginInstall.gif"></p>
<p>
You will also need to use the same pull-down to install the <em>lexer: PyMOL</em> and the <em>snippets: PyMOL</em>.
Restart <em>CudaText</em> to see the changes.
When editing snippets or plugins in <b>CudaText</b> you can also update them by going to <b>Plugins → Addons Manager → Update</b>.
<p>
<p>
<em>CudaText</em> allows you to edit mirrored sites for uniform editing.
The animation below shows how to edit one mirror location and travel to the other mirrored sites by hitting the Tab key.
<p>
<p align="center"><img src="gifs/cudatextMirror.gif"></p>
<a href=#FASTLINKS2>Return to list of editors above.</a>
<a name='emacs'><h2> Emacs (universal)</h2></a>
<p>
<a href="http://uvviewsoft.com/cudatext/"><em>Emacs</em></a> is a free, open-source, cross-platform editor that is written in <em>Emacs</em> lisp (elisp), a variant of LISP.
LISP was developed in the early 1960s to support work on artificial intelligence.
<em>Emacs</em> was initiated in 1976 by Richard M. Stallman and others.
<em>Emacs</em> has a leadership succession plan that has been put into action.
Richard Stallman stepped away from the project in 2008, and others took over the maintenance of the core program.
This plan will greatly extend the lifetime of this software project.
</p>
<p>
<em>Emacs</em> has been around for 45 years.
According to Lindy's Law, the future life expectancy of a software program is proportional to its current age, so every additional period of survival implies a longer remaining life expectancy.
This law suggests that <em>Emacs</em> should be around for another 45 years.
</p>
<p>
Over 100 other variants of <em>Emacs</em> are available.
<em>Spacemacs</em> has a gentler learning curve in part because it can be driven by a menu of commands that is readily accessible.
<em>Spacemacs</em> allows the use of <em>Vim</em> key bindings, <em>Emacs</em> key bindings, or both.
<em>Spacemacs</em> does have its own keybindings that have to be mastered.
This leads to the problem of needing to translate <em>Spacemacs</em> to <em>GNU Emacs</em> and back again when tapping into external <em>Emacs</em> resources.
</p>
<p>
<em>Doom Emacs</em> and <em>Prelude Emacs</em> are additional popular variants of <em>Emacs</em> that are suppose to be easier to adopt.
They are similar to <em>Spacemacs</em>.
</p>
<p>
<em>SciMax</em> is a variant of <em>Emacs</em> that is being optimized to support scientific publication and literate programming.
</p>
<p>
For several reasons, we recommend becoming productive in <em>GNU Emacs</em> first before trying the <em>Emacs</em> variants.
First, the on-line resources that support mastery of GNU <em>Emacs</em> are far greater than the resources that support the variants.
Second, the documentation for the variants assume significant prior knowledge of <em>GNU Emacs</em>.
Third, these variants run on top of <em>GNU Emacs</em>.
You will eventually have to learn <em>GNU Emacs</em> as you master one of these variants.
</p>
<p>
It takes one to two weeks of nibbling away at <em>GNU Emacs</em> tutorials to become productive at text editing in <em>Emacs</em>.
There is a built-in tutorial in <em>GNU Emacs</em> as well as many on-line tutorials.
A visually appealing tutorial is available <a href="https://www.gnu.org/software/emacs/tour/">here</a>.
</p>
<p>
It takes several months to become competent in <em>Emacs</em>.
It takes a life-time to master <em>Emacs</em> hence <em>Emacs</em> is known as a <b>life-time editor</b>.
</p>
<p>
The one danger of <em>Emacs</em> is that it is easy to spend countless of hours configuring the <em>init.el</em> file and adding additional packages.
Many beginners spend too much time adding too many packages, most of which they never use.
We know this from personal experience.
As a beginner, you should ease off editing your <em>init.el</em> file if it has grown to 500 lines in the first several weeks of using <em>Emacs</em>.
A good practice is to add one package at a time and master each added package before adding another new package.
</p>
<p>
I find that editing of <em>init.el</em> file occurs in widely spaced bouts.
Once everything is working to your satisfaction, there may be long periods of productivity during which there is no compelling need to fiddle with the <em>init.el</em> file.
</p>
<p>
Many <em>Emacs</em> users have shared their <em>init.el</em> files on GitHub.
These can provide inspiration for the beginner.
Some have complex configurations that are often too complex to be copied and applied by the beginner.
</p>
<p>
Many of the add-on packages add functionalities that are not available in other text editors or that become available years later.
The vast group of active contributors to <em>Emacs</em> will probably keep it in the lead for a long time into the future.
</p>
<p>
Like PyMOL, GNU <em>Emacs</em> was designed to be highly extensible.
This is a large part of its popularity.
Over 4600 packages have been developed by users over the years.
Several package managers, including the <a href="https://melpa.org">melpa</a>, greatly ease package installation.
However, manual installation is often quite simple.
</p>
<p>
The interface to <em>Emacs</em> is either an X-terminal window or a simple GUI that can be made complex by opening many <em>buffers</em>, which are like windows.
The management and navigation of buffers is a skill that the beginner needs to master early.
</p>
<p>
<em>Emacs</em> is designed to enable mouse free work although some buffers require that selections be made by using the mouse.
<em>Emacs</em> is infamous for having 1800 key bindings involving multiple keys.
The key bindings make heavy use of the alt or meta key.
However, there is in-line documentation, and some packages provide autosuggestions that greatly ease the discovery of new key bindings.
You only really need to memorize several dozen key bindings to become productive in <em>Emacs</em>.
The remaining knowledge is easy to acquire on an <em>as-needed</em> basis.
</p>
<p>
<em>Vim</em> users can quickly become productive in <em>Emacs</em> because the <em>Vim</em> key bindings are available through the add-on package called evil-mode.
Mastery of the <em>Vim</em> key bindings in <em>Vim</em> is initially painful because it is like learning how to type for the first time.
Here again, mastery of a few dozen key bindings will enable you to be productive in <em>Vim</em> and in Evil-mode in <em>Emacs</em>.
<em>Vim</em> key bindings are thought to bear more efficient for editing text than <em>Emacs</em> key-bindings, so their availability in <em>Emacs</em> greatly enhances a <em>Vim</em> user's productivity in </em>Emacs</em>.
</p>
<p>
Mastery of <em>Vim</em> key-bindings is a wise investment because they are available in many text editors and IDEs.
They are even available in <em>Jupyter Notebooks</em>!
In addition, <em>Vim</em> is more widely distributed than <em>Emacs</em>.
</p>
<p>
If you use a national laboratory computer system, restrain your fantasy of being able to transfer your <em>init.el</em> file and reestablish your <em>Emacs</em> computing environment.
Many national facilities use Centos Linux and are unable or unwilling to make available the most recent stable version of <em>Emacs</em>.
I have found that the available versions are several years out of date and hence difficult to install all of my favorite packages.
It may take an hour of removing calls to install incompatible packages before you can establish a subset of your favorite packages.
Hence, it is good to have the ability to tolerate getting by for short periods of time with older versions of <em>Emacs</em> without all of your favorite packages.
</p>
<p>
Modes in <em>Emacs</em> are states of <em>Emacs</em> where a subset of commands are available.
Modes avoid clashes due to functions of the same name in different packages.
Modes are analogous to scopes in other text editors.
For example, there is a python-mode for working with Python script files.
</p>
<p>
Some modes are multilingual and have many additional non-editing functions.
One such mode is org-mode.
Org-mode was originally designed to be a planning and outlining tool.
Its ease of use for outlining lead to its extension to support literate programming in numerous programming languages.
</p>
<p>
<em>Org-mode</em> has over 100 add-on packages.
For example, the org-ref package greatly eases the retrieval of pdfs, and the creation of BibTex entries.
The latter is done in an automated fashion by using the metadata in the pdf files.
</p>
<p>
The <em>.emacs.d</em> configuration directory is a hidden directory in the home directory.
This directory is the home of the installed packages and plugins.
The main configuration file resides is this directory and is named <em>init.el</em>.
The <em>init.el</em> file is the analog of <em>Vim</em> 's <em>.vimrc</em> configuration file.
The commands in the <em>init.el</em> file are written in elisp.
Fortunately, <em>elisp</em> is easy to edit and augment without knowing much about how to program with <em>elisp</em>.
</p>
<p>
I store my configuration in a <em>config.org</em> file (see file listing at top of page).
The org file is written in org-mode markdown.
The lisp commands are placed in code blocks .
The code is extracted from the oth file and
</p>
<h3>Installing <em>Emacs</em></h3>
<p>
Like <em>Vim</em>, <em>Emacs</em> can be installed as a stand-a-lone application or via a software management tool and a software repository.
</p>
<p>
<em>Emacs</em> can be downloaded <a href="https://www.gnu.org/software/emacs/">from</a> and insalled with a platform specific installer.
Older versions of <em>Emacs</em> comes pre-installed on Mac OS, but you may want a more recent version.
You should remove the old version(s) of Emacs with the commands <code>sudo rm /usr/bin/emacs</code> and <code>sudo rm -rf /usr/share/emacs</code>.
Binaries for the Mac are <a href="https://emacsformacosx.com">available</a>.
As of August 2020, version 27.1-1 is the stable release.
</p>
<p>
<em>Emacs</em> is also available for a number of software repositories.
It can be installed on the Mac with macports using the command <code>sudo port install emacs </code>.
A GUI based version can be installed with the command <code>sudo port install emacs-app </code>.
The Homebrew repository for Mac OS is popular.
The brew command is <code>brew update && brew install emacs --with-cocoa && brew linkapps emacs </code>.
</p>
<p>
You may want to create an alias for starting <em>Emacs</em>.
For the development version of the binary in installed in Applications with the above package installer for the make use, <code>e28='open /Applications/Emacs2805.app $1'</code>.
For the app version installed by macports, use <code>e27='open -a /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs'</code>.
For Homebrew installed <em>Emacs</em>, use <code> alias emacs='/usr/local/Cellar/emacs/24.x/Emacs.app/Contents/MacOS/Emacs -nw' </code>.
</p>
<h3>Installing and using snippets with <em>Emacs</em></h3>
<p>
The package yasnippets is one of the most popular packages in <em>Emacs</em> for managing snippets.
This package provides for the display of the snippets in a table that opens in a separate buffer.
The user can navigate the table to find a relevant snippet.
This table is redundant with the ls snippet.
</p>
<p>
The <a href="https://www.emacswiki.org/emacs/Yasnippet"><em>yasnippets</em></a> package is used to manage snippets in <em>Emacs</em>.
This package is installed with a built-in package manager.
</p>
<p>
Each snippet is stored in a single file.
The files are stored in a subfolder in the hidden folder <code>~/.eamcs.d/plugins</code> in the home directory.
</p>
<h1>Variants of <em>Emacs</em> to consider</h1>
<p>
These variants might be suitable for the impatient who do not want to master <em>GNU Emacs</em>.
</p>
<h2>Spacemacs</h2>
<p>
<a href="https://www.spacemacs.org">Spacemacs</a> (see below) is built ontop of GNU <em>Emacs</em>.
It is designed to be easier to use than <em>Emacs</em>.
It can be operated with <em>Vim</em>, <em>Emacs</em>, or a hybrid of key bindings.
You enable layers to extend its functionality.
<em>Spacemacs</em> can be used to edit <em>Jupyter Notebooks</em> via the Ipython-layer.
</p>
<h2><em>SciMax</em></h2>
<p>
<a href="http://kitchingroup.cheme.cmu.edu/scimax"><em>SciMax</em></a> is being developed by the chemical engineer John Kitchin at Carnegie Mellon University.
This variant of <em>Emacs</em> is being optimized for supporting the preparation of scientific manuscripts.
Several YouTube videos of Professor Kitchin talking about <em>SciMax</em> are available.
<em>SciMax</em> is on the to-be-added later list because the documentation for this project is lagging so the user has to be more self-reliant.
Hence, our recommendation to become competent with <em>Gnu Emacs</em> before diving into <em>SciMax</em>.
</p>
<h2><em>Prelude Emacs</em></h2>
<p>
This variant of <em>Emacs</em> is <em>GNU Emacs</em> bundled with what the developer thinks are the essential, no-frills add-on packages.
It does not ship with evil-mode.