├── .gitignore
├── IntroEasyPyMOL.png
├── LICENSE
├── ProteinScience.png
├── README.md
├── exam2.py
├── exam2Windows.py
├── quat.py
├── quatWindows.py
├── roundview.py
├── roundviewWindows.py
├── site31labels.pml
├── site31labelsWindows.pml
├── startupAliases.py
├── startupAliasesWindows.py
├── wtT4L.py
└── wtT4LWindows.py
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 |
5 | # C extensions
6 | *.so
7 |
8 | # Distribution / packaging
9 | .Python
10 | env/
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | *.egg-info/
23 | .installed.cfg
24 | *.egg
25 |
26 | # PyInstaller
27 | # Usually these files are written by a python script from a template
28 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
29 | *.manifest
30 | *.spec
31 |
32 | # Installer logs
33 | pip-log.txt
34 | pip-delete-this-directory.txt
35 |
36 | # Unit test / coverage reports
37 | htmlcov/
38 | .tox/
39 | .coverage
40 | .coverage.*
41 | .cache
42 | nosetests.xml
43 | coverage.xml
44 | *,cover
45 |
46 | # Translations
47 | *.mo
48 | *.pot
49 |
50 | # Django stuff:
51 | *.log
52 |
53 | # Sphinx documentation
54 | docs/_build/
55 |
56 | # PyBuilder
57 | target/
58 |
--------------------------------------------------------------------------------
/IntroEasyPyMOL.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MooersLab/EasyPyMOL/098426f55712bf4eb737c9da75f8f6f032ccbf69/IntroEasyPyMOL.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc. {http://fsf.org/}
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see {http://www.gnu.org/licenses/}.
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | pymol Copyright (C) 2013 Javier Otegui
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | {http://www.gnu.org/licenses/}.
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | {http://www.gnu.org/philosophy/why-not-lgpl.html}.
675 |
--------------------------------------------------------------------------------
/ProteinScience.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MooersLab/EasyPyMOL/098426f55712bf4eb737c9da75f8f6f032ccbf69/ProteinScience.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 | [](https://opensource.org/licenses/MIT)
3 |
4 |
5 | # PyMOL made easier with horizontal scripting
6 | *Script to facilitate the making of horizontal scripts*
7 |
8 | [](https://zenodo.org/badge/latestdoi/20847/MooersLab/EasyPyMOL)
9 |
10 | Welcome to the `EasyPyMOL` repository, which implements horizontal scripting with PyMOL described in the manuscript:
11 | "[Simplifying and enhancing the use of PyMOL with horizontal scripts](http://onlinelibrary.wiley.com/doi/10.1002/pro.2996/abstract;jsessionid=3BFE5B68AD44844F55AAE6E273D88375.f02t03)" published in the September 2016 issue of Protein Science.
12 |
13 | See this 4-minute introductory video.
14 | Scroll down to find tutorial videos about downloading the scripts from GitHub and installing them on Windows, Linux, mac PyMOLX11 and Mac PyMOL:
15 |
16 | ### Click on the image immediately below to start the video (4:17 min).
17 |
18 | [](https://www.youtube.com/watch?v=XRsAaKq4afs)
19 |
20 |
21 | Video Highlights for Protein Science methods paper: Simplifying and enhancing the use of PyMOL with horizontal scripts.
22 | ### Click on the image immediately below to start the video (5:43 min).
23 | [](http://www.youtube.com/watch?v=96lSGbrcnyw)
24 |
25 |
26 | #### Ambient occlusion image of phage T4 lysozyme made with the alias "AO"
27 | The 17 commands that are on 17 lines in a traditional vertical script were placed on one line as a horizontal script.
28 |
29 |
30 |
31 |
32 | #### Ribbon diagram of the above molecule made with the alias "T4L"
33 | Another image is made with a horizontal script.
34 |
35 |
36 |
37 | ### Problem:
38 | the viewport settings returned on seven lines with line continuation symbols from the command [`get_view()`](http://pymolwiki.org/index.php/Get_View) in [PyMOL](https://www.pymol.org/) are too hard to copy and paste onto the command line because the line breaks have to be removed. These settings are often changed many times while editing a new scene.
39 |
40 | ```python
41 | PyMOL>get_view
42 |
43 | ### cut below here and paste into script ###
44 | set_view(\
45 | -0.832868993, 0.398498207, 0.383896619,\
46 | -0.260102808, -0.894237876, 0.363985002,\
47 | 0.488390923, 0.203309149, 0.848513067,\
48 | 0.000000000, 0.000000000, -61.396984100,\
49 | -46.246913910, -4.663769245, 42.401920319,\
50 | 56.260883331, 66.533096313, -20.000000000 )
51 | ### cut above here and paste into script ###
52 | ```
53 |
54 | ### Solution:
55 | The function `roundview()` in the script [`roundview.py`](.\roundview.py), which is available from this website.
56 |
57 | ```
58 | PyMOL>roundview
59 | set_view(-0.83,0.4,0.38,-0.26,-0.89,0.36,0.49,0.2,0.85,0.0,0.0,-61.4,-46.25,-4.66,42.4,56.26,66.53,-20.0);
60 | ```
61 |
62 | Paste the above reformatted [`set_view()`](http://pymolwiki.org/index.php/Set_View) command onto the PyMOL [command line](http://pymolwiki.org/index.php/Command_Line_Options) in the external gui or into a [script](http://www.pymolwiki.org/index.php/Running_Scripts) in a plain text editor.
63 |
64 | ### What is the `roundview()` function?
65 |
66 | The Python script roundview.py includes the function `roundview()` that reformats the viewing port settings from seven rows to one row. The more compact format from `roundview()` is easy to copy and paste onto the command line. Other commands that are separated by semicolons can be added to the command line along with the settings. This defines a horizontal script. The script can include comments that are isolated by semicolons. The horizontal script can be edited and tested repeatedly within PyMOL for many cycles without using an external text editor. This saves time during the development of a new molecular scene. The cursor can be moved around quickly on the command line with the readline commands:
67 |
68 | * **cntrl-a** moves the cursor to the beginning of the line
69 | * **cntrl-e** moves the cursor to the end of the line
70 | * **shift-cntrl-a** selects everything to from the cursor to the beginning of the line
71 | * **shift-cntrl-e** selects everything to from the cursor to the end of the line
72 | * **command-f** move forward by one word
73 | * **commend-b** move backward by one word
74 |
75 | ### Requirements
76 |
77 | Requires a molecular object loaded into an interactive session of PyMOL. Does not require any modules other than two in PyMOL. Should work on all versions of PyMOL.
78 | Tested on:
79 | * Ubuntu 14.04 64 bit with PyMOL 1.7.2.2.
80 | * Windows 8 32 bit running PyMOL 1.7.6.2 and PyMOL 1.7.6.6.
81 | * Mac OSX 10.10.5 64 bit running PyMOL 1.5.0.5, 1.7.6.6 (via MacPorts), 1.8.0.5, and 1.8.2.0.
82 |
83 | We tried to make the code backward compatible with PyMOL 1.5. However, we do not guarantee that this code works with earlier versions of PyMOL or that it will not fail in future versions. Several changes in PyMOL version 1.6 reduced the backward compatibility. We also do not guarantee that the code will work if you install it in a location other than that described below.
84 |
85 | ### Instructions
86 |
87 | #### Quick start instructions for beginning users of Github
88 |
89 | Click on the image immediately below to watch 1-minute video or read on.
90 |
91 | [](https://www.youtube.com/watch?v=XRsAaKq4afs)
92 |
93 |
94 | Copy the script from [this link](https://github.com/MooersLab/EasyPyMOL/blob/master/roundview.py) after clicking on "RAW" in the upper right corner and paste it into a plain text file (NOT a doc, docx, or rtf file). Name the script [`roundview.py`](./roundview.py). Save the file to your home directory (e.g., /Users/username or /home/username or C:\Users\username). Start PyMOL. Check that PyMOL's current directory is the home directory by entering `pwd` on the command line in PyMOL. Check for the presence of roundview.py by entering `ls *.py` on the command line in PyMOL.
95 |
96 | Note that the scripts were developed on a Mac, and most have UTF-8 encoding instead of ASCII encoding, as expected on Windows. A second set of script files was opened in Sublime Text and saved with Western encoding for Windows, with the filename modified with Windows appended.
97 | The line below in the scripts for Mac and Linux instructs the Python interpreter to read the file with utf-8 encoding.
98 | #-*- coding: utf-8 -*-
99 |
100 | ```shell
101 | ls *.py
102 | ```
103 | Paste the following horizontal script on the command line just below the command history window in the top or external gui:
104 | ```shell
105 | fetch 1lw9, async=0; run roundview.py; roundview 0,1
106 | ```
107 | You should see the following in the command history window of the top gui:
108 | ```shell
109 | set_view (1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,-155.2,35.1,11.5,9.7,122.3,188.0,-20.0);
110 | ```
111 |
112 | Type the following to see the default format from get_view.
113 | ```shell
114 | get_view
115 | ```
116 |
117 | Which output looks easier to copy from the command history window and paste onto the command line in PyMOL?
118 |
119 | #### More advanced ways to install roundview.py
120 |
121 | Get the script. Either download the folder from [this link](https://github.com/MooersLab/EasyPyMOL/archive/master.zip) or type the following command in a terminal window in your home directory or the directory where you store your PyMOL Python scripts
122 |
123 | ```shell
124 | git clone https://github.com/MooersLab/EasyPyMOL.git
125 | ```
126 |
127 | You need the program [Git](https://git-scm.com/) installed on your computer. Git is available via MacPorts or otherwise [see these instructions for installing git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
128 |
129 |
130 | There are at least four different ways of loading the script into PyMOL:
131 |
132 | 1. move [`roundview.py`](./roundview.py) to the working directory. Then in PyMOL, type
133 |
134 | ```py
135 | run roundview.py
136 | ```
137 | Please note that the `run` command just loads the script into PyMOL. It does not execute it. Now the "roundview()" command is available by typing `roundview` and the on-line documentation is available by typing "help roundview".
138 |
139 | 2. load [`roundview.py`](./roundview.py) with the plugin manager (see plugin pulldown) in PyMOL
140 |
141 | 3. copy [`roundview.py`](./roundview.py) to a safe folder that will not be deleted when you delete PyMOL. I use `~/Scripts/PyMOLScripts/`. Then load `roundview()` into PyMOL using method 1 or 2.
142 |
143 | 4. create or edit the hidden text file `.pymolrc` (named `pymolrc.pml` and not hidden on Windows) in the home directory so that it includes the following lines so that `roundview.py` is always loaded upon startup. This option also works without the first two lines.
144 | ```py
145 | import sys
146 | sys.path.append('/Path/To/roundview')
147 | run /Path/To/roundview.py
148 | ```
149 | For example:
150 | ```py
151 | import sys
152 | sys.path.append('/Users/blaine-mooers/Scripts/PyMOLScripts/')
153 | run /Users/blaine-mooers/Scripts/Scripts_PyMOL/roundview.py
154 | ```
155 | Restart PyMOL. You should see something like the following in the command history window if your path to the script is correct.
156 | ```py
157 | PyMOL>import sys
158 | PyMOL>sys.path.append('/Users/blaine-mooers/Scripts/PyMOLScripts/')
159 | PyMOL>run /Users/blaine-mooers/Scripts/Scripts_PyMOL/roundview.py
160 | ```
161 |
162 | Type `roundview` on either command line. You should get back the following in the command history window if no molecule is loaded:
163 | ```py
164 | set_view (1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,-50.0,0.0,0.0,0.0,40.0,100.0,-20.0);
165 | ```
166 |
167 |
168 | ## roundview.py installation video for PyMOL on Windows (4:20 minutes):
169 |
170 | ### Click on the image immediately below to start video.
171 |
172 |
173 | [](https://www.youtube.com/watch?v=C0NWphiTEYE)
174 |
175 |
176 | Note that the scripts were developed on a Mac and most have utf-8 encoding instead of ascii encoding as expected on Windows. A second set of script files were opened in Sublime Text and saved with Western encoding for Windows and with the filename modified with Windows appended.
177 | The line below in the scripts for Mac and Linux instructs the Python interpreter to read the file with utf-8 encoding.
178 | #-*- coding: utf-8 -*-
179 |
180 |
181 | ## roundview.py installation video for PyMOL on Linux and PyMOLX11Hybrid on Mac (3:24 minutes):
182 |
183 | ### Click on the image immediately below to start video.
184 |
185 | [](https://www.youtube.com/watch?v=XQWQzq48DeA)
186 |
187 |
188 |
189 | ## Link to roundview.py installation video for MacPyMOL (5:50 minutes):
190 |
191 | ### Click on the image immediately below to start video.
192 |
193 | [](https://www.youtube.com/watch?v=XTwwWgwj4z0)
194 |
195 |
196 | #### How to run
197 | ---------------
198 |
199 | After loading a pdb file and setting up the molecular scene, type on a command line in PyMOL:
200 |
201 | ```
202 | PyMOL>roundview
203 | ```
204 |
205 | ##### How to get help
206 |
207 | Type the following on a command line in PyMOL
208 |
209 | ```
210 | PyMOL> help roundview
211 | ```
212 |
213 | Something like the following should be printed to the command history window:
214 |
215 | Usage: `roundview [view, decimal places, outname]`
216 | * The values in the [ ] are optional.
217 | * The default view is "0".
218 | * The default number of `decimal places` is 2.
219 | * The `outname` is the name of a plain text file to which the output of `roundveiw()` is written.
220 |
221 | Quick test with wildtype bacteriophage T4 lysozyme, 3fa0
222 | --------------------------------------------------------------------------------
223 |
224 | Start PyMOL. Copy and paste the entire line below onto the command line in the external gui (the on above the GL viewing port). This is an example of a horizontal script. By hitting the up arrow key, you can recall this command for editing on the command line. This code block is more agile to edit than opening, editing, saving, and loading an external script file.
225 |
226 | ```
227 | fetch 3fa0,async=0;orient;turn z,-90;turn y,-5;turn x,10; hide everything; bg_color white; show cartoon;color red, ss H;color yellow, ss S;color green, ss L+'';roundview
228 | ```
229 |
230 | To apply the canonical view similar to that in [Gassner et al. 2003](http://www.ncbi.nlm.nih.gov/pubmed/12646375), copy and paste the following onto the command line:
231 |
232 | ```
233 | set_view (-0.18,-0.69,-0.7,0.98,-0.17,-0.09,-0.06,-0.7,0.71,0.0,0.0,-154.87,34.77,11.27,9.52,121.27,188.47,-20.0); ray 1500,1600; png canonical.png
234 | ```
235 |
236 | You should get back an image that looks like the following:
237 |
238 |
239 |
240 | To test some other argument values, copy and paste the following command into PyMOL.
241 |
242 | ```
243 | PyMOL>roundview 0,1,firstscene.txt
244 | ```
245 |
246 | Do a `ls *.txt` to list the files in the working directory. The file "firstscene.txt" should be listed. The default filename is "roundedview.txt". This file is appended with each execution of the roundview command. You may find it easier to copy the set_view line from this text file than from the command history window in PyMOL.
247 |
248 | ## Scripts that use aliases to horizontal scripts. Some aliases contain compact scene settings from `roundview()`.
249 |
250 | ### Exam2function.py
251 |
252 | Defines aliases `q1-q8` for questions 1-8 from exam 2 of the OUHSC Macromolecular Systems [course](https://apps.ouhsc.edu/studentinfo/Courses.aspx?College=GRAD). Each alias is mapped to a number of commands.
253 |
254 | 1. Create `~/Scripts/PyMOLScripts` and store the script in this subfolder.
255 |
256 | 1. Enter on the command line in PyMOL the following command:
257 |
258 | ```
259 | run ~/Scripts/PyMOLScripts/exam2function.py
260 | ```
261 |
262 | 1. Type `q1` to execute the alias associated with exam question 1.
263 |
264 | 1. Type `help q1` to print the documentation to the PyMOL command history window.
265 | The bottom of the documentation includes the corresponding horizontal script.
266 | All or parts of the horizontal script can be copied from the command history
267 | window for reuse of the code in another horizontal script or a traditional
268 | vertical script.
269 |
270 | Tested on PyMOL versions 1.5.0.5, 1.7.7.2 (from macports), and 1.8.0.5.
271 |
272 |
273 | ### StartupAliases.py
274 |
275 | 1. Copy to ~/Scripts/PyMOLScripts/.
276 |
277 | 1. Add this command on one line in your .pymolrc file (pymolrc.pml on Windows):
278 |
279 | ```shell
280 | run ~/Scripts/PyMOLScripts/StartUpAliases.py
281 | ```
282 |
283 | Now these aliases will be available whenever you startup PyMOL.
284 |
285 | 1. Type the `alias ` to execute it.
286 |
287 | 1. Type `help alias name` to see the documentation, which includes a vertical list of the commands mapped to the alias to ease the copying of isolated commands from the command history window during code reuse. The corresponding horizontal script without line breaks is also printed. It can be selected in the command history window and pasted onto the command line.
288 |
289 | Format of list below:
290 |
291 | Alias name, description: PDB code, where applicable.
292 |
293 | #### Molecules in standard orientations:
294 |
295 | * **T4L**, WT T4 lysozyme (1.09 ang) as a ribbon diagram: 3fa0.
296 | * **U8**, 16-mer dsRNA with 8 contiguous Us. U-helix RaNA (1.37 ang): 3nd3.
297 | * **WC8**, 16-mer RNA with all Watson-Crick base pairs (1.67 ang): 3nd4.
298 | * **N9**, neuraminidase as cartoon, biological unit (1.55 ang): 4dgr.
299 | * **GGT**, gamma glutamyl transpeptidase as cartoon (1.67 ang): 4gdx.
300 | * **GU**, 10-mer RNA with eight GU base pairs (1.32 ang): 4pco.
301 |
302 |
303 | #### Complex figures to serve as templates:
304 |
305 | * **BST**, Base-stacking figure, (1.32 ang): 4pco.
306 | * **LG**, Electron density map of nine sugar glycan,(1.55 ang):, 4dgr.
307 | * **NA**, Sodium cation in major groove of 16-mer RNA: 3nd4.
308 |
309 |
310 | #### Complex representations applied to any visible molecular object:
311 |
312 | * **AO**, Make ambient occlusion image. Requires global view of protein.
313 | * **BU**, Display biological unit.
314 | * **CB**, Define color blind compatible coloring scheme.
315 | * **BW**, Make black and white ribbon cartoon on white background.
316 | * **CSS**, Color ribbon and cartoons by secondary structure: red, green and yellow.
317 | * **CBSS**, Color ribbon and cartoons with colorblind friendly colors.
318 | * **CR**, Commands to make colored filled-ring cartoon of nucleic acids..
319 | * **FR**, Commands to make filled-ring cartoon of nucleic acids.
320 |
321 | #### Demo 1:
322 |
323 | Type `T4L` on the command line. Now type "AO". You should get an image like the following:
324 |
325 |
326 |
327 |
328 | Type `help AO` on the command line to see the documentation for the `AO` alias. It is mapped to 17 commands.
329 |
330 | PyMOL>help AO
331 |
332 | DESCRIPTION
333 |
334 | Commands to make ambient occlusion image like those in Qutemole.
335 |
336 |
337 | USAGE
338 | Type 'AO' to execute. Type 'help AO' to see this documentation
339 | printed to the command history window. Select from the command
340 | history individual lines of code to build a new script. Select the
341 | horizontal script at the bottom if retaining most of the commands
342 | in your new script. Copy and paste onto the command line below.
343 | Works only with the command line immediately under the command
344 | history window in the top (external) gui.
345 |
346 | The commands with linebreaks:
347 |
348 | set_color oxygen, [1.0,0.4,0.4];
349 | set_color nitrogen, [0.5,0.5,1.0];
350 | remove solvent;
351 | as spheres;
352 | util.cbaw;
353 | bg white;
354 | set light_count,10;
355 | set spec_count,1;
356 | set shininess, 10;
357 | set specular,0.25;
358 | set ambient,0;
359 | set direct,0;
360 | set reflect,1.5;
361 | set ray_shadow_decay_factor, 0.1;
362 | set ray_shadow_decay_range, 2;
363 | unset depth_cue;
364 | ray
365 |
366 | The commands without linebreaks:
367 |
368 | 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;unset depth_cue;ray
369 |
370 | #### Demo 2:
371 |
372 | Type `T4L` on the command line. Now type `BW`. You should get a black and white image like the following. These black and white figures are useful when color figures are not needed:
373 |
374 |
375 |
376 |
377 | #### Demo 3:
378 |
379 | Type `U8` on the command line. Convert the cartoon to a black-and-white image with `BW`.
380 |
381 |
382 |
383 | #### Demo 4:
384 |
385 | Type 'help NA' to see a very long script mapped to two a letter command.
386 |
387 | DESCRIPTION
388 |
389 | Hydrated sodium cation bound in major groove of a
390 | 16-mer RNA of Watson-Crick base pairs.
391 | The sodium is bound to the N7 nitrogen atom of
392 | Adenine 3 at 1.55 Angstrom resolution, PDB code 3nd4.
393 | 57 commands were used to make this figure.
394 |
395 | More than one label in a horizontal script is not
396 | allowed. This one label has to be at the end of the line.
397 | Labels can be imported from a Labels.pml file.
398 | Store the label commands one per row in this file.
399 | Import the file with the @Labels.pml command.
400 | Include the path to the file if the labels file is not
401 | in the current working directory of PyMOL.
402 |
403 |
404 | USAGE
405 |
406 | Type `NA` to activate. Type `help NA` to see this documentation
407 | printed to the command history window. Select from the command
408 | history individual lines of code to build a new script. Select the
409 | horizontal script at the bottom if retaining most of the commands
410 | in your new script. Copy and paste onto the command line below.
411 | Works only with the command line immediately under the command
412 | history window at the top of the gui.
413 |
414 | delete all;
415 | viewport 900,600;
416 | fetch 3nd4, type=pdb, async=0;
417 | run ~/Scripts/PyMOLScripts/quat.py;
418 | quat 3nd4;
419 | show sticks;
420 | set stick_radius=0.125;
421 | hide everything, name H*;
422 | bg_color white;
423 | create coorCov, (3nd4_1 and (resi 19 or resi 119 or resi 219 or resi 319 or resi 419 or resi 519 or (resi 3 and name N7)));
424 | bond (coorCov//A/NA`19/NA),(coorCov//A/A`3/N7);
425 | bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`119/O);
426 | bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`219/O);
427 | bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`319/O);
428 | bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`419/O);
429 | bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`519/O);
430 | distance (3nd4_1 and chain A,and resi 19 and name NA), (3nd4_1 and chain A and resi 519);
431 | distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 419);
432 | distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 119);
433 | distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 319);
434 | distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 219);
435 | show nb_spheres;
436 | set nb_spheres_size, .35;
437 | distance hbond1,/3nd4_1/1/A/HOH`119/O, /3nd4_1/1/A/A`3/OP2;
438 | distance hbond2,/3nd4_1/1/A/HOH`319/O, /3nd4_1/1/A/A`3/OP2;
439 | distance hbond3,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/HOH`119/O;
440 | distance hbond4,/3nd4_1/1/A/G`4/N7,/3nd4_1/1/A/HOH`91/O;
441 | distance hbond5,/3nd4_1/1/A/G`4/O6, /3nd4_1/1/A/HOH`419/O;
442 | distance hbond6,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/G`4/OP2;
443 | distance hbond7,/3nd4_1/1/A/HOH`319/O,/3nd4_1/1/A/G`2/OP2;
444 | distance hbond9,/3nd4_1/1/A/HOH`419/O,/3nd4_2/2/A/HOH`74/O;
445 | distance hbond10,/3nd4_2/2/A/C`15/O2,/3nd4_1/1/A/G`2/N2;
446 | distance hbond11, /3nd4_2/2/A/C`15/N3,/3nd4_1/1/A/G`2/N1;
447 | distance hbond12,/3nd4_2/2/A/C`15/N4,/3nd4_1/1/A/G`2/O6;
448 | distance hbond13, /3nd4_2/2/A/U`14/N3,/3nd4_1/1/A/A`3/N1;
449 | distance hbond14,3nd4_2/2/A/U`14/O4,/3nd4_1/1/A/A`3/N6;
450 | distance hbond15, /3nd4_2/2/A/C`13/N4,/3nd4_1/1/A/G`4/O6;
451 | distance hbond16,/3nd4_2/2/A/C`13/N3, /3nd4_1/1/A/G`4/N1;
452 | distance hbond17, /3nd4_1/1/A/G`4/N2,/3nd4_2/2/A/C`13/O2;
453 | distance hbond18,/3nd4_1/1/A/G`2/N2,/3nd4_2/2/A/C`15/O2;
454 | distance hbond19,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/G`4/OP2;
455 | set depth_cue=0;
456 | set ray_trace_fog=0;
457 | set dash_color, black;
458 | set label_font_id, 5;
459 | set label_size, 36;
460 | set label_position, (0.5, 1.0, 2.0);
461 | set label_color, black;set dash_gap, 0.2;
462 | set dash_width, 2.0;set dash_length, 0.2;
463 | set label_color, black;set dash_gap, 0.2;
464 | set dash_width, 2.0;set dash_length, 0.2;
465 | select carbon, element C;
466 | color yellow, carbon;
467 | disable carbon;
468 | set_view (-0.9,0.34,-0.26,0.33,0.18,-0.93,-0.27,-0.92,-0.28,-0.07,-0.23,-27.83,8.63,19.85,13.2,16.0,31.63,-20.0)
469 |
470 | Commands without linebreaks for easy selecting, copying, and pasting onto the command line for code reuse:
471 | delete all;viewport 900,600;fetch 3nd4, type=pdb,async=0;run ~/Scripts/PyMOLScripts/quat.py;quat 3nd4; show sticks;set stick_radius=0.125;hide everything, name H*;bg_color white;create coorCov, (3nd4_1 and (resi 19 or resi 119 or resi 219 or resi 319 or resi 419 or resi 519 or (resi 3 and name N7)));bond (coorCov//A/NA`19/NA),(coorCov//A/A`3/N7); bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`119/O); bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`219/O); bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`319/O); bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`419/O); bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`519/O);distance (3nd4_1 and chain Aand resi 19 and name NA), (3nd4_1 and chain A and resi 519);distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 419);distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 119);distance (3nd4_1 and chain A and resi 19 and name NA),(3nd4_1 and chain A and resi 319);distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 219);show nb_spheres; set nb_spheres_size, .35;distance hbond1,/3nd4_1/1/A/HOH`119/O, /3nd4_1/1/A/A`3/OP2;distance hbond2,/3nd4_1/1/A/HOH`319/O, /3nd4_1/1/A/A`3/OP2;distance hbond3,/3nd4_1/1/A/HOH`91/O, /3nd4_1/1/A/HOH`119/O;distance hbond4,/3nd4_1/1/A/G`4/N7,/3nd4_1/1/A/HOH`91/O;distance hbond5,/3nd4_1/1/A/G`4/O6, /3nd4_1/1/A/HOH`419/O;distance hbond6,/3nd4_1/1/A/HOH`91/O, /3nd4_1/1/A/G`4/OP2;distance hbond7,/3nd4_1/1/A/HOH`319/O, /3nd4_1/1/A/G`2/OP2;distance hbond9,/3nd4_1/1/A/HOH`419/O,/3nd4_2/2/A/HOH`74/O;distance hbond10,/3nd4_2/2/A/C`15/O2,/3nd4_1/1/A/G`2/N2;distance hbond11, /3nd4_2/2/A/C`15/N3,/3nd4_1/1/A/G`2/N1;distance hbond12,/3nd4_2/2/A/C`15/N4,/3nd4_1/1/A/G`2/O6;distance hbond13, /3nd4_2/2/A/U`14/N3,/3nd4_1/1/A/A`3/N1;distance hbond14,3nd4_2/2/A/U`14/O4,/3nd4_1/1/A/A`3/N6;distance hbond15, /3nd4_2/2/A/C`13/N4,/3nd4_1/1/A/G`4/O6;distance hbond16,/3nd4_2/2/A/C`13/N3, /3nd4_1/1/A/G`4/N1;distance hbond17, /3nd4_1/1/A/G`4/N2,/3nd4_2/2/A/C`13/O2;distance hbond18,/3nd4_1/1/A/G`2/N2,/3nd4_2/2/A/C`15/O2;distance hbond19,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/G`4/OP2;set depth_cue=0;set ray_trace_fog=0;set dash_color, black;set label_font_id, 5;set label_size, 36;set label_position, (0.5, 1.0, 2.0);set label_color, black;set dash_gap, 0.2;set dash_width, 2.0;set dash_length, 0.2;set label_color, black;set dash_gap, 0.2;set dash_width, 2.0;set dash_length, 0.2;select carbon, element C; color yellow, carbon;disable carbon;set_view (-0.9,0.34,-0.26,0.33,0.18,-0.93,-0.27,-0.92,-0.28,-0.07,-0.23,-27.83,8.63,19.85,13.2,16.0,31.63,-20.0);
472 |
473 |
474 | Type `NA` to get the resulting image of a sodium cation bound with inner sphere coordination to the N7 nitrogen of an adenine and to five waters. The sodium is in the major groove of a double-stranded RNA molecule (PDB-ID 3nd4). The dashed lines represent hydrogen bonds. The numbers are distances in angstroms.
475 |
476 | 
477 |
478 |
479 | Reference, License, Copyright, and Date of last update
480 | --------------------------------------------------------------------------------
481 |
482 | * Mooers, B. H. (2016). Simplifying and enhancing the use of PyMOL with horizontal scripts. *Protein Science*, 25(10), 1873-1882.
483 | * GNU General Public License ([GPL-3](http://www.gnu.org/licenses/gpl-3.0.en.html))
484 | * (C) [Blaine Mooers](https://basicsciences.ouhsc.edu/bmb/Faculty/bio_details/mooers-blaine-hm-phd), Ph.D., [University of Oklahoma Health Sciences Center](http://www.ouhsc.edu/), 2015-2017
485 | * This work was supported by NIH grants RO1 AI088011 (PI: Mooers) from the National Institute of Allergy and Infectious Diseases and ROP20 GM103640 (PI: Ann West), an Institutional Development Award (IDeA) from the National Institute of General Medical Sciences of the National Institutes of Health.
486 | * Updated 25 September 2022
487 |
488 |
489 | Bibtex entry
490 | ------------
491 |
492 | ```bibtex
493 | @article{mooers2016simplifying,
494 | title={Simplifying and enhancing the use of PyMOL with horizontal scripts},
495 | author={Mooers, Blaine HM},
496 | journal={Protein Science},
497 | volume={25},
498 | number={10},
499 | pages={1873--1882},
500 | year={2016},
501 | publisher={Wiley Online Library}
502 | }
503 | ```
504 |
505 | Related Repos
506 | -------------
507 |
508 | - [pymolshortcuts](https://github.com/MooersLab/pymolshortcuts)
509 | - [pymolsnips](https://github.com/MooersLab/pymolsnips)
510 | - [orgpymolpysnips](https://github.com/MooersLab/orgpymolpysnips)
511 | - [rstudiopymolpysnips](https://github.com/MooersLab/rstudiopymolpysnips)
512 | - [taggedpymolpysnips](https://github.com/MooersLab/taggedpymolpysnips)
513 | - [jupyterlabpymolpysnips](https://github.com/MooersLab/jupyterlabpymolpysnips)
514 | - [colabOpenSourcePyMOLpySnips](https://github.com/MooersLab/colabOpenSourcePyMOLpySnips)
515 | - [colabPyMOLpySnips](https://github.com/MooersLab/colabPyMOLpySnips)
516 | - [PyMOLwallhangings](https://github.com/MooersLab/PyMOLwallhangings)
517 |
518 | ## Update history
519 |
520 | |Version | Changes | Date |
521 | |:-----------:|:------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------:|
522 | | Version 0.2 | Added badges, funding, and update table. | 2024 May 24 |
523 |
524 |
--------------------------------------------------------------------------------
/exam2.py:
--------------------------------------------------------------------------------
1 | from __future__ import print_function
2 | # -*- coding: utf-8 -*-
3 | """
4 | DESCRIPTION AND INSTALLATION
5 |
6 | Defines aliases for exam 2 of the OUHSC Macromolecular Systems course.
7 | The aliases have actually been recoded as python functions but they
8 | can be thought of as aliases.
9 |
10 | Create ~/Scripts/PyMOLScripts
11 | and store the script in this subfolder
12 | or store in some other folder of your choosing IF you know what you are doing.
13 |
14 | Enter on the command line in PyMOL the following command:
15 |
16 | run ~/Scripts/PyMOLScripts/S4_File.py
17 |
18 | Now the aliases q1,q2, ..., q8 are active.
19 |
20 | Tested on PyMOL versions 1.5.0.5, 1.8.0.5, 1.8.2.0.
21 |
22 | Copyright Notice
23 | ================
24 | Copyright (C) 2016 Blaine Mooers
25 |
26 | This program is free software: you can redistribute it and/or modify
27 | it under the terms of the GNU General Public License as published by
28 | the Free Software Foundation, either version 3 of the License.
29 |
30 | This program is distributed in the hope that it will be useful,
31 | but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
33 | See the GNU General Public License for more details.
34 |
35 | You should have received a copy of the GNU General Public License
36 | along with this program. If not, see .
37 |
38 | The source code in this file is copyrighted, but you can
39 | freely use and copy it as long as you don't change or remove any of
40 | the copyright notices.
41 |
42 | Blaine Mooers , PhD
43 | blaine-mooers@ouhsc.edu
44 | 975 NE 10th St, BRC 466
45 | University of Oklahoma Health Sciences Center
46 | Oklahoma City, OK, USA 73104
47 | """
48 | from pymol import cmd
49 | __author__ = "Blaine Mooers"
50 | __copyright__ = "Blaine Mooers, University of Oklahoma Health Sciences Center, Oklahoma City, OK, USA 73104"
51 | __license__ = "GPL-3"
52 | __version__ = "1.0.3"
53 | __credits__ = ["William Beasley","Chiedza Kanyumbu"]
54 | # people who reported bug fixes, made suggestions, etc.
55 | __date__ = "24 July 2016"
56 | __maintainer__ = "Blaine Mooers"
57 | __email__ = "blaine-mooers@ouhsc.edu"
58 | __status__ = "Production"
59 |
60 | print("2015 OUHSC MSI-Lecture 17 and 18 takehome exam")
61 | print("on nucleic acid structure.")
62 | print(" ")
63 | print("Enter 'q1' for question 1, 'q2' for question 2, ...,")
64 | print("'q8' for question 8.")
65 | print(" ")
66 | print("Questions (1-4). HIV reverse transcriptase bound to DNA")
67 | print("with AZT incorporated (PDB-ID 3V6D).")
68 | print(" ")
69 | print("Questions (5-8). The full-length hammerhead")
70 | print("ribozyme (PDB-ID 3zp8).")
71 | print(" ")
72 | print("Enter 'help exam2' to learn how to use this script.")
73 | print("Enter 'help q1' to see quesiton 1 and the corresponding horizontal script.")
74 | print(" ")
75 | print("All or part of the horizontal script can be copied from the command history window for reuse.")
76 | print(" ")
77 | print("Positon cursor on command line with left mouse button.")
78 | print("Readline commands move the cursor to left or right:")
79 | print(" control-a will move the cursor to the beginning of the command line.")
80 | print(" control-e will move the cursor to the end of the line.")
81 | print(" command-f will move the cursor to the end of the current word.")
82 | print(" command-b will move the cursor to the begining of the current word.")
83 | print(" control-f will move the cursor to the right one character.")
84 | print(" control-b will move the cursor to the left by one character.")
85 | print(" ")
86 | print("Enter 'help rline' to see these commands again in the command history window.")
87 | print(" ")
88 | print("Up arrow key recalls last line of commands for editing.")
89 |
90 |
91 |
92 | def exam2():
93 | """
94 | USAGE:
95 |
96 | Enter 'run exam2.py' without including the quotation marks.
97 |
98 | Enter 'q1' to make the molecular scene for question 1.
99 | (Need active internet connection).
100 |
101 | Enter 'help q1' to see question 1 and the commands used to
102 | make the molecular scene.
103 |
104 | When you are ready for question 2,
105 | enter 'q2' for question 2, and so on.
106 |
107 | Enter 'help rline' to see the commands to move cursor on command line.
108 |
109 | DESCRIPTION
110 |
111 | Defines the molecular scenes for MSI-Lecture 17 and
112 | 18 takehome exam.
113 |
114 | Each question with a molecular scene has the scene
115 | defined by a specific function qX(), where X is the
116 | number of the question.
117 |
118 | Each function defines a series of PyMOL commands. Each
119 | function also has its own documentation that explains
120 | the molecular scene and that is printed to the
121 | command history window when you type 'help q1' or
122 | 'help q2' and so on.
123 |
124 | Each row of commands starts with 'reinitialize' to
125 | remove old molecules and settings. Each
126 | function prints to the command history window
127 | an alias to the commands in the function.
128 |
129 | LIMITATIONS
130 |
131 | An active internet connection is required because
132 | each alias uses the fetch command.
133 |
134 | Replace the fetch command with the load command to
135 | load atomic coordinates from your harddrive.
136 |
137 | Enter "rock" to stop the rocking motion.
138 |
139 | REQUIREMENTS
140 |
141 | When developing a variant of this program., run the
142 | program roundview.py to obtained a shorter version
143 | of the viewport settings.
144 |
145 | NOTES
146 |
147 | Use gray scroll bar to the right side of the command
148 | history window to see all of this documentation. or hit
149 | escape after moving the cursor to the viewing port
150 | (the GUI with the molecule).
151 |
152 | Copyright Notice
153 | ================
154 |
155 | The PyMOL function source code in this file is copyrighted, but you can
156 | freely use and copy it as long as you don't change or remove any of
157 | the copyright notices.
158 |
159 | """
160 | print("The function exam2() stores this docstring.")
161 | cmd.extend( "exam2",exam2)
162 |
163 |
164 | def rline():
165 | '''
166 | DESCRIPTION
167 |
168 | These commands are sufficient for most editing tasks:
169 | To edit code, positon cursor on command line with left mouse button.
170 | Control-e moves the cursor to the end of the line, even when it is out of view.
171 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
172 | Up arrow key recalls last line of commands for editing.
173 |
174 | These commands may not be available on all systems:
175 | Shift-control-a selects everything from the right of the cursor to the end of the line.
176 | Shift-control-e selects everything to the left of the cursor to the end of the line.
177 | Command-f moves the cursor to the end of the current word.
178 | Command-b moves the cursor to the begining of the current word.
179 | Control-f moves the cursor to the right by one character.
180 | Control-b moves the cursor to the left by one character.
181 | '''
182 | cmd.extend("rline",rline)
183 |
184 |
185 | def q1():
186 | '''
187 | DESCRIPTION
188 |
189 | Question 1: Explain how AZT terminates extension of the DNA chain.
190 |
191 | The following commands created the scene for "q1":
192 |
193 | delete all; fetch 3v6d, HIVrt, async=0; rock;preset.ball_and_stick("c. P and i. 822");set_view (-0.99,-0.1,0.06,0.09,-0.39,0.92,-0.07,0.92,0.39,0.0,0.0,-29.2,-10.56,24.72,39.27,23.02,35.38,-20.0);
194 |
195 | To reuse of parts or all of the above commands, copy and paste the commands
196 | onto the command line or into a plain text file.
197 |
198 | These commands are sufficient for most editing tasks:
199 | To edit code, positon cursor on command line with left mouse button.
200 | Control-e moves the cursor to the end of the line, even when it is out of view.
201 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
202 | Up arrow key recalls last line of commands for editing.
203 |
204 | These commands may not be available on all systems:
205 | Shift-control-a selects everything from the right of the cursor to the end of the line.
206 | Shift-control-e selects everything to the left of the cursor to the end of the line.
207 | Command-f moves the cursor to the end of the current word.
208 | Command-b moves the cursor to the begining of the current word.
209 | Control-f moves the cursor to the right by one character.
210 | Control-b moves the cursor to the left by one character.
211 | '''
212 | cmd.reinitialize()
213 | cmd.fetch('3v6d', type='pdb', name='HIVrt',async='0')
214 | cmd.rock()
215 | preset.ball_and_stick('c. P and i. 822')
216 | cmd.set_view('(-0.99,-0.1,0.06,0.09,-0.39,0.92,-0.07,\
217 | 0.92,0.39,0.0,0.0,-29.2,-10.56,24.72,39.27,\
218 | 23.02,35.38,-20.0)')
219 | print('Enter "q1" to set scene for question 1.')
220 | print('Enter "help q1" for more information.')
221 | cmd.extend( 'q1',q1)
222 |
223 |
224 |
225 | def q2():
226 | '''
227 | DESCRIPTION
228 |
229 | Question 2: Look along the helical axis of the DNA.
230 | Is the DNA helix bent?
231 |
232 | The following commands created the scene for "q2":
233 |
234 | delete all; fetch 3v6d, HIVrt, async=0; rock;show cartoon, c. P or c. T;set_view (0.61,0.29,-0.73,0.78,-0.37,0.51,-0.12,-0.88,-0.45,-0.0,-0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);
235 |
236 | To reuse of parts or all of the above commands, copy and paste the commands
237 | onto the command line or into a plain text file.
238 |
239 | These commands are sufficient for most editing tasks:
240 | To edit code, positon cursor on command line with left mouse button.
241 | Control-e moves the cursor to the end of the line, even when it is out of view.
242 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
243 | Up arrow key recalls last line of commands for editing.
244 |
245 | These commands may not be available on all systems:
246 | Shift-control-a selects everything from the right of the cursor to the end of the line.
247 | Shift-control-e selects everything to the left of the cursor to the end of the line.
248 | Command-f moves the cursor to the end of the current word.
249 | Command-b moves the cursor to the begining of the current word.
250 | Control-f moves the cursor to the right by one character.
251 | Control-b moves the cursor to the left by one character.
252 |
253 | '''
254 | cmd.reinitialize()
255 | cmd.fetch('3v6d',type='pdb',name='HIVrt',async='0')
256 | cmd.rock()
257 | cmd.show_as("cartoon","chain P or chain T")
258 | cmd.set_view('(0.61,0.29,-0.73,0.78,-0.37,0.51,-0.12,-0.88,-0.45,-0.0, 0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);')
259 | print('Enter "q2" to make the scene for question 2.')
260 | print('Enter "help q2" to see question 2 and the commands to make the scene.')
261 | cmd.extend( 'q2',q2)
262 |
263 |
264 | def q3():
265 | '''
266 | DESCRIPTION
267 |
268 | Question 3: In which groove of the DNA
269 | is the protein making the most contacts?
270 | Is this unusual?
271 |
272 | The following commands created the scene for "q3":
273 |
274 | delete all; fetch 3v6d, HIVrt, async=0; show cartoon, c. A or c. B;hide lines, c. A or c. B;set_view (0.53,-0.06,-0.84,0.82,-0.21,0.53,-0.21,-0.98,-0.07,-0.0,-0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);rock;
275 |
276 | To reuse of parts or all of the above commands, copy and paste the commands
277 | onto the command line or into a plain text file.
278 |
279 | These commands are sufficient for most editing tasks:
280 | To edit code, positon cursor on command line with left mouse button.
281 | Control-e moves the cursor to the end of the line, even when it is out of view.
282 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
283 | Up arrow key recalls last line of commands for editing.
284 |
285 | These commands may not be available on all systems:
286 | Shift-control-a selects everything from the right of the cursor to the end of the line.
287 | Shift-control-e selects everything to the left of the cursor to the end of the line.
288 | Command-f moves the cursor to the end of the current word.
289 | Command-b moves the cursor to the begining of the current word.
290 | Control-f moves the cursor to the right by one character.
291 | Control-b moves the cursor to the left by one character.
292 | '''
293 | cmd.reinitialize()
294 | cmd.fetch('3v6d', type='pdb', name= 'HIVrt', async='0')
295 | cmd.show_as("cartoon","c. A or c. B")
296 | cmd.hide("lines","c. A or c. B")
297 | cmd.rock()
298 | cmd.set_view('(0.53,-0.06,-0.84,0.82,-0.21,0.53,-0.21,-0.98,-0.07,-0.0,-0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);')
299 | print('Enter "q3" to make the scene for question 3.')
300 | print('Enter "help q3" to see question 3 and the commands to make the scene.')
301 | cmd.extend( 'q3',q3)
302 |
303 |
304 |
305 | def q4():
306 | '''
307 | DESCRIPTION
308 |
309 | Question 4: What the dihedral angle about the disulfide
310 | bond between MRG81 of chain F and Cys258 of chain C?
311 | This is a cross link between the protein and the DNA. Is
312 | this a cis or trans conformation of the bonds about the
313 | S--S bond? Is this conformation energetically favorable
314 | or unfavorable?
315 |
316 | The following commands created the scene for "q4":
317 |
318 | delete all; fetch 3v6d, HIVrt, async=0;preset.ball_and_stick("(c. C and i. 258) or (c. F and i. 817 )");set_view (0.21,-0.91,0.34,-0.84,0.01,0.54,-0.5,-0.4,-0.77,0.0,-0.0,-38.82,-39.67,-55.1,10.96,36.31,41.34,-20.0);
319 |
320 | To reuse of parts or all of the above commands, copy and paste the commands
321 | onto the command line or into a plain text file.
322 |
323 | These commands are sufficient for most editing tasks:
324 | To edit code, positon cursor on command line with left mouse button.
325 | Control-e moves the cursor to the end of the line, even when it is out of view.
326 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
327 | Up arrow key recalls last line of commands for editing.
328 |
329 | These commands may not be available on all systems:
330 | Shift-control-a selects everything from the right of the cursor to the end of the line.
331 | Shift-control-e selects everything to the left of the cursor to the end of the line.
332 | Command-f moves the cursor to the end of the current word.
333 | Command-b moves the cursor to the begining of the current word.
334 | Control-f moves the cursor to the right by one character.
335 | Control-b moves the cursor to the left by one character.
336 | '''
337 | cmd.reinitialize()
338 | cmd.fetch('3v6d',type='pdb',name='HIVrt',async='0')
339 | cmd.do("preset.ball_and_stick(selection='(chain C and resi 258) or (chain F and resi 817 )')")
340 | cmd.set_view('(0.21,-0.91,0.34,-0.84,0.01,0.54,-0.5,-0.4,-0.77,0.0,-0.0,-38.82,-39.67,-55.1,10.96,36.31,41.34,-20.0);')
341 | cmd.rock()
342 | print('Enter "q4" to make the scene for question 4.')
343 | print('Enter "help q4" to see question 4 and the commands to make the scene.')
344 | cmd.extend('q4',q4)
345 |
346 |
347 |
348 | def q5():
349 | '''
350 | DESCRIPTION
351 |
352 | Question 5: How many axial stacks of helices does
353 | the ribozyme have?
354 |
355 | The following commands created the scene for "q5":
356 |
357 | delete all;fetch 3zp8, hammer, async=0;show cartoon, hammer;set_view (-0.5,0.18,-0.85,-0.17,-0.98,-0.11,-0.85,0.09,0.52,0.0,0.0,-167.2,-18.45,10.92,-12.11,126.37,208.02,-20.0);rock;
358 |
359 | To reuse of parts or all of the above commands, copy and paste the commands
360 | onto the command line or into a plain text file.
361 |
362 | These commands are sufficient for most editing tasks:
363 | To edit code, positon cursor on command line with left mouse button.
364 | Control-e moves the cursor to the end of the line, even when it is out of view.
365 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
366 | Up arrow key recalls last line of commands for editing.
367 |
368 | These commands may not be available on all systems:
369 | Shift-control-a selects everything from the right of the cursor to the end of the line.
370 | Shift-control-e selects everything to the left of the cursor to the end of the line.
371 | Command-f moves the cursor to the end of the current word.
372 | Command-b moves the cursor to the begining of the current word.
373 | Control-f moves the cursor to the right by one character.
374 | Control-b moves the cursor to the left by one character.
375 | '''
376 | cmd.reinitialize()
377 | cmd.fetch('3zp8', type='pdb', name= 'hammer', async='0')
378 | cmd.show_as('cartoon','hammer')
379 | cmd.rock()
380 | cmd.set_view('(-0.5,0.18,-0.85,-0.17,-0.98,-0.11,-0.85,0.09,0.52,0.0,0.0,-167.2,-18.45,10.92,-12.11,126.37,208.02,-20.0);')
381 | print('Enter "q5" to make the scene for question 5.')
382 | print('Enter "help q5" to see question 5 and the commands to make the scene.')
383 | cmd.extend('q5',q5)
384 |
385 |
386 | def q6():
387 | '''
388 | DESCRIPTION
389 |
390 | Question 6: What is the average distance of the Na1044
391 | ligand bonds? Give the residue numbers of the RNA
392 | nucleotides and the sodium to identify them. How many
393 | ligands are from RNA?
394 |
395 | The following commands created the scene for "q6":
396 |
397 | delete all;fetch 3zp8, hammer, async=0; rock;preset.ball_and_stick("all");distance ligand1, i. 1044, c. A and i. 22 and n. N7;distance ligand2, i. 1044, c. A and i. 21 and n. OP2;distance ligand3, i. 1044, i. 2121;distance ligand4, i. 1044, i. 2120;distance ligand5, i. 1044, i. 2122;distance ligand6, i. 1044, i. 2130;set_view (-0.87,0.18,-0.46,-0.39,-0.81,0.44,-0.29,0.56,0.78,-0.0,0.0,-20.47,-18.05,14.02,-18.89,17.47,23.47,-20.0);
398 |
399 | To reuse of parts or all of the above commands, copy and paste the commands
400 | onto the command line or into a plain text file.
401 |
402 | These commands are sufficient for most editing tasks:
403 | To edit code, positon cursor on command line with left mouse button.
404 | Control-e moves the cursor to the end of the line, even when it is out of view.
405 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
406 | Up arrow key recalls last line of commands for editing.
407 |
408 | These commands may not be available on all systems:
409 | Shift-control-a selects everything from the right of the cursor to the end of the line.
410 | Shift-control-e selects everything to the left of the cursor to the end of the line.
411 | Command-f moves the cursor to the end of the current word.
412 | Command-b moves the cursor to the begining of the current word.
413 | Control-f moves the cursor to the right by one character.
414 | Control-b moves the cursor to the left by one character.
415 | '''
416 | cmd.reinitialize()
417 | cmd.fetch('3zp8', type='pdb', name= 'hammer', async='0')
418 | cmd.rock()
419 | cmd.do('preset.ball_and_stick("all")')
420 | cmd.distance('Sodiumligand1',' resi 1044', 'chain A and i. 22 and n. N7')
421 | cmd.distance('Sodiumligand2', 'resi 1044', 'chain A and i. 21 and n. OP2')
422 | cmd.distance('Sodiumligand3', 'resi 1044', 'resi 2121')
423 | cmd.distance('Sodiumligand4', 'resi 1044', 'resi 2120')
424 | cmd.distance('Sodiumligand5', 'resi 1044', 'resi 2122')
425 | cmd.distance('Sodiumligand6', 'resi 1044', 'resi 2130')
426 | cmd.do('set label_size, -0.4')
427 | cmd.set_view('(-0.87,0.18,-0.46,-0.39,-0.81,0.44,-0.29,0.56,0.78,-0.0,0.0,-20.47,-18.05,14.02,-18.89,17.47,23.47,-20.0);')
428 | print('Enter "q6" to make the scene for question 6.')
429 | print('Enter "help q6" to see question 6 and the commands to make the scene.')
430 | cmd.extend('q6',q6)
431 |
432 |
433 | def q7():
434 | '''
435 | DESCRIPTION
436 |
437 | Question 7: Measure the longest dimension and the
438 | shortest dimension of the ribozyme. Enter "rock" to
439 | stop the rocking motion. What is the ratio of
440 | the longest dimension to the shortest dimension? Is it
441 | globular like a protein?
442 |
443 | The following commands created the scene for "q7":
444 |
445 | delete all;fetch 3zp8, hammer, async=0;show ribbon, hammer;set_view (0.62,0.14,0.78,0.13,-0.99,0.07,0.78,0.05,-0.63,-0.0,-0.0,-169.8,-16.43,9.44,-9.63,143.54,196.05,-20.0); rock;
446 |
447 | To reuse of parts or all of the above commands, copy and paste the commands
448 | onto the command line or into a plain text file.
449 |
450 | These commands are sufficient for most editing tasks:
451 | To edit code, positon cursor on command line with left mouse button.
452 | Control-e moves the cursor to the end of the line, even when it is out of view.
453 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
454 | Up arrow key recalls last line of commands for editing.
455 |
456 | These commands may not be available on all systems:
457 | Shift-control-a selects everything from the right of the cursor to the end of the line.
458 | Shift-control-e selects everything to the left of the cursor to the end of the line.
459 | Command-f moves the cursor to the end of the current word.
460 | Command-b moves the cursor to the begining of the current word.
461 | Control-f moves the cursor to the right by one character.
462 | Control-b moves the cursor to the left by one character.
463 | '''
464 | cmd.reinitialize()
465 | cmd.fetch('3zp8', type='pdb', name= 'hammer', async='0')
466 | cmd.show_as('ribbon', 'hammer')
467 | cmd.rock()
468 | cmd.set_view('(0.62,0.14,0.78,0.13,-0.99,0.07,0.78,0.05,-0.63,-0.0,-0.0,-169.8,-16.43,9.44,-9.63,143.54,196.05,-20.0);')
469 | print('Enter "q7" to make the scene for question 7.')
470 | print('Enter "help q7" to see question 7 and the commands to make the scene.')
471 | cmd.extend('q7',q7)
472 |
473 |
474 | def q8():
475 | '''
476 | DESCRIPTION
477 |
478 | Question 8: Find the unusual base pair between A21 and
479 | G36. What is the length of the H-bonds between the bases
480 | (ignore the H atoms in the distance measurement)? List
481 | the distance with the residue name, residue number, and
482 | atom name. What additional H-bond occurs between a base
483 | in this base pair and a ribose ring of one of the two
484 | nucleotides in this base pair?
485 |
486 | The following commands created the scene for "q8":
487 |
488 | fetch 3zp8, hammer, async=0;hide everything;show ribbon;show sticks, resi 21 or resi 36;set_view (-0.9,-0.19,0.39,0.39,-0.74,0.55,0.19,0.65,0.74,0.0,0.0,-37.58,-21.66,15.71,-23.32,35.42,39.74,-20.0);rock;
489 |
490 | To reuse of parts or all of the above commands, copy and paste the commands
491 | onto the command line or into a plain text file.
492 |
493 | These commands are sufficient for most editing tasks:
494 | To edit code, positon cursor on command line with left mouse button.
495 | Control-e moves the cursor to the end of the line, even when it is out of view.
496 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
497 | Up arrow key recalls last line of commands for editing.
498 |
499 | These commands may not be available on all systems:
500 | Shift-control-a selects everything from the right of the cursor to the end of the line.
501 | Shift-control-e selects everything to the left of the cursor to the end of the line.
502 | Command-f moves the cursor to the end of the current word.
503 | Command-b moves the cursor to the begining of the current word.
504 | Control-f moves the cursor to the right by one character.
505 | Control-b moves the cursor to the left by one character.
506 | '''
507 | cmd.reinitialize()
508 | cmd.fetch('3zp8', type='pdb', name= 'hammer', async='0')
509 | cmd.show_as('ribbon', 'hammer')
510 | cmd.rock()
511 | cmd.hide('everything')
512 | cmd.show_as( 'ribbon','all')
513 | cmd.show_as('sticks', 'resi 21 or resi 36')
514 | cmd.set_view('(-0.9,-0.19,0.39,0.39,-0.74,0.55,0.19,0.65,0.74,0.0,0.0,-37.58,-21.66,15.71,-23.32,35.42,39.74,-20.0);')
515 | print('Enter "q8" to make the scene for question 8.')
516 | print('Enter "help q8" to see question 8 and the commands to make the scene.')
517 | cmd.extend('q8',q8)
518 |
519 |
--------------------------------------------------------------------------------
/exam2Windows.py:
--------------------------------------------------------------------------------
1 | from __future__ import print_function
2 | # -*- coding: utf-8 -*-
3 | """
4 | DESCRIPTION AND INSTALLATION
5 |
6 | Defines aliases for exam 2 of the OUHSC Macromolecular Systems course.
7 | The aliases have actually been recoded as python functions but they
8 | can be thought of as aliases.
9 |
10 | Create ~/Scripts/PyMOLScripts
11 | and store the script in this subfolder
12 | or store in some other folder of your choosing IF you know what you are doing.
13 |
14 | Enter on the command line in PyMOL the following command:
15 |
16 | run ~/Scripts/PyMOLScripts/S4_File.py
17 |
18 | Now the aliases q1,q2, ..., q8 are active.
19 |
20 | Tested on PyMOL versions 1.5.0.5, 1.8.0.5, 1.8.2.0.
21 |
22 | Copyright Notice
23 | ================
24 | Copyright (C) 2016 Blaine Mooers
25 |
26 | This program is free software: you can redistribute it and/or modify
27 | it under the terms of the GNU General Public License as published by
28 | the Free Software Foundation, either version 3 of the License.
29 |
30 | This program is distributed in the hope that it will be useful,
31 | but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
33 | See the GNU General Public License for more details.
34 |
35 | You should have received a copy of the GNU General Public License
36 | along with this program. If not, see .
37 |
38 | The source code in this file is copyrighted, but you can
39 | freely use and copy it as long as you don't change or remove any of
40 | the copyright notices.
41 |
42 | Blaine Mooers , PhD
43 | blaine-mooers@ouhsc.edu
44 | 975 NE 10th St, BRC 466
45 | University of Oklahoma Health Sciences Center
46 | Oklahoma City, OK, USA 73104
47 | """
48 | from pymol import cmd
49 | __author__ = "Blaine Mooers"
50 | __copyright__ = "Blaine Mooers, University of Oklahoma Health Sciences Center, Oklahoma City, OK, USA 73104"
51 | __license__ = "GPL-3"
52 | __version__ = "1.0.3"
53 | __credits__ = ["William Beasley","Chiedza Kanyumbu"]
54 | # people who reported bug fixes, made suggestions, etc.
55 | __date__ = "24 July 2016"
56 | __maintainer__ = "Blaine Mooers"
57 | __email__ = "blaine-mooers@ouhsc.edu"
58 | __status__ = "Production"
59 |
60 | print("2015 OUHSC MSI-Lecture 17 and 18 takehome exam")
61 | print("on nucleic acid structure.")
62 | print(" ")
63 | print("Enter 'q1' for question 1, 'q2' for question 2, ...,")
64 | print("'q8' for question 8.")
65 | print(" ")
66 | print("Questions (1-4). HIV reverse transcriptase bound to DNA")
67 | print("with AZT incorporated (PDB-ID 3V6D).")
68 | print(" ")
69 | print("Questions (5-8). The full-length hammerhead")
70 | print("ribozyme (PDB-ID 3zp8).")
71 | print(" ")
72 | print("Enter 'help exam2' to learn how to use this script.")
73 | print("Enter 'help q1' to see quesiton 1 and the corresponding horizontal script.")
74 | print(" ")
75 | print("All or part of the horizontal script can be copied from the command history window for reuse.")
76 | print(" ")
77 | print("Positon cursor on command line with left mouse button.")
78 | print("Readline commands move the cursor to left or right:")
79 | print(" control-a will move the cursor to the beginning of the command line.")
80 | print(" control-e will move the cursor to the end of the line.")
81 | print(" command-f will move the cursor to the end of the current word.")
82 | print(" command-b will move the cursor to the begining of the current word.")
83 | print(" control-f will move the cursor to the right one character.")
84 | print(" control-b will move the cursor to the left by one character.")
85 | print(" ")
86 | print("Enter 'help rline' to see these commands again in the command history window.")
87 | print(" ")
88 | print("Up arrow key recalls last line of commands for editing.")
89 |
90 |
91 |
92 | def exam2():
93 | """
94 | USAGE:
95 |
96 | Enter 'run exam2.py' without including the quotation marks.
97 |
98 | Enter 'q1' to make the molecular scene for question 1.
99 | (Need active internet connection).
100 |
101 | Enter 'help q1' to see question 1 and the commands used to
102 | make the molecular scene.
103 |
104 | When you are ready for question 2,
105 | enter 'q2' for question 2, and so on.
106 |
107 | Enter 'help rline' to see the commands to move cursor on command line.
108 |
109 | DESCRIPTION
110 |
111 | Defines the molecular scenes for MSI-Lecture 17 and
112 | 18 takehome exam.
113 |
114 | Each question with a molecular scene has the scene
115 | defined by a specific function qX(), where X is the
116 | number of the question.
117 |
118 | Each function defines a series of PyMOL commands. Each
119 | function also has its own documentation that explains
120 | the molecular scene and that is printed to the
121 | command history window when you type 'help q1' or
122 | 'help q2' and so on.
123 |
124 | Each row of commands starts with 'reinitialize' to
125 | remove old molecules and settings. Each
126 | function prints to the command history window
127 | an alias to the commands in the function.
128 |
129 | LIMITATIONS
130 |
131 | An active internet connection is required because
132 | each alias uses the fetch command.
133 |
134 | Replace the fetch command with the load command to
135 | load atomic coordinates from your harddrive.
136 |
137 | Enter "rock" to stop the rocking motion.
138 |
139 | REQUIREMENTS
140 |
141 | When developing a variant of this program., run the
142 | program roundview.py to obtained a shorter version
143 | of the viewport settings.
144 |
145 | NOTES
146 |
147 | Use gray scroll bar to the right side of the command
148 | history window to see all of this documentation. or hit
149 | escape after moving the cursor to the viewing port
150 | (the GUI with the molecule).
151 |
152 | Copyright Notice
153 | ================
154 |
155 | The PyMOL function source code in this file is copyrighted, but you can
156 | freely use and copy it as long as you don't change or remove any of
157 | the copyright notices.
158 |
159 | """
160 | print("The function exam2() stores this docstring.")
161 | cmd.extend( "exam2",exam2)
162 |
163 |
164 | def rline():
165 | '''
166 | DESCRIPTION
167 |
168 | These commands are sufficient for most editing tasks:
169 | To edit code, positon cursor on command line with left mouse button.
170 | Control-e moves the cursor to the end of the line, even when it is out of view.
171 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
172 | Up arrow key recalls last line of commands for editing.
173 |
174 | These commands may not be available on all systems:
175 | Shift-control-a selects everything from the right of the cursor to the end of the line.
176 | Shift-control-e selects everything to the left of the cursor to the end of the line.
177 | Command-f moves the cursor to the end of the current word.
178 | Command-b moves the cursor to the begining of the current word.
179 | Control-f moves the cursor to the right by one character.
180 | Control-b moves the cursor to the left by one character.
181 | '''
182 | cmd.extend("rline",rline)
183 |
184 |
185 | def q1():
186 | '''
187 | DESCRIPTION
188 |
189 | Question 1: Explain how AZT terminates extension of the DNA chain.
190 |
191 | The following commands created the scene for "q1":
192 |
193 | delete all; fetch 3v6d, HIVrt, async=0; rock;preset.ball_and_stick("c. P and i. 822");set_view (-0.99,-0.1,0.06,0.09,-0.39,0.92,-0.07,0.92,0.39,0.0,0.0,-29.2,-10.56,24.72,39.27,23.02,35.38,-20.0);
194 |
195 | To reuse of parts or all of the above commands, copy and paste the commands
196 | onto the command line or into a plain text file.
197 |
198 | These commands are sufficient for most editing tasks:
199 | To edit code, positon cursor on command line with left mouse button.
200 | Control-e moves the cursor to the end of the line, even when it is out of view.
201 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
202 | Up arrow key recalls last line of commands for editing.
203 |
204 | These commands may not be available on all systems:
205 | Shift-control-a selects everything from the right of the cursor to the end of the line.
206 | Shift-control-e selects everything to the left of the cursor to the end of the line.
207 | Command-f moves the cursor to the end of the current word.
208 | Command-b moves the cursor to the begining of the current word.
209 | Control-f moves the cursor to the right by one character.
210 | Control-b moves the cursor to the left by one character.
211 | '''
212 | cmd.reinitialize()
213 | cmd.fetch('3v6d', type='pdb', name='HIVrt',async='0')
214 | cmd.rock()
215 | preset.ball_and_stick('c. P and i. 822')
216 | cmd.set_view('(-0.99,-0.1,0.06,0.09,-0.39,0.92,-0.07,\
217 | 0.92,0.39,0.0,0.0,-29.2,-10.56,24.72,39.27,\
218 | 23.02,35.38,-20.0)')
219 | print('Enter "q1" to set scene for question 1.')
220 | print('Enter "help q1" for more information.')
221 | cmd.extend( 'q1',q1)
222 |
223 |
224 |
225 | def q2():
226 | '''
227 | DESCRIPTION
228 |
229 | Question 2: Look along the helical axis of the DNA.
230 | Is the DNA helix bent?
231 |
232 | The following commands created the scene for "q2":
233 |
234 | delete all; fetch 3v6d, HIVrt, async=0; rock;show cartoon, c. P or c. T;set_view (0.61,0.29,-0.73,0.78,-0.37,0.51,-0.12,-0.88,-0.45,-0.0,-0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);
235 |
236 | To reuse of parts or all of the above commands, copy and paste the commands
237 | onto the command line or into a plain text file.
238 |
239 | These commands are sufficient for most editing tasks:
240 | To edit code, positon cursor on command line with left mouse button.
241 | Control-e moves the cursor to the end of the line, even when it is out of view.
242 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
243 | Up arrow key recalls last line of commands for editing.
244 |
245 | These commands may not be available on all systems:
246 | Shift-control-a selects everything from the right of the cursor to the end of the line.
247 | Shift-control-e selects everything to the left of the cursor to the end of the line.
248 | Command-f moves the cursor to the end of the current word.
249 | Command-b moves the cursor to the begining of the current word.
250 | Control-f moves the cursor to the right by one character.
251 | Control-b moves the cursor to the left by one character.
252 |
253 | '''
254 | cmd.reinitialize()
255 | cmd.fetch('3v6d',type='pdb',name='HIVrt',async='0')
256 | cmd.rock()
257 | cmd.show_as("cartoon","chain P or chain T")
258 | cmd.set_view('(0.61,0.29,-0.73,0.78,-0.37,0.51,-0.12,-0.88,-0.45,-0.0, 0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);')
259 | print('Enter "q2" to make the scene for question 2.')
260 | print('Enter "help q2" to see question 2 and the commands to make the scene.')
261 | cmd.extend( 'q2',q2)
262 |
263 |
264 | def q3():
265 | '''
266 | DESCRIPTION
267 |
268 | Question 3: In which groove of the DNA
269 | is the protein making the most contacts?
270 | Is this unusual?
271 |
272 | The following commands created the scene for "q3":
273 |
274 | delete all; fetch 3v6d, HIVrt, async=0; show cartoon, c. A or c. B;hide lines, c. A or c. B;set_view (0.53,-0.06,-0.84,0.82,-0.21,0.53,-0.21,-0.98,-0.07,-0.0,-0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);rock;
275 |
276 | To reuse of parts or all of the above commands, copy and paste the commands
277 | onto the command line or into a plain text file.
278 |
279 | These commands are sufficient for most editing tasks:
280 | To edit code, positon cursor on command line with left mouse button.
281 | Control-e moves the cursor to the end of the line, even when it is out of view.
282 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
283 | Up arrow key recalls last line of commands for editing.
284 |
285 | These commands may not be available on all systems:
286 | Shift-control-a selects everything from the right of the cursor to the end of the line.
287 | Shift-control-e selects everything to the left of the cursor to the end of the line.
288 | Command-f moves the cursor to the end of the current word.
289 | Command-b moves the cursor to the begining of the current word.
290 | Control-f moves the cursor to the right by one character.
291 | Control-b moves the cursor to the left by one character.
292 | '''
293 | cmd.reinitialize()
294 | cmd.fetch('3v6d', type='pdb', name= 'HIVrt', async='0')
295 | cmd.show_as("cartoon","c. A or c. B")
296 | cmd.hide("lines","c. A or c. B")
297 | cmd.rock()
298 | cmd.set_view('(0.53,-0.06,-0.84,0.82,-0.21,0.53,-0.21,-0.98,-0.07,-0.0,-0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);')
299 | print('Enter "q3" to make the scene for question 3.')
300 | print('Enter "help q3" to see question 3 and the commands to make the scene.')
301 | cmd.extend( 'q3',q3)
302 |
303 |
304 |
305 | def q4():
306 | '''
307 | DESCRIPTION
308 |
309 | Question 4: What the dihedral angle about the disulfide
310 | bond between MRG81 of chain F and Cys258 of chain C?
311 | This is a cross link between the protein and the DNA. Is
312 | this a cis or trans conformation of the bonds about the
313 | S--S bond? Is this conformation energetically favorable
314 | or unfavorable?
315 |
316 | The following commands created the scene for "q4":
317 |
318 | delete all; fetch 3v6d, HIVrt, async=0;preset.ball_and_stick("(c. C and i. 258) or (c. F and i. 817 )");set_view (0.21,-0.91,0.34,-0.84,0.01,0.54,-0.5,-0.4,-0.77,0.0,-0.0,-38.82,-39.67,-55.1,10.96,36.31,41.34,-20.0);
319 |
320 | To reuse of parts or all of the above commands, copy and paste the commands
321 | onto the command line or into a plain text file.
322 |
323 | These commands are sufficient for most editing tasks:
324 | To edit code, positon cursor on command line with left mouse button.
325 | Control-e moves the cursor to the end of the line, even when it is out of view.
326 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
327 | Up arrow key recalls last line of commands for editing.
328 |
329 | These commands may not be available on all systems:
330 | Shift-control-a selects everything from the right of the cursor to the end of the line.
331 | Shift-control-e selects everything to the left of the cursor to the end of the line.
332 | Command-f moves the cursor to the end of the current word.
333 | Command-b moves the cursor to the begining of the current word.
334 | Control-f moves the cursor to the right by one character.
335 | Control-b moves the cursor to the left by one character.
336 | '''
337 | cmd.reinitialize()
338 | cmd.fetch('3v6d',type='pdb',name='HIVrt',async='0')
339 | cmd.do("preset.ball_and_stick(selection='(chain C and resi 258) or (chain F and resi 817 )')")
340 | cmd.set_view('(0.21,-0.91,0.34,-0.84,0.01,0.54,-0.5,-0.4,-0.77,0.0,-0.0,-38.82,-39.67,-55.1,10.96,36.31,41.34,-20.0);')
341 | cmd.rock()
342 | print('Enter "q4" to make the scene for question 4.')
343 | print('Enter "help q4" to see question 4 and the commands to make the scene.')
344 | cmd.extend('q4',q4)
345 |
346 |
347 |
348 | def q5():
349 | '''
350 | DESCRIPTION
351 |
352 | Question 5: How many axial stacks of helices does
353 | the ribozyme have?
354 |
355 | The following commands created the scene for "q5":
356 |
357 | delete all;fetch 3zp8, hammer, async=0;show cartoon, hammer;set_view (-0.5,0.18,-0.85,-0.17,-0.98,-0.11,-0.85,0.09,0.52,0.0,0.0,-167.2,-18.45,10.92,-12.11,126.37,208.02,-20.0);rock;
358 |
359 | To reuse of parts or all of the above commands, copy and paste the commands
360 | onto the command line or into a plain text file.
361 |
362 | These commands are sufficient for most editing tasks:
363 | To edit code, positon cursor on command line with left mouse button.
364 | Control-e moves the cursor to the end of the line, even when it is out of view.
365 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
366 | Up arrow key recalls last line of commands for editing.
367 |
368 | These commands may not be available on all systems:
369 | Shift-control-a selects everything from the right of the cursor to the end of the line.
370 | Shift-control-e selects everything to the left of the cursor to the end of the line.
371 | Command-f moves the cursor to the end of the current word.
372 | Command-b moves the cursor to the begining of the current word.
373 | Control-f moves the cursor to the right by one character.
374 | Control-b moves the cursor to the left by one character.
375 | '''
376 | cmd.reinitialize()
377 | cmd.fetch('3zp8', type='pdb', name= 'hammer', async='0')
378 | cmd.show_as('cartoon','hammer')
379 | cmd.rock()
380 | cmd.set_view('(-0.5,0.18,-0.85,-0.17,-0.98,-0.11,-0.85,0.09,0.52,0.0,0.0,-167.2,-18.45,10.92,-12.11,126.37,208.02,-20.0);')
381 | print('Enter "q5" to make the scene for question 5.')
382 | print('Enter "help q5" to see question 5 and the commands to make the scene.')
383 | cmd.extend('q5',q5)
384 |
385 |
386 | def q6():
387 | '''
388 | DESCRIPTION
389 |
390 | Question 6: What is the average distance of the Na1044
391 | ligand bonds? Give the residue numbers of the RNA
392 | nucleotides and the sodium to identify them. How many
393 | ligands are from RNA?
394 |
395 | The following commands created the scene for "q6":
396 |
397 | delete all;fetch 3zp8, hammer, async=0; rock;preset.ball_and_stick("all");distance ligand1, i. 1044, c. A and i. 22 and n. N7;distance ligand2, i. 1044, c. A and i. 21 and n. OP2;distance ligand3, i. 1044, i. 2121;distance ligand4, i. 1044, i. 2120;distance ligand5, i. 1044, i. 2122;distance ligand6, i. 1044, i. 2130;set_view (-0.87,0.18,-0.46,-0.39,-0.81,0.44,-0.29,0.56,0.78,-0.0,0.0,-20.47,-18.05,14.02,-18.89,17.47,23.47,-20.0);
398 |
399 | To reuse of parts or all of the above commands, copy and paste the commands
400 | onto the command line or into a plain text file.
401 |
402 | These commands are sufficient for most editing tasks:
403 | To edit code, positon cursor on command line with left mouse button.
404 | Control-e moves the cursor to the end of the line, even when it is out of view.
405 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
406 | Up arrow key recalls last line of commands for editing.
407 |
408 | These commands may not be available on all systems:
409 | Shift-control-a selects everything from the right of the cursor to the end of the line.
410 | Shift-control-e selects everything to the left of the cursor to the end of the line.
411 | Command-f moves the cursor to the end of the current word.
412 | Command-b moves the cursor to the begining of the current word.
413 | Control-f moves the cursor to the right by one character.
414 | Control-b moves the cursor to the left by one character.
415 | '''
416 | cmd.reinitialize()
417 | cmd.fetch('3zp8', type='pdb', name= 'hammer', async='0')
418 | cmd.rock()
419 | cmd.do('preset.ball_and_stick("all")')
420 | cmd.distance('Sodiumligand1',' resi 1044', 'chain A and i. 22 and n. N7')
421 | cmd.distance('Sodiumligand2', 'resi 1044', 'chain A and i. 21 and n. OP2')
422 | cmd.distance('Sodiumligand3', 'resi 1044', 'resi 2121')
423 | cmd.distance('Sodiumligand4', 'resi 1044', 'resi 2120')
424 | cmd.distance('Sodiumligand5', 'resi 1044', 'resi 2122')
425 | cmd.distance('Sodiumligand6', 'resi 1044', 'resi 2130')
426 | cmd.do('set label_size, -0.4')
427 | cmd.set_view('(-0.87,0.18,-0.46,-0.39,-0.81,0.44,-0.29,0.56,0.78,-0.0,0.0,-20.47,-18.05,14.02,-18.89,17.47,23.47,-20.0);')
428 | print('Enter "q6" to make the scene for question 6.')
429 | print('Enter "help q6" to see question 6 and the commands to make the scene.')
430 | cmd.extend('q6',q6)
431 |
432 |
433 | def q7():
434 | '''
435 | DESCRIPTION
436 |
437 | Question 7: Measure the longest dimension and the
438 | shortest dimension of the ribozyme. Enter "rock" to
439 | stop the rocking motion. What is the ratio of
440 | the longest dimension to the shortest dimension? Is it
441 | globular like a protein?
442 |
443 | The following commands created the scene for "q7":
444 |
445 | delete all;fetch 3zp8, hammer, async=0;show ribbon, hammer;set_view (0.62,0.14,0.78,0.13,-0.99,0.07,0.78,0.05,-0.63,-0.0,-0.0,-169.8,-16.43,9.44,-9.63,143.54,196.05,-20.0); rock;
446 |
447 | To reuse of parts or all of the above commands, copy and paste the commands
448 | onto the command line or into a plain text file.
449 |
450 | These commands are sufficient for most editing tasks:
451 | To edit code, positon cursor on command line with left mouse button.
452 | Control-e moves the cursor to the end of the line, even when it is out of view.
453 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
454 | Up arrow key recalls last line of commands for editing.
455 |
456 | These commands may not be available on all systems:
457 | Shift-control-a selects everything from the right of the cursor to the end of the line.
458 | Shift-control-e selects everything to the left of the cursor to the end of the line.
459 | Command-f moves the cursor to the end of the current word.
460 | Command-b moves the cursor to the begining of the current word.
461 | Control-f moves the cursor to the right by one character.
462 | Control-b moves the cursor to the left by one character.
463 | '''
464 | cmd.reinitialize()
465 | cmd.fetch('3zp8', type='pdb', name= 'hammer', async='0')
466 | cmd.show_as('ribbon', 'hammer')
467 | cmd.rock()
468 | cmd.set_view('(0.62,0.14,0.78,0.13,-0.99,0.07,0.78,0.05,-0.63,-0.0,-0.0,-169.8,-16.43,9.44,-9.63,143.54,196.05,-20.0);')
469 | print('Enter "q7" to make the scene for question 7.')
470 | print('Enter "help q7" to see question 7 and the commands to make the scene.')
471 | cmd.extend('q7',q7)
472 |
473 |
474 | def q8():
475 | '''
476 | DESCRIPTION
477 |
478 | Question 8: Find the unusual base pair between A21 and
479 | G36. What is the length of the H-bonds between the bases
480 | (ignore the H atoms in the distance measurement)? List
481 | the distance with the residue name, residue number, and
482 | atom name. What additional H-bond occurs between a base
483 | in this base pair and a ribose ring of one of the two
484 | nucleotides in this base pair?
485 |
486 | The following commands created the scene for "q8":
487 |
488 | fetch 3zp8, hammer, async=0;hide everything;show ribbon;show sticks, resi 21 or resi 36;set_view (-0.9,-0.19,0.39,0.39,-0.74,0.55,0.19,0.65,0.74,0.0,0.0,-37.58,-21.66,15.71,-23.32,35.42,39.74,-20.0);rock;
489 |
490 | To reuse of parts or all of the above commands, copy and paste the commands
491 | onto the command line or into a plain text file.
492 |
493 | These commands are sufficient for most editing tasks:
494 | To edit code, positon cursor on command line with left mouse button.
495 | Control-e moves the cursor to the end of the line, even when it is out of view.
496 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
497 | Up arrow key recalls last line of commands for editing.
498 |
499 | These commands may not be available on all systems:
500 | Shift-control-a selects everything from the right of the cursor to the end of the line.
501 | Shift-control-e selects everything to the left of the cursor to the end of the line.
502 | Command-f moves the cursor to the end of the current word.
503 | Command-b moves the cursor to the begining of the current word.
504 | Control-f moves the cursor to the right by one character.
505 | Control-b moves the cursor to the left by one character.
506 | '''
507 | cmd.reinitialize()
508 | cmd.fetch('3zp8', type='pdb', name= 'hammer', async='0')
509 | cmd.show_as('ribbon', 'hammer')
510 | cmd.rock()
511 | cmd.hide('everything')
512 | cmd.show_as( 'ribbon','all')
513 | cmd.show_as('sticks', 'resi 21 or resi 36')
514 | cmd.set_view('(-0.9,-0.19,0.39,0.39,-0.74,0.55,0.19,0.65,0.74,0.0,0.0,-37.58,-21.66,15.71,-23.32,35.42,39.74,-20.0);')
515 | print('Enter "q8" to make the scene for question 8.')
516 | print('Enter "help q8" to see question 8 and the commands to make the scene.')
517 | cmd.extend('q8',q8)
518 |
519 |
--------------------------------------------------------------------------------
/quat.py:
--------------------------------------------------------------------------------
1 | '''
2 | (c) 2010-2011 Thomas Holder, MPI for Developmental Biology
3 |
4 | Module for reading REMARK records from PDB files and in particular
5 | generate quaterny structure from REMARK 350.
6 | '''
7 |
8 | import sys, os
9 | from pymol import cmd, stored
10 |
11 | local_mirror_divided = '/mnt/bio/db/pdb.divided'
12 |
13 | def pdbremarks(filename):
14 | '''
15 | Read REMARK lines from PDB file. Return dictionary with remarkNum as key
16 | and list of lines as value.
17 | '''
18 | remarks = dict()
19 | if not isinstance(filename, basestring):
20 | f = filename
21 | elif filename[-3:] == '.gz':
22 | import gzip
23 | f = gzip.open(filename)
24 | else:
25 | f = open(filename)
26 | for line in f:
27 | recname = line[0:6]
28 | if recname == 'REMARK':
29 | num = int(line[7:10])
30 | lstring = line[11:]
31 | remarks.setdefault(num, []).append(lstring)
32 | return remarks
33 |
34 | def quat350(rem350):
35 | '''
36 | Get transformation matrices for biomolecule 1 from REMARK 350.
37 | '''
38 | biomt = dict()
39 | chains = tuple()
40 | seenbiomolecule = False
41 | for line in rem350:
42 | if line.startswith('BIOMOLECULE:'):
43 | if seenbiomolecule:
44 | break
45 | seenbiomolecule = True
46 | elif line.startswith('APPLY THE FOLLOWING TO CHAINS:'):
47 | chains = tuple(chain.strip() for chain in line[30:].split(','))
48 | elif line.startswith(' AND CHAINS:'):
49 | chains += tuple(chain.strip() for chain in line[30:].split(','))
50 | elif line.startswith(' BIOMT'):
51 | row = int(line[7])
52 | num = int(line[8:12])
53 | vec = line[12:].split()
54 | vec = map(float, vec)
55 | biomt.setdefault(chains, dict()).setdefault(num, []).extend(vec)
56 | return biomt
57 |
58 | def quat(name=None, filename=None, prefix=None, quiet=0):
59 | '''
60 | DESCRIPTION
61 |
62 | Read REMARK 350 from `filename` and create biological unit
63 | (quaternary structure)
64 |
65 | USAGE
66 |
67 | quat [name [, filename [, prefix]]]
68 |
69 | ARGUMENTS
70 |
71 | name = string: name of object and basename of PDB file, if
72 | filename is not given {default: first loaded object}
73 |
74 | filename = string: file path {default: .pdb}
75 |
76 | prefix = string: prefix for new objects {default: }
77 |
78 | EXAMPLE
79 |
80 | fetch 1rmv
81 | quat 1rmv
82 | '''
83 | quiet = int(quiet)
84 | if name is None:
85 | name = cmd.get_object_list()[0]
86 | if prefix is None:
87 | prefix = name
88 | if filename is None:
89 | candidates = [
90 | '%s.pdb' % (name),
91 | '%s/%s.pdb' % (cmd.get('fetch_path'), name),
92 | '%s/%s/pdb%s.ent.gz' % (local_mirror_divided, name[1:3], name),
93 | ]
94 | for filename in candidates:
95 | if os.path.exists(filename):
96 | break
97 | else:
98 | print 'please provide filename'
99 | return
100 | if not quiet:
101 | print 'loading from %s' % (filename)
102 | remarks = pdbremarks(filename)
103 | if 350 not in remarks:
104 | print 'There is no REMARK 350 in', filename
105 | return
106 | quat = quat350(remarks[350])
107 | for chains in quat:
108 | matrices = quat[chains]
109 | for num in matrices:
110 | mat = matrices[num][0:12]
111 | mat.extend([0,0,0,1])
112 | copy = '%s_%d' % (prefix, num)
113 | if not quiet:
114 | print 'creating %s' % (copy)
115 | cmd.create(copy, '/%s//%s' % (name, '+'.join(chains)))
116 | cmd.alter(copy, 'segi="%d"' % (num))
117 | cmd.transform_object(copy, mat)
118 | cmd.disable(name)
119 | cmd.group('%s_quat' % (prefix), '%s_*' % (prefix))
120 |
121 | cmd.extend('quat', quat)
122 |
123 | # vi:expandtab:smarttab
124 |
--------------------------------------------------------------------------------
/quatWindows.py:
--------------------------------------------------------------------------------
1 | '''
2 | (c) 2010-2011 Thomas Holder, MPI for Developmental Biology
3 |
4 | Module for reading REMARK records from PDB files and in particular
5 | generate quaterny structure from REMARK 350.
6 | '''
7 |
8 | import sys, os
9 | from pymol import cmd, stored
10 |
11 | local_mirror_divided = '/mnt/bio/db/pdb.divided'
12 |
13 | def pdbremarks(filename):
14 | '''
15 | Read REMARK lines from PDB file. Return dictionary with remarkNum as key
16 | and list of lines as value.
17 | '''
18 | remarks = dict()
19 | if not isinstance(filename, basestring):
20 | f = filename
21 | elif filename[-3:] == '.gz':
22 | import gzip
23 | f = gzip.open(filename)
24 | else:
25 | f = open(filename)
26 | for line in f:
27 | recname = line[0:6]
28 | if recname == 'REMARK':
29 | num = int(line[7:10])
30 | lstring = line[11:]
31 | remarks.setdefault(num, []).append(lstring)
32 | return remarks
33 |
34 | def quat350(rem350):
35 | '''
36 | Get transformation matrices for biomolecule 1 from REMARK 350.
37 | '''
38 | biomt = dict()
39 | chains = tuple()
40 | seenbiomolecule = False
41 | for line in rem350:
42 | if line.startswith('BIOMOLECULE:'):
43 | if seenbiomolecule:
44 | break
45 | seenbiomolecule = True
46 | elif line.startswith('APPLY THE FOLLOWING TO CHAINS:'):
47 | chains = tuple(chain.strip() for chain in line[30:].split(','))
48 | elif line.startswith(' AND CHAINS:'):
49 | chains += tuple(chain.strip() for chain in line[30:].split(','))
50 | elif line.startswith(' BIOMT'):
51 | row = int(line[7])
52 | num = int(line[8:12])
53 | vec = line[12:].split()
54 | vec = map(float, vec)
55 | biomt.setdefault(chains, dict()).setdefault(num, []).extend(vec)
56 | return biomt
57 |
58 | def quat(name=None, filename=None, prefix=None, quiet=0):
59 | '''
60 | DESCRIPTION
61 |
62 | Read REMARK 350 from `filename` and create biological unit
63 | (quaternary structure)
64 |
65 | USAGE
66 |
67 | quat [name [, filename [, prefix]]]
68 |
69 | ARGUMENTS
70 |
71 | name = string: name of object and basename of PDB file, if
72 | filename is not given {default: first loaded object}
73 |
74 | filename = string: file path {default: .pdb}
75 |
76 | prefix = string: prefix for new objects {default: }
77 |
78 | EXAMPLE
79 |
80 | fetch 1rmv
81 | quat 1rmv
82 | '''
83 | quiet = int(quiet)
84 | if name is None:
85 | name = cmd.get_object_list()[0]
86 | if prefix is None:
87 | prefix = name
88 | if filename is None:
89 | candidates = [
90 | '%s.pdb' % (name),
91 | '%s/%s.pdb' % (cmd.get('fetch_path'), name),
92 | '%s/%s/pdb%s.ent.gz' % (local_mirror_divided, name[1:3], name),
93 | ]
94 | for filename in candidates:
95 | if os.path.exists(filename):
96 | break
97 | else:
98 | print 'please provide filename'
99 | return
100 | if not quiet:
101 | print 'loading from %s' % (filename)
102 | remarks = pdbremarks(filename)
103 | if 350 not in remarks:
104 | print 'There is no REMARK 350 in', filename
105 | return
106 | quat = quat350(remarks[350])
107 | for chains in quat:
108 | matrices = quat[chains]
109 | for num in matrices:
110 | mat = matrices[num][0:12]
111 | mat.extend([0,0,0,1])
112 | copy = '%s_%d' % (prefix, num)
113 | if not quiet:
114 | print 'creating %s' % (copy)
115 | cmd.create(copy, '/%s//%s' % (name, '+'.join(chains)))
116 | cmd.alter(copy, 'segi="%d"' % (num))
117 | cmd.transform_object(copy, mat)
118 | cmd.disable(name)
119 | cmd.group('%s_quat' % (prefix), '%s_*' % (prefix))
120 |
121 | cmd.extend('quat', quat)
122 |
123 | # vi:expandtab:smarttab
124 |
--------------------------------------------------------------------------------
/roundview.py:
--------------------------------------------------------------------------------
1 | from __future__ import division
2 | from __future__ import print_function
3 | # -*- coding: utf-8 -*-
4 |
5 | """
6 |
7 | version 1.0 26 October 2015
8 | Posted in github for first time.
9 |
10 | version 1.1 23 November 2015
11 | Corrected description of the rounding off the matrix elements.
12 | Corrected hard wrapped text the broke the script.
13 | Added example of running program as a horizontal script.
14 | Made code pep8 compliant (changed use of blank lines,
15 | removed whitespaces in defualt arguments assignments,
16 | inserted whitespaces after commas in lists,
17 | removed whitespaces at the ends of lines).
18 | Added version number.
19 |
20 | version 1.2 23 May 2016
21 | Edited copyright notice.
22 | Corrected typos
23 |
24 | version 1.3 23 July 2016
25 | Added missing parenthesis at end of file.
26 |
27 |
28 | Copyright Notice
29 | ================
30 |
31 | Copyright (C) 2016 Blaine Mooers
32 |
33 | This program is free software: you can redistribute it and/or modify
34 | it under the terms of the GNU General Public License as published by
35 | the Free Software Foundation, either version 3 of the License.
36 |
37 | This program is distributed in the hope that it will be useful,
38 | but WITHOUT ANY WARRANTY; without even the implied warranty of
39 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
40 | See the GNU General Public License for more details:
41 | http://www.gnu.org/licenses/.
42 |
43 | The source code in this file is copyrighted, but you can
44 | freely use and copy it as long as you don't change or remove any of
45 | the copyright notices.
46 |
47 | Blaine Mooers, PhD
48 | blaine-mooers@ouhsc.edu
49 | 975 NE 10th St, BRC 466
50 | University of Oklahoma Health Sciences Center,
51 | Oklahoma City, OK, USA 73104
52 |
53 | """
54 | from pymol import stored, cmd
55 | __author__ = "Blaine Mooers"
56 | __copyright__ = "Blaine Mooers, University of Oklahoma Health Sciences Center, Oklahoma City, OK, USA 73104"
57 | __license__ = "GPL-3"
58 | __version__ = "1.0.2"
59 | __credits__ = ["William Beasley","Chiedza Kanyumbu"]
60 | # people who reported bug fixes, made suggestions, etc.
61 | __date__ = "30 May 2016"
62 | __maintainer__ = "Blaine Mooers"
63 | __email__ = "blaine-mooers@ouhsc.edu"
64 | __status__ = "Production"
65 |
66 |
67 | def roundview(StoredView=0, decimal_places=2, outname="roundedview.txt"):
68 |
69 | """
70 | DESCRIPTION
71 |
72 | Adds the command "roundview" that gets a view (default is 0,
73 | the current view; you can get a stored view assigned to some
74 | other digit with the view command) and rounds to two decimal
75 | places (two digits to the right of the decimal point) the
76 | viewpoint matrix elements and rewrites the matrix elements
77 | on a single line with no whitespaces and a semicolon at the
78 | end. The saved space eases the making of a single line of
79 | PyMOL commands separated by semicolons. This enables rapid
80 | and interactive editing of chunks of PyMOL commands. The
81 | viewpoints are appended to the bottom of a text file in the
82 | present working directory called "roundedview.txt". The line
83 | could be easier to copy from this file than from the command
84 | history window in the external gui. A semicolon with nothing
85 | to the right of it at the end of a line of grouped commands
86 | is harmless.
87 |
88 |
89 | USAGE
90 |
91 | roundview [view, decimal_places, outname]
92 |
93 | Note that the values in the [] are optional.
94 |
95 | The default values for the arguments of the function
96 | are "0,2, roundedview.txt".
97 |
98 | Simple one-line example with roundview.py script in current working
99 | directory--check by typing 'pwd' and 'ls *.py' on the command line. PyMOL
100 | should return 'roundview.py' in the lisf of files in the external (top) gui.
101 | Next, paste the following command on the external (top) commandline, hit
102 | return, and wait 5-10 seconds:
103 |
104 | fetch 1lw9, async=0; run roundview.py; roundview 0,1
105 |
106 |
107 | The following view setting will be returned without the blackslash.
108 |
109 | set_view (1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,-155.2,35.1,11.5,9.7,122.3,188.0,-20.0);
110 |
111 | Advanced option:
112 |
113 | Copy roundview.py to the folder ~/.pymol/startup and then
114 | the command will always be accessible. You may have to
115 | create these directories.
116 |
117 |
118 | 18 elements of the view matrix (0-17)
119 |
120 | 0 - 8 = column-major 3x3 matrix that rotates the model axes
121 | to camera axes
122 |
123 | 9 - 11 = origin of rotation relative to the camera
124 | in camera space
125 |
126 | 12 - 14 = origin of rotation in model space
127 |
128 | 15 = front plane distance from the camera
129 |
130 | 16 = rear plane distance from the camera
131 |
132 | 17 = orthoscopic flag
133 | (not implemented in older versions)
134 |
135 | """
136 |
137 | #convert the commandline arguments from strings to integers
138 |
139 | StoredView = int(StoredView)
140 | decimal_places = int(decimal_places)
141 |
142 |
143 | #call the get_view function
144 |
145 | m = cmd.get_view(StoredView)
146 |
147 |
148 | #Make a list of the elements in the orientation matrix.
149 |
150 | myList = [m[0], m[1], m[2], m[3], m[4], m[5], m[6],
151 | m[7], m[8], m[9], m[10], m[11], m[12], m[13], m[14],
152 | m[15], m[16], m[17]]
153 |
154 |
155 | #Round off the matrix elements to two decimal places (two fractional places)
156 | #This rounding approach solved the problem of unwanted
157 | #whitespaces when I tried using a string format statement
158 |
159 | myRoundedList = [ round(elem, decimal_places) for elem in myList]
160 |
161 |
162 | #x is the format of the output. The whitespace is required
163 | #between the "set_view" and "(".
164 |
165 | x = 'set_view ({0},{1},{2},{3},{4},{5},{6},{7},\
166 | {8},{9},{10},{11},{12},{13},{14},{15},{16},{17});'
167 |
168 |
169 | #print to the external gui.
170 |
171 | print x.format(*myRoundedList)
172 |
173 |
174 | #Write to a text file.
175 |
176 | myFile = open("roundedview.txt", "a")
177 | myFile.write(x.format(*myRoundedList) + "\n")
178 | myFile.close()
179 | return
180 |
181 |
182 | #The extend command makes roundview into a PyMOL command.
183 |
184 | cmd.extend("roundview", roundview)
185 |
--------------------------------------------------------------------------------
/roundviewWindows.py:
--------------------------------------------------------------------------------
1 | from __future__ import division
2 | from __future__ import print_function
3 |
4 | """
5 |
6 | version 1.0 26 October 2015
7 | Posted in github for first time.
8 |
9 | version 1.1 23 November 2015
10 | Corrected description of the rounding off the matrix elements.
11 | Corrected hard wrapped text the broke the script.
12 | Added example of running program as a horizontal script.
13 | Made code pep8 compliant (changed use of blank lines,
14 | removed whitespaces in defualt arguments assignments,
15 | inserted whitespaces after commas in lists,
16 | removed whitespaces at the ends of lines).
17 | Added version number.
18 |
19 | version 1.2 23 May 2016
20 | Edited copyright notice.
21 | Corrected typos
22 |
23 | version 1.3 23 July 2016
24 | Added missing parenthesis at end of file.
25 |
26 |
27 | Copyright Notice
28 | ================
29 |
30 | Copyright (C) 2016 Blaine Mooers
31 |
32 | This program is free software: you can redistribute it and/or modify
33 | it under the terms of the GNU General Public License as published by
34 | the Free Software Foundation, either version 3 of the License.
35 |
36 | This program is distributed in the hope that it will be useful,
37 | but WITHOUT ANY WARRANTY; without even the implied warranty of
38 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
39 | See the GNU General Public License for more details:
40 | http://www.gnu.org/licenses/.
41 |
42 | The source code in this file is copyrighted, but you can
43 | freely use and copy it as long as you don't change or remove any of
44 | the copyright notices.
45 |
46 | Blaine Mooers, PhD
47 | blaine-mooers@ouhsc.edu
48 | 975 NE 10th St, BRC 466
49 | University of Oklahoma Health Sciences Center,
50 | Oklahoma City, OK, USA 73104
51 |
52 | """
53 | from pymol import stored, cmd
54 | __author__ = "Blaine Mooers"
55 | __copyright__ = "Blaine Mooers, University of Oklahoma Health Sciences Center, Oklahoma City, OK, USA 73104"
56 | __license__ = "GPL-3"
57 | __version__ = "1.0.2"
58 | __credits__ = ["William Beasley","Chiedza Kanyumbu"]
59 | # people who reported bug fixes, made suggestions, etc.
60 | __date__ = "30 May 2016"
61 | __maintainer__ = "Blaine Mooers"
62 | __email__ = "blaine-mooers@ouhsc.edu"
63 | __status__ = "Production"
64 |
65 |
66 | def roundview(StoredView=0, decimal_places=2, outname="roundedview.txt"):
67 |
68 | """
69 | DESCRIPTION
70 |
71 | Adds the command "roundview" that gets a view (default is 0,
72 | the current view; you can get a stored view assigned to some
73 | other digit with the view command) and rounds to two decimal
74 | places (two digits to the right of the decimal point) the
75 | viewpoint matrix elements and rewrites the matrix elements
76 | on a single line with no whitespaces and a semicolon at the
77 | end. The saved space eases the making of a single line of
78 | PyMOL commands separated by semicolons. This enables rapid
79 | and interactive editing of chunks of PyMOL commands. The
80 | viewpoints are appended to the bottom of a text file in the
81 | present working directory called "roundedview.txt". The line
82 | could be easier to copy from this file than from the command
83 | history window in the external gui. A semicolon with nothing
84 | to the right of it at the end of a line of grouped commands
85 | is harmless.
86 |
87 |
88 | USAGE
89 |
90 | roundview [view, decimal_places, outname]
91 |
92 | Note that the values in the [] are optional.
93 |
94 | The default values for the arguments of the function
95 | are "0,2, roundedview.txt".
96 |
97 | Simple one-line example with roundview.py script in current working
98 | directory--check by typing 'pwd' and 'ls *.py' on the command line. PyMOL
99 | should return 'roundview.py' in the lisf of files in the external (top) gui.
100 | Next, paste the following command on the external (top) commandline, hit
101 | return, and wait 5-10 seconds:
102 |
103 | fetch 1lw9, async=0; run roundview.py; roundview 0,1
104 |
105 |
106 | The following view setting will be returned without the blackslash.
107 |
108 | set_view (1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,-155.2,35.1,11.5,9.7,122.3,188.0,-20.0);
109 |
110 | Advanced option:
111 |
112 | Copy roundview.py to the folder ~/.pymol/startup and then
113 | the command will always be accessible. You may have to
114 | create these directories.
115 |
116 |
117 | 18 elements of the view matrix (0-17)
118 |
119 | 0 - 8 = column-major 3x3 matrix that rotates the model axes
120 | to camera axes
121 |
122 | 9 - 11 = origin of rotation relative to the camera
123 | in camera space
124 |
125 | 12 - 14 = origin of rotation in model space
126 |
127 | 15 = front plane distance from the camera
128 |
129 | 16 = rear plane distance from the camera
130 |
131 | 17 = orthoscopic flag
132 | (not implemented in older versions)
133 |
134 | """
135 |
136 | #convert the commandline arguments from strings to integers
137 |
138 | StoredView = int(StoredView)
139 | decimal_places = int(decimal_places)
140 |
141 |
142 | #call the get_view function
143 |
144 | m = cmd.get_view(StoredView)
145 |
146 |
147 | #Make a list of the elements in the orientation matrix.
148 |
149 | myList = [m[0], m[1], m[2], m[3], m[4], m[5], m[6],
150 | m[7], m[8], m[9], m[10], m[11], m[12], m[13], m[14],
151 | m[15], m[16], m[17]]
152 |
153 |
154 | #Round off the matrix elements to two decimal places (two fractional places)
155 | #This rounding approach solved the problem of unwanted
156 | #whitespaces when I tried using a string format statement
157 |
158 | myRoundedList = [ round(elem, decimal_places) for elem in myList]
159 |
160 |
161 | #x is the format of the output. The whitespace is required
162 | #between the "set_view" and "(".
163 |
164 | x = 'set_view ({0},{1},{2},{3},{4},{5},{6},{7},\
165 | {8},{9},{10},{11},{12},{13},{14},{15},{16},{17});'
166 |
167 |
168 | #print to the external gui.
169 |
170 | print x.format(*myRoundedList)
171 |
172 |
173 | #Write to a text file.
174 |
175 | myFile = open("roundedview.txt", "a")
176 | myFile.write(x.format(*myRoundedList) + "\n")
177 | myFile.close()
178 | return
179 |
180 |
181 | #The extend command makes roundview into a PyMOL command.
182 |
183 | cmd.extend("roundview", roundview)
184 |
--------------------------------------------------------------------------------
/site31labels.pml:
--------------------------------------------------------------------------------
1 | label n. CG and i. 70, "%s %s" % (resn,resi)
2 | label n. ND1 and i. 31, "%s %s" % (resn, resi)
3 |
--------------------------------------------------------------------------------
/site31labelsWindows.pml:
--------------------------------------------------------------------------------
1 | label n. CG and i. 70, "%s %s" % (resn,resi)
2 | label n. ND1 and i. 31, "%s %s" % (resn, resi)
3 |
--------------------------------------------------------------------------------
/startupAliasesWindows.py:
--------------------------------------------------------------------------------
1 | from __future__ import print_function
2 | """
3 | DESCRIPTION
4 |
5 | On the startup of PyMOL, this script defines a number of aliases.
6 | The aliases are listed here instead of in the pymolrc file
7 | to avoid clutter of the command history window. Source this
8 | file from your .pymolrc file on the mac or linux or
9 | from your pymolrc.pml file on Windows by adding the command:
10 |
11 | run ~/Scripts/PyMOLScripts/startupAliases.py
12 |
13 | Requires quat.py from the PyMOL Wiki
14 | (http://www.pymolwiki.org/index.php/BiologicalUnit/Quat)
15 |
16 | Store quat.py in ~/Scripts/PyMOLScripts/.
17 |
18 | Tested on PyMOL versions 1.5.0.5, 1.8.0.5, 1.8.1.0 and 1.8.2.0
19 |
20 | No guarantee is given that this script will work with older
21 | or newer versions of PyMOL.
22 |
23 |
24 | Copyright Notice
25 | ================
26 |
27 | Copyright (C) 2016 Blaine Mooers
28 |
29 | This program is free software: you can redistribute it and/or modify
30 | it under the terms of the GNU General Public License as published by
31 | the Free Software Foundation, either version 3 of the License.
32 |
33 | This program is distributed in the hope that it will be useful,
34 | but WITHOUT ANY WARRANTY; without even the implied warranty of
35 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36 | See the GNU General Public License for more details:
37 | http://www.gnu.org/licenses/.
38 |
39 | The source code in this file is copyrighted, but you can
40 | freely use and copy it as long as you don't change or remove any of
41 | the copyright notices.
42 |
43 | Blaine Mooers , PhD
44 | blaine-mooers@ouhsc.edu
45 | 975 NE 10th St, BRC 466
46 | University of Oklahoma Health Sciences Center,
47 | Oklahoma City, OK, USA 73104
48 |
49 | """
50 | from pymol import cmd
51 | __author__ = "Blaine Mooers"
52 | __copyright__ = "Blaine Mooers, University of Oklahoma Health Sciences Center, Oklahoma City, OK, USA 73104"
53 | __license__ = "GPL-3"
54 | __version__ = "1.0.3"
55 | __credits__ = ["William Beasley","Chiedza Kanyumbu"]
56 | # people who reported bug fixes, made suggestions, etc.
57 | __date__ = "24 July 2016"
58 | __maintainer__ = "Blaine Mooers"
59 | __email__ = "blaine-mooers@ouhsc.edu"
60 | __status__ = "Production"
61 |
62 | def SA():
63 | '''
64 | DESCRIPTION
65 |
66 | startupAliases.py Copyright (C) 2016 Blaine Mooers.
67 | This script comes with ABSOLUTELY NO WARRANTY; for details,
68 | please see the license file.
69 |
70 | Copy to ~/Scripts/PyMOLScripts/.
71 | Add this command on one line in your .pymolrc file
72 | (pymolrc.pml on Windows):
73 |
74 | run ~/Scripts/PyMOLScripts/startupAliases.py
75 |
76 | Format of list below:
77 | alias name, description of alias: PDB code (where applicable).
78 |
79 | Molecules in standard orientations:
80 |
81 | T4L, WT T4 lysozyme (1.09 ang) as a ribbon diagram: 3fa0.
82 | U8, 16-mer dsRNA with 8 contiguous Us. U-helix RaNA (1.37 ang): 3nd3.
83 | WC8, 16-mer RNA with all Watson-Crick base pairs (1.52 ang): 3nd4.
84 | N9, neuraminidase as cartoon, biological unit (1.55 ang): 4dgr.
85 | GGT, gamma glutamyl transpeptidase as cartoon (1.67 ang): 4gdx.
86 | GU, 10-mer RNA with eight GU base pairs (1.32 ang): 4pco.
87 |
88 |
89 | Complex figures to serve as templates:
90 |
91 | BST, Base-stacking figure, (1.32 ang): 4pco.
92 | LG, Electron density map of nine sugar glycan (1.55 ang): 4dgr.
93 | NA, Sodium cation in major groove of 16-mer RNA (1.52 ang): 3nd4.
94 |
95 |
96 | Complex representations applied to any visible molecular object:
97 |
98 | AO, Make ambient occlusion image. Requires global view of protein.
99 | BU, Display biological unit.
100 | CB, Define color blind compatible coloring scheme.
101 | BW, Make black and white ribbon cartoon on white background.
102 | CSS, Color ribbon and cartoons by secondary structure: red, green and yellow.
103 | CBSS, Color ribbon and cartoons with colorblind friendly colors.
104 | CR, Make colored filled-ring cartoon of nucleic acids..
105 | FR, Make filled-ring cartoon of nucleic acids.
106 | SE, Make SAXS envelope from a bead model.
107 |
108 | Type the alias name to execute the commands. The names are case sensitive.
109 |
110 | Type 'help ' (e.g., help T4L) for a description of the
111 | alias and for two sets of commands. The first set of commands has
112 | line breaks for easy selection single lines of commands. The second
113 | set of commands is one one line for easy copying and pasting of the
114 | entire horizontal script. The commands can be copied from the
115 | command history window and pasted onto the command line for code
116 | reuse. Some aliases require additional scripts.
117 |
118 | Type 'SA' to refresh the list of aliases.
119 |
120 | Type 'help rline' to see commands for moving cursor on the command line.
121 |
122 | '''
123 | print(SA.__doc__)
124 | cmd.extend('SA',SA)
125 |
126 |
127 | def T4L():
128 | '''
129 | DESCRIPTION
130 |
131 | WT T4 lysozyme as ribbon diagram (1.08 Ang): 3FA0.
132 |
133 | USAGE
134 |
135 | Type 'T4L' to activate. Type 'help T4L' to see this documentation
136 | printed to the command history window. Select from the command
137 | history individual lines of code to build a new script. Select the
138 | hortizontal script at the bottom if retaining most of the commands
139 | in your new script. Copy and paste onto the command line below.
140 | Works only with the command line immediately under the command
141 | history window at the top of the gui.
142 |
143 | The commands with linebreaks:
144 |
145 | delete all;
146 | fetch 3fa0,type=pdb,async=0;
147 | orient;
148 | turn z,-90;
149 | turn y,-5;
150 | turn x,10;
151 | hide everything;
152 | bg_color white;
153 | show cartoon;
154 | color red, ss H;
155 | color yellow, ss S;
156 | color green, ss L+;
157 | set_view (-0.18,-0.69,-0.7,0.98,-0.17,-0.09,-0.06,-0.7,0.71,0.0,0.0,-165.67,34.77,11.27,9.52,132.07,199.27,-20.0);
158 | ray 1500,1600;
159 |
160 | The commands without linebreaks:
161 |
162 | delete all;fetch 3fa0,type=pdb,async=0;orient;turn z,-90;turn y,-5;turn x,10; hide everything; bg_color white;show cartoon;color red, ss H;color yellow, ss S;color green, ss L+;set_view (-0.18,-0.69,-0.7,0.98,-0.17,-0.09,-0.06,-0.7,0.71,0.0,0.0,-165.67,34.77,11.27,9.52,132.07,199.27,-20.0); ray 1500,1600;
163 |
164 | '''
165 | cmd.reinitialize()
166 | cmd.fetch('3fa0', type='pdb', async='0')
167 | cmd.orient()
168 | cmd.turn('z', '-90')
169 | cmd.turn('y', '-5')
170 | cmd.turn('x', '10')
171 | cmd.hide('everything')
172 | cmd.bg_color('white')
173 | cmd.show('cartoon')
174 | cmd.color('red', 'ss H')
175 | cmd.color('yellow', 'ss S')
176 | cmd.color('green', 'ss L+')
177 | cmd.set_view('(-0.18,-0.69,-0.7,0.98,-0.17,-0.09,-0.06,-0.7,0.71,0.0,0.0,-165.67,34.77,11.27,9.52,132.07,199.27,-20.0)')
178 | cmd.ray('1500', '1600')
179 | cmd.extend('T4L',T4L)
180 |
181 |
182 | def U8():
183 | '''
184 | DESCRIPTION
185 |
186 | 16-mer dsRNA with 8 contiguous Us. U-helix RNA (1.37 Ang): 3nd3.
187 | Has one strand in the asymmetric unit. Uses quat.py to generate
188 | the second strand. Cartoon with filled rings and bases cartoon.
189 |
190 | USAGE
191 |
192 | Type 'U8' to activate. Type 'help U8' to see this documentation
193 | printed to the command history window. Select from the command
194 | history individual lines of code to build a new script. Select the
195 | hortizontal script at the bottom if retaining most of the commands
196 | in your new script. Copy and paste onto the command line below.
197 | Works only with the command line immediately under the command
198 | history window at the top of the gui.
199 |
200 | The commands with linebreaks:
201 |
202 | delete all;
203 | fetch 3nd3,type=pdb,async=0;
204 | run /Users/blaine-mooers/Scripts/PyMOLScripts/quat.py;
205 | quat 3nd3;
206 | hide everything;
207 | bg_color white;
208 | show sticks;
209 | set cartoon_ring_mode, 3;
210 | set cartoon_ring_finder, 1;
211 | set cartoon_ladder_mode, 1;
212 | set cartoon_nucleic_acid_mode, 4;
213 | set cartoon_ring_transparency, 0.5;
214 | as cartoon;
215 | set_view (-1.0,-0.03,0.06,-0.06,0.01,-1.0,0.04,-1.0,-0.01,-0.09,-0.02,-168.02,7.85,15.56,-0.21,137.38,199.33,-20.0);draw;
216 |
217 | The commands without linebreaks:
218 |
219 | delete all;fetch 3nd3,type=pdb,async=0;run /Users/blaine-mooers/Scripts/PyMOLScripts/quat.py;quat 3nd3;hide everything;bg_color white; show sticks;set cartoon_ring_mode, 3;set cartoon_ring_finder, 1;set cartoon_ladder_mode, 1;set cartoon_nucleic_acid_mode, 4;set cartoon_ring_transparency, 0.5;as cartoon;set_view (-1.0,-0.03,0.06,-0.06,0.01,-1.0,0.04,-1.0,-0.01,-0.09,-0.02,-168.02,7.85,15.56,-0.21,137.38,199.33,-20.0);draw;
220 |
221 | '''
222 |
223 | cmd.reinitialize()
224 | cmd.fetch('3nd3', type='pdb', async='0')
225 | cmd.do('run /Users/blaine-mooers/Scripts/PyMOLScripts/quat.py')
226 | cmd.do('quat 3nd3')
227 | cmd.hide('everything')
228 | cmd.bg_color('white')
229 | cmd.show('sticks')
230 | cmd.set('cartoon_ring_mode', '3')
231 | cmd.set('cartoon_ring_finder', '1')
232 | cmd.set('cartoon_ladder_mode', '1')
233 | cmd.set('cartoon_nucleic_acid_mode', '4')
234 | cmd.set('cartoon_ring_transparency', '0.5')
235 | cmd.show_as('cartoon')
236 | cmd.set_view('(-1.0,-0.03,0.06,-0.06,0.01,-1.0,0.04,-1.0,-0.01,-0.09,-0.02,-168.02,7.85,15.56,-0.21,137.38,199.33,-20.0)')
237 | cmd.draw()
238 | cmd.extend('U8',U8)
239 |
240 |
241 | def WC8():
242 | '''
243 | DESCRIPTION
244 |
245 | 16-mer dsRNA, Watson-Crick helix RNA. 1.55 Angstrom
246 | resolution: 3nd4. Has one strand in the asymmetric unit.
247 | Needs quat.py to generate the second strand. Use the
248 | BU alias. Cartoon with filled rings and bases cartoon.
249 |
250 |
251 | USAGE
252 |
253 | Type 'WC8' to activate. Type 'help WC8' to see this documentation
254 | printed to the command history window. Select from the command
255 | history individual lines of code to build a new script. Select the
256 | hortizontal script at the bottom if retaining most of the commands
257 | in your new script. Copy and paste onto the command line below.
258 | Works only with the command line immediately under the command
259 | history window at the top of the gui.
260 |
261 | The commands with linebreaks:
262 |
263 | delete all;
264 | fetch 3nd4,type=pdb,async=0;
265 | hide everything;
266 | run /Users/blaine-mooers/Scripts/PyMOLScripts/quat.py;
267 | quat 3nd4;
268 | bg_color white;
269 | show sticks;
270 | set stick_radius, 0.12;
271 | set nb_spheres_size, 0.25;
272 | show nb_spheres;
273 | set stick_ball, on;
274 | set stick_ball_ratio, 1.8;
275 | set_view (-0.99,-0.03,0.17,-0.18,0.02,-0.98,0.03,-1.0,-0.03,0.0,0.0,-169.97,8.1,15.62,-1.69,139.24,200.7,-20.0);
276 | hide everything,name H*;
277 | rock
278 |
279 | The commands without linebreaks:
280 |
281 | delete all; fetch 3nd4,type=pdb,async=0;hide everything; run /Users/blaine-mooers/Scripts/PyMOLScripts/quat.py; quat 3nd4;bg_color white; show sticks; set stick_radius, 0.12; set nb_spheres_size, 0.25; show nb_spheres; set stick_ball, on; set stick_ball_ratio, 1.8;set_view (-0.99,-0.03,0.17,-0.18,0.02,-0.98,0.03,-1.0,-0.03,0.0,0.0,-169.97,8.1,15.62,-1.69,139.24,200.7,-20.0);hide everything, name H*;rock
282 |
283 | '''
284 | cmd.reinitialize()
285 | cmd.fetch('3nd4', type='pdb', async='0')
286 | cmd.remove('name H*')
287 | cmd.hide('everything')
288 | cmd.do('run /Users/blaine-mooers/Scripts/PyMOLScripts/quat.py')
289 | cmd.do('quat 3nd4')
290 | cmd.bg_color('white')
291 | cmd.do('show stick')
292 | cmd.do('set stick_radius, 0.12')
293 | cmd.do('set nb_spheres_size, 0.25')
294 | cmd.do('show nb_spheres')
295 | cmd.do('set stick_ball, on')
296 | cmd.do('set stick_ball_ratio, 1.8')
297 | cmd.set_view('(-0.96,-0.03,0.3,-0.31,0.02,-0.95,0.03,-1.0,-0.03,0.0,0.0,-231.24,8.16,15.68,-1.66,200.47,262.01,-20.0)')
298 | cmd.rock()
299 | cmd.extend('WC8',WC8)
300 |
301 |
302 | def N9():
303 | '''
304 | DESCRIPTION
305 |
306 | Influenza N9 neuraminidase at 1.55 Angstrom resolution, PDB code
307 | 4dgr. The biological unit has four copies of the asymmetric unit.
308 | View is down the four-fold axis. Requires the quat.py script by
309 | Thomas Holder and available at the PyMOL Wiki page. Store quat.py
310 | in ~/Scripts/PyMOLScripts.
311 |
312 | USAGE
313 |
314 | Type 'N9' to activate. Type 'help N9' to see this documentation
315 | printed to the command history window. Select from the command
316 | history individual lines of code to build a new script. Select the
317 | hortizontal script at the bottom if retaining most of the commands
318 | in your new script. Copy and paste onto the command line below.
319 | Works only with the command line immediately under the command
320 | history window at the top of the gui.
321 |
322 | The commands with linebreaks:
323 |
324 | delete all;
325 | fetch 4dgr, type=pdb, async=0;
326 | run /Users/blaine-mooers/Scripts/PyMOLScripts/quat.py;
327 | quat 4dgr;
328 | as cartoon;
329 | bg_color white;
330 | color red, 4dgr_1 and ss H;
331 | color yellow,4dgr_1 and ss S;
332 | color green, 4dgr_1 and ss L+;
333 | color cyan, (not 4dgr_1 and ss H);
334 | color magenta, (not 4dgr_1 and ss S);
335 | color orange, (not 4dgr_1 and ss L+);
336 | set_view (0.98,-0.22,0.01,0.22,0.98,0.02,-0.01,-0.02,1.0,-0.0,0.0,-323.44,1.46,5.33,56.19,274.72,372.15,-20.0);
337 | draw
338 |
339 | The commands without linebreaks:
340 |
341 | delete all;fetch 4dgr, type=pdb, async=0;run /Users/blaine-mooers/Scripts/PyMOLScripts/quat.py; quat 4dgr;as cartoon; bg_color white;color red, 4dgr_1 and ss H;color yellow,4dgr_1 and ss S;color green, 4dgr_1 and ss L+;color cyan, (not 4dgr_1 and ss H);color magenta, (not 4dgr_1 and ss S);color orange, (not 4dgr_1 and ss L+);set_view (0.98,-0.22,0.01,0.22,0.98,0.02,-0.01,-0.02,1.0,-0.0,0.0,-323.44,1.46,5.33,56.19,274.72,372.15,-20.0); draw
342 |
343 | '''
344 | cmd.reinitialize()
345 | cmd.fetch('4dgr', type='pdb', async='0')
346 | cmd.do('run /Users/blaine-mooers/Scripts/PyMOLScripts/quat.py')
347 | cmd.do('quat 4dgr')
348 | cmd.show_as('cartoon')
349 | cmd.bg_color('white')
350 | cmd.color('red', '4dgr_1 and ss H')
351 | cmd.color('yellow', '4dgr_1 and ss S')
352 | cmd.color('green', '4dgr_1 and ss L+')
353 | cmd.color('cyan', '(not 4dgr_1 and ss H)')
354 | cmd.color('magenta', '(not 4dgr_1 and ss S)')
355 | cmd.color('orange', '(not 4dgr_1 and ss L+)')
356 | cmd.set_view('(0.98,-0.22,0.01,0.22,0.98,0.02,-0.01,-0.02,1.0,-0.0,0.0,-323.44,1.46,5.33,56.19,274.72,372.15,-20.0)')
357 | cmd.draw()
358 | cmd.extend('N9',N9)
359 |
360 |
361 | def GGT():
362 | '''
363 | DESCRIPTION
364 |
365 | WT human gamma glutamyl transpeptidase at 1.67 Angstrom
366 | resolution as cartoon. PDB Code 4gdx.
367 |
368 | USAGE
369 |
370 | Type 'GGT' to activate. Type 'help GGT' to see this documentation
371 | printed to the command history window. Select from the command
372 | history individual lines of code to build a new script. Select the
373 | hortizontal script at the bottom if retaining most of the commands
374 | in your new script. Copy and paste onto the command line below.
375 | Works only with the command line immediately under the command
376 | history window at the top of the gui.
377 |
378 | The commands with linebreaks:
379 |
380 | delete all;
381 | fetch 4gdx, type=pdb, async=0;
382 | remove name H*;
383 | as cartoon;
384 | bg_color white;
385 | hide (name c+o+n);
386 | set cartoon_side_chain_helper, on;color red, 4gdx and ss H;
387 | color yellow,4gdx and ss S;color green,4gdx and ss L+;
388 | select ASNNAG, resn NAG or resi 95 or i. 120 or i. 230 or
389 | i. 266 or i. 344 or i. 511 or i. 381;
390 | color red, elem o and ASNNAG;
391 | color blue, elem n and ASNNAG;
392 | color yellow, elem c and ASNNAG;
393 | show sticks,ASNNAG;
394 | disable ASNNAG;
395 | set_view (0.55,-0.83,0.07,0.5,0.26,-0.82,0.66,0.49,0.56,0.0,0.0,-197.16,-22.42,-22.69,-12.01,155.44,238.88,-20.0);
396 | draw
397 |
398 | The commands without linebreaks:
399 |
400 | delete all;fetch 4gdx, type=pdb, async=0;remove name H*;as cartoon;bg_color white; hide (name c+o+n);set cartoon_side_chain_helper, on;color red, 4gdx and ss H; color yellow,4gdx and ss S;color green,4gdx and ss L+; select ASNNAG,resn NAG or resi 95 or i. 120 or i. 230 or i. 266 or i. 344 ori. 511 or i. 381; color red, elem o and ASNNAG; color blue, elem n and ASNNAG;color yellow, elem c and ASNNAG;show sticks,ASNNAG;disable ASNNAG; set_view(0.55,-0.83,0.07,0.5,0.26,-0.82,0.66,0.49,0.56,0.0,0.0,-197.16,-22.42,-22.69,-12.01,155.44,238.88,-20.0); draw
401 |
402 | '''
403 | cmd.reinitialize()
404 | cmd.fetch('4gdx', type='pdb', async='0')
405 | cmd.remove('name H*')
406 | cmd.show_as('cartoon')
407 | cmd.bg_color('white')
408 | cmd.hide('(name c+o+n)')
409 | cmd.set('cartoon_side_chain_helper', 'on')
410 | cmd.color('red', '4gdx and ss H')
411 | cmd.color('yellow', '4gdx and ss S')
412 | cmd.color('green', '4gdx and ss L+')
413 | cmd.select('ASNNAG', 'resn NAG or resi 95 or i. 120 or i. 230 or i. 266 or i. 344 or i. 511 or i. 381')
414 | cmd.color('red', 'elem o and ASNNAG')
415 | cmd.color('blue', 'elem n and ASNNAG')
416 | cmd.color('yellow', 'elem c and ASNNAG')
417 | cmd.show('sticks', 'ASNNAG')
418 | cmd.disable('ASNNAG')
419 | cmd.set_view('(0.55,-0.83,0.07,0.5,0.26,-0.82,0.66,0.49,0.56,0.0,0.0,-197.16,-22.42,-22.69,-12.01,155.44,238.88,-20.0)')
420 | cmd.draw()
421 | cmd.extend('GGT',GGT)
422 |
423 |
424 | def GU():
425 | '''
426 | DESCRIPTION
427 |
428 | 10-mer dsRNA with 8 contiguous Us. U-helix RNA.
429 | 1.32 Angstrom resolution: 4PCO. Has five strands in
430 | the asymmetric unit. Deleted chain E and cobalt
431 | hexammine 102. Cartoon with filled rings and
432 | bases cartoon.
433 |
434 |
435 | USAGE
436 |
437 | Type 'GU' to activate. Type 'help GU' to see this documentation
438 | printed to the command history window. Select from the command
439 | history individual lines of code to build a new script. Select the
440 | hortizontal script at the bottom if retaining most of the commands
441 | in your new script. Copy and paste onto the command line below.
442 | Works only with the command line immediately under the command
443 | history window at the top of the gui.
444 |
445 | The commands with linebreaks:
446 |
447 | delete all;
448 | fetch 4PCO,type=pdb,async=0;
449 | hide everything;
450 | bg_color white;
451 | cartoon oval;
452 | set cartoon_ring_mode, 3;
453 | set cartoon_nucleic_acid_color, blue;
454 | select rna_A, resn A;
455 | select rna_C, resn C;
456 | select rna_G, resn G;
457 | select rna_U, resn U;
458 | color yellow, rna_A;
459 | color red, rna_C;
460 | color gray40, rna_G;
461 | color palecyan, rna_U;
462 | as cartoon;
463 | disable rna_U;
464 | set stick_radius, 0.12;
465 | set nb_spheres_size, 0.3;
466 | show nb_spheres;
467 | set stick_ball, on;
468 | set stick_ball_ratio, 1.8;
469 | show sticks, resn NCO;
470 | show spheres, name Cl;
471 | set_view (0.34,-0.81,0.48,0.89,0.11,
472 | -0.45,0.31,0.58,0.76,-0.0,0.0,-196.36,-9.82,6.76,15.84,159.01,
473 | 233.71,-20.0);
474 | draw
475 |
476 | The commands without linebreaks:
477 |
478 | delete all;fetch 4PCO,type=pdb,async=0;hide everything;bg_color white; cartoon oval;set cartoon_ring_mode, 3;set cartoon_nucleic_acid_color, blue;select rna_A, resn A;select rna_C,resn C;select rna_G, resn G;select rna_U, resn U;color yellow, rna_A; color red, rna_C;color gray40, rna_G; color palecyan, rna_U;as cartoon;disable rna_U; set stick_radius, 0.12;set nb_spheres_size, 0.3; show nb_spheres; set stick_ball, on;set stick_ball_ratio, 1.8; show sticks, resn NCO;show spheres, name Cl; set_view (0.34,-0.81,0.48,0.89,0.11,-0.45,0.31,0.58,0.76,-0.0,0.0,-196.36,-9.82,6.76,15.84,159.01,233.71,-20.0);draw
479 |
480 | '''
481 | cmd.reinitialize();
482 | cmd.fetch('4PCO', type='pdb', async='0')
483 | cmd.hide('everything')
484 | cmd.bg_color('white')
485 | cmd.cartoon('oval')
486 | cmd.set('cartoon_ring_mode', '3')
487 | cmd.set('cartoon_nucleic_acid_color', 'blue')
488 | cmd.select('rna_A', 'resn A')
489 | cmd.select('rna_C', 'resn C')
490 | cmd.select('rna_G', 'resn G')
491 | cmd.select('rna_U', 'resn U')
492 | cmd.color('yellow', 'rna_A')
493 | cmd.color('red', 'rna_C')
494 | cmd.color('gray40', 'rna_G')
495 | cmd.color('palecyan', 'rna_U')
496 | cmd.show_as('cartoon')
497 | cmd.disable('rna_U')
498 | cmd.set('stick_radius', '0.12')
499 | cmd.set('nb_spheres_size', '0.3')
500 | cmd.show('nb_spheres')
501 | cmd.set('stick_ball', 'on')
502 | cmd.set('stick_ball_ratio', '1.8')
503 | cmd.show('sticks', 'resn NCO')
504 | cmd.show('spheres', 'name Cl')
505 | cmd.set_view('(0.34,-0.81, 0.48,0.89,0.11,-0.45,0.31,0.58,0.76,-0.0,0.0,-196.36,-9.82,6.76,15.84,159.01,233.71,-20.0)')
506 | cmd.draw()
507 | cmd.extend('GU',GU)
508 |
509 |
510 | #######Commands to display complex scenes. #############
511 |
512 | def BST():
513 | '''
514 | DESCRIPTION
515 |
516 | G2G3/U9U8 base step , PDB code 4PCO.
517 | From the 1.32 Angstrom resolution structure
518 | of the RNA decamer with 8 GU base pairs.
519 |
520 | USAGE
521 |
522 | Type 'BST' to execute. Type 'help BST' to see this documentation
523 | printed to the command history window. Select from the command
524 | history individual lines of code to build a new script. Select the
525 | hortizontal script at the bottom if retaining most of the commands
526 | in your new script. Copy and paste onto the command line below.
527 | Works only with the command line immediately under the command
528 | history window at the top of the gui.
529 |
530 | The commands with linebreaks:
531 |
532 | delete all;
533 | fetch 4PCO, type=pdb, async=0;
534 | select G2G3, ( ((resi 2 or resi 3) and chain A) or ((resi 8 or resi 9) and chain B));
535 | remove not G2G3;
536 | bg_color white;
537 | show sticks;
538 | set stick_radius=0.14;
539 | set stick_ball, on;
540 | set stick_ball_ratio,1.9;
541 | set_view
542 | (-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);
543 | remove name H*;
544 | select carbon1, element C and (resi 3 or resi 8)
545 | # select lower base pair;
546 | select carbon2, element C and (resi 2 or resi 9)
547 | #select upper base pair;
548 | color gray70, carbon1;
549 | color gray10, carbon2;
550 | show sticks;
551 | space cmyk;
552 | distance hbond1, /4PCO//B/U`9/N3,/4PCO//A/G`2/O6;
553 | distance hbond2, /4PCO//B/U`9/O2,/4PCO//A/G`2/N1;
554 | distance hbond3, /4PCO//A/U`3/N3,/4PCO//B/G`8/O6;
555 | distance hbond4, /4PCO//A/U`3/O2,/4PCO//B/G`8/N1;
556 | color black, hbond1;
557 | color black, hbond2;
558 | color gray70, hbond3;
559 | color gray70, hbond4;
560 | show nb_spheres;
561 | set nb_spheres_size, 0.35;
562 | hide labels;
563 | ray 1600,1000;
564 | png 4PCO.png
565 |
566 | Commands without linebreaks:
567 |
568 | 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 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
569 |
570 | '''
571 | cmd.reinitialize()
572 | cmd.fetch('4PCO', type='pdb', async='0')
573 | cmd.select('G2G3', '( ((resi 2 or resi 3) and chain A)or ((resi 8 or resi 9) and chain B) )')
574 | cmd.remove('not G2G3')
575 | cmd.bg_color('white')
576 | cmd.set('stick_radius', '0.14')
577 | cmd.set('stick_ball', 'on')
578 | cmd.set('stick_ball_ratio', '1.9')
579 | cmd.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)')
580 | cmd.remove('name H*')
581 | cmd.select('carbon1', 'element C and (resi 3 or resi 8)')
582 | cmd.select('carbon2', 'element C and (resi 2 or resi 9)')
583 | cmd.color('gray70', 'carbon1')
584 | cmd.color('gray10', 'carbon2')
585 | cmd.show('sticks')
586 | cmd.space('cmyk')
587 | cmd.distance('hbond1', '/4PCO//B/U`9/N3', '/4PCO//A/G`2/O6')
588 | cmd.distance('hbond2', '/4PCO//B/U`9/O2', '/4PCO//A/G`2/N1')
589 | cmd.distance('hbond3', '/4PCO//A/U`3/N3', '/4PCO//B/G`8/O6')
590 | cmd.distance('hbond4', '/4PCO//A/U`3/O2', '/4PCO//B/G`8/N1')
591 | cmd.color('black', 'hbond1')
592 | cmd.color('black', 'hbond2')
593 | cmd.color('gray70', 'hbond3')
594 | cmd.color('gray70', 'hbond4')
595 | cmd.show('nb_spheres')
596 | cmd.set('nb_spheres_size', '0.35')
597 | cmd.hide('labels')
598 | cmd.ray('1600', '1000')
599 | cmd.png('4PCO.png')
600 | cmd.extend('BST',BST)
601 |
602 |
603 | def LG():
604 | '''
605 | DESCRIPTION
606 |
607 | Nine sugar glycan in influenza N9 neuraminidase at
608 | 1.55 Angstrom resolution, PDB code 4dgr.
609 | The electron density map is contoured at 1.0 sigma.
610 | 39 commands were used to make this figure.
611 |
612 | USAGE
613 |
614 | Type 'LG' to execute. Type 'help LG' to see this documentation
615 | printed to the command history window. Select from the command
616 | history individual lines of code to build a new script. Select the
617 | hortizontal script at the bottom if retaining most of the commands
618 | in your new script. Copy and paste onto the command line below.
619 | Works only with the command line immediately under the command
620 | history window at the top of the gui.
621 |
622 | The commands with linebreaks:
623 |
624 | delete all;
625 | fetch 4dgr, async=0;
626 | fetch 4dgr, type=2fofc,async=0;
627 | select LongGlycan, resi 469:477;
628 | orient LongGlycan;
629 | remove not LongGlycan;
630 | remove name H*;
631 | isomesh 2fofcmap, 4dgr_2fofc, 1, LongGlycan, carve = 1.8;
632 | color density, 2fofcmap;
633 | show sticks;
634 | show spheres;
635 | set stick_radius, .07;
636 | set sphere_scale, .19;
637 | set sphere_scale, .13, elem H;
638 | set bg_rgb=[1, 1, 1];
639 | set stick_quality, 50;
640 | set sphere_quality, 4;
641 | color gray85, elem C;
642 | color red, elem O;
643 | color slate, elem N;
644 | color gray98, elem H;
645 | set stick_color, gray50;
646 | set ray_trace_mode, 1;
647 | set ray_texture, 2;
648 | set antialias, 3;
649 | set ambient, 0.5;
650 | set spec_count, 5;
651 | set shininess, 50;
652 | set specular, 1;
653 | set reflect, .1;
654 | set dash_gap, 0;
655 | set dash_color, black;
656 | set dash_gap, .15;
657 | set dash_length, .05;
658 | set dash_round_ends, 0;
659 | set dash_radius, .05;
660 | set_view (0.34,-0.72,0.61,0.8,0.56,0.22,-0.51,0.4,0.77,0.0,0.0,-81.31,44.64,-9.02,58.62,65.34,97.28,-20.0);
661 | preset.ball_and_stick("all",mode=1);
662 | draw
663 |
664 | Commands without linebreaks:
665 |
666 | delete all;fetch 4dgr, async=0;fetch 4dgr, type=2fofc, async=0;select LongGlycan, resi 469:477;orient LongGlycan;remove not LongGlycan;remove name H*;isomesh 2fofcmap, 4dgr_2fofc, 1, LongGlycan, carve = 1.8;color density, 2fofcmap; show sticks;show spheres;set stick_radius, .07;set sphere_scale, .19;set sphere_scale, .13, elem H;set bg_rgb=[1, 1, 1];set stick_quality, 50;set sphere_quality, 4;color gray85, elem C;color red, elem O;color slate, elem N;color gray98, elem H;set stick_color, gray50;set ray_trace_mode, 1;set ray_texture, 2;set antialias, 3;set ambient, 0.5;set spec_count, 5;set shininess, 50;set specular, 1;set reflect, .1;set dash_gap, 0;set dash_color, black;set dash_gap, .15;set dash_length, .05;set dash_round_ends, 0;set dash_radius, .05;set_view (0.34,-0.72,0.61,0.8,0.56,0.22,-0.51,0.4,0.77,0.0,0.0,-81.31,44.64,-9.02,58.62,65.34,97.28,-20.0);preset.ball_and_stick("all",mode=1);draw
667 |
668 | '''
669 | cmd.reinitialize()
670 | cmd.fetch('4dgr', async='0')
671 | cmd.fetch('4dgr', type='2fofc', async='0')
672 | cmd.select('LongGlycan', 'resi 469:477')
673 | cmd.orient('LongGlycan')
674 | cmd.remove('not LongGlycan')
675 | cmd.remove('name H*')
676 | cmd.isomesh('2fofcmap', '4dgr_2fofc', '1', 'LongGlycan', carve ='1.8')
677 | cmd.color('density', '2fofcmap')
678 | cmd.show('sticks')
679 | cmd.show('spheres')
680 | cmd.set('stick_radius', '.07')
681 | cmd.set('sphere_scale', '.19')
682 | cmd.set('sphere_scale', '.13', 'elem H')
683 | cmd.set('bg_rgb', '[1, 1, 1]')
684 | cmd.set('stick_quality', '50')
685 | cmd.set('sphere_quality', '4')
686 | cmd.color('gray85', 'elem C')
687 | cmd.color('red', 'elem O')
688 | cmd.color('slate', 'elem N')
689 | cmd.color('gray98', 'elem H')
690 | cmd.set('stick_color', 'gray50')
691 | cmd.set('ray_trace_mode', '1')
692 | cmd.set('ray_texture', '2')
693 | cmd.set('antialias', '3')
694 | cmd.set('ambient', '0.5')
695 | cmd.set('spec_count', '5')
696 | cmd.set('shininess', '50')
697 | cmd.set('specular', '1')
698 | cmd.set('reflect', '.1')
699 | cmd.set('dash_gap', '0')
700 | cmd.set('dash_color', 'black')
701 | cmd.set('dash_gap', '.15')
702 | cmd.set('dash_length', '.05')
703 | cmd.set('dash_round_ends', '0')
704 | cmd.set('dash_radius', '.05')
705 | cmd.set_view('(0.34,-0.72,0.61,0.8,0.56,0.22,-0.51,0.4,0.77,0.0,0.0,-81.31,44.64,-9.02,58.62,65.34,97.28,-20.0)')
706 | preset.ball_and_stick("all",mode=1);
707 | cmd.draw()
708 | cmd.extend('LG',LG)
709 |
710 |
711 | def NA():
712 | '''
713 | DESCRIPTION
714 |
715 | Hydrated sodium cation bound in major groove of a
716 | 16-mer RNA of Watson-Crick base pairs.
717 | The sodium is bound to the N7 nitrogen atom of
718 | Adenine 3 at 1.55 Angstrom resolution, PDB code 3nd4.
719 | 57 commands were used to make this figure.
720 |
721 | More than one label in a horizontal script is not
722 | allowed. This one label has to be at the end of the line.
723 | Labels can be imported from a Labels.pml file.
724 | Store the label commands one per row in this file.
725 | Import the file with the @Labels.pml command.
726 | Include the path to the file if the labels file is not
727 | in the current working directory of PyMOL.
728 |
729 | USAGE
730 |
731 | Type 'NA' to execute. Type 'help NA' to see this documentation
732 | printed to the command history window. Select from the command
733 | history individual lines of code to build a new script. Select the
734 | hortizontal script at the bottom if retaining most of the commands
735 | in your new script. Copy and paste onto the command line below.
736 | Works only with the command line immediately under the command
737 | history window at the top of the gui.
738 |
739 | The commands with linebreaks:
740 |
741 | delete all;
742 | viewport 900,600;
743 | fetch 3nd4, type=pdb, async=0;
744 | run ~/Scripts/PyMOLScripts/quat.py;
745 | quat 3nd4;
746 | show sticks;
747 | set stick_radius=0.125;
748 | hide everything, name H*;
749 | bg_color white;
750 | create coorCov, (3nd4_1 and (resi 19 or resi 119 or resi 219 or resi 319 or resi 419 or resi 519 or (resi 3 and name N7)));
751 | bond (coorCov//A/NA`19/NA),(coorCov//A/A`3/N7);
752 | bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`119/O);
753 | bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`219/O);
754 | bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`319/O);
755 | bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`419/O);
756 | bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`519/O);
757 | distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 519);
758 | distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 419);
759 | distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 119);
760 | distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 319);
761 | distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 219);
762 | show nb_spheres;
763 | set nb_spheres_size, .35;
764 | distance hbond1,/3nd4_1/1/A/HOH`119/O, /3nd4_1/1/A/A`3/OP2;
765 | distance hbond2,/3nd4_1/1/A/HOH`319/O,/3nd4_1/1/A/A`3/OP2;
766 | distance hbond3,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/HOH`119/O;
767 | distance hbond4,/3nd4_1/1/A/G`4/N7,/3nd4_1/1/A/HOH`91/O;
768 | distance hbond5,/3nd4_1/1/A/G`4/O6, /3nd4_1/1/A/HOH`419/O;
769 | distance hbond6,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/G`4/OP2;
770 | distance hbond7,/3nd4_1/1/A/HOH`319/O,/3nd4_1/1/A/G`2/OP2;
771 | distance hbond9,/3nd4_1/1/A/HOH`419/O,/3nd4_2/2/A/HOH`74/O;
772 | distance hbond10,/3nd4_2/2/A/C`15/O2,/3nd4_1/1/A/G`2/N2;
773 | distance hbond11, /3nd4_2/2/A/C`15/N3,/3nd4_1/1/A/G`2/N1;
774 | distance hbond12,/3nd4_2/2/A/C`15/N4,/3nd4_1/1/A/G`2/O6;
775 | distance hbond13, /3nd4_2/2/A/U`14/N3,/3nd4_1/1/A/A`3/N1;
776 | distance hbond14,3nd4_2/2/A/U`14/O4,/3nd4_1/1/A/A`3/N6;
777 | distance hbond15, /3nd4_2/2/A/C`13/N4,/3nd4_1/1/A/G`4/O6;
778 | distance hbond16,/3nd4_2/2/A/C`13/N3, /3nd4_1/1/A/G`4/N1;
779 | distance hbond17, /3nd4_1/1/A/G`4/N2,/3nd4_2/2/A/C`13/O2;
780 | distance hbond18,/3nd4_1/1/A/G`2/N2,/3nd4_2/2/A/C`15/O2;
781 | distance hbond19,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/G`4/OP2;
782 | set depth_cue=0;
783 | set ray_trace_fog=0;
784 | set dash_color, black;
785 | set label_font_id, 5;
786 | set label_size, 36;
787 | set label_position, (0.5, 1.0, 2.0);
788 | set label_color, black;
789 | set dash_gap, 0.2;
790 | set dash_width, 2.0;
791 | set dash_length, 0.2;
792 | set label_color, black;
793 | set dash_gap, 0.2;
794 | set dash_width, 2.0;
795 | set dash_length, 0.2;
796 | select carbon, element C;
797 | color yellow, carbon;
798 | disable carbon;
799 | set_view (-0.9,0.34,-0.26,0.33,0.18,-0.93,-0.27,-0.92,-0.28,-0.07,-0.23,-27.83,8.63,19.85,13.2,16.0,31.63,-20.0)
800 |
801 | The commands without linebreaks:
802 |
803 | delete all;viewport 900,600;fetch 3nd4, type=pdb,async=0;run ~/Scripts/PyMOLScripts/quat.py;quat 3nd4; show sticks;set stick_radius=0.125;hide everything, name H*;bg_color white;create coorCov, (3nd4_1 and (resi 19 or resi 119 or resi 219 or resi 319 or resi 419 or resi 519 or (resi 3 and name N7)));bond (coorCov//A/NA`19/NA),(coorCov//A/A`3/N7); bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`119/O); bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`219/O); bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`319/O); bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`419/O); bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`519/O);distance (3nd4_1 and chain Aand resi 19 and name NA), (3nd4_1 and chain A and resi 519);distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 419);distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 119);distance (3nd4_1 and chain A and resi 19 and name NA),(3nd4_1 and chain A and resi 319);distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 219);show nb_spheres; set nb_spheres_size, .35;distance hbond1,/3nd4_1/1/A/HOH`119/O, /3nd4_1/1/A/A`3/OP2;distance hbond2,/3nd4_1/1/A/HOH`319/O, /3nd4_1/1/A/A`3/OP2;distance hbond3,/3nd4_1/1/A/HOH`91/O, /3nd4_1/1/A/HOH`119/O;distance hbond4,/3nd4_1/1/A/G`4/N7,/3nd4_1/1/A/HOH`91/O;distance hbond5,/3nd4_1/1/A/G`4/O6, /3nd4_1/1/A/HOH`419/O;distance hbond6,/3nd4_1/1/A/HOH`91/O, /3nd4_1/1/A/G`4/OP2;distance hbond7,/3nd4_1/1/A/HOH`319/O, /3nd4_1/1/A/G`2/OP2;distance hbond9,/3nd4_1/1/A/HOH`419/O,/3nd4_2/2/A/HOH`74/O;distance hbond10,/3nd4_2/2/A/C`15/O2,/3nd4_1/1/A/G`2/N2;distance hbond11, /3nd4_2/2/A/C`15/N3,/3nd4_1/1/A/G`2/N1;distance hbond12,/3nd4_2/2/A/C`15/N4,/3nd4_1/1/A/G`2/O6;distance hbond13, /3nd4_2/2/A/U`14/N3,/3nd4_1/1/A/A`3/N1;distance hbond14,3nd4_2/2/A/U`14/O4,/3nd4_1/1/A/A`3/N6;distance hbond15, /3nd4_2/2/A/C`13/N4,/3nd4_1/1/A/G`4/O6;distance hbond16,/3nd4_2/2/A/C`13/N3, /3nd4_1/1/A/G`4/N1;distance hbond17, /3nd4_1/1/A/G`4/N2,/3nd4_2/2/A/C`13/O2;distance hbond18,/3nd4_1/1/A/G`2/N2,/3nd4_2/2/A/C`15/O2;distance hbond19,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/G`4/OP2;set depth_cue=0;set ray_trace_fog=0;set dash_color, black;set label_font_id, 5;set label_size, 36;set label_position, (0.5, 1.0, 2.0);set label_color, black;set dash_gap, 0.2;set dash_width, 2.0;set dash_length, 0.2;set label_color, black;set dash_gap, 0.2;set dash_width, 2.0;set dash_length, 0.2;select carbon, element C; color yellow, carbon;disable carbon;set_view (-0.9,0.34,-0.26,0.33,0.18,-0.93,-0.27,-0.92,-0.28,-0.07,-0.23,-27.83,8.63,19.85,13.2,16.0,31.63,-20.0);
804 |
805 | '''
806 | cmd.reinitialize();
807 | cmd.viewport('900','600');
808 | cmd.fetch('3nd4', type='pdb', async='0');
809 | cmd.do('run /Users/blaine-mooers/Scripts/PyMOLScripts/quat.py')
810 | cmd.do('quat 3nd4');
811 | cmd.show('sticks');
812 | cmd.set('stick_radius', '0.125');
813 | cmd.hide('everything', 'name H*');
814 | cmd.bg_color('white');
815 | cmd.create('coorCov', '(3nd4_1 and (resi 19 or resi 119 or resi 219 or resi 319 or resi 419 or resi 519 or (resi 3 and name N7)))');
816 | cmd.bond('(coorCov//A/NA`19/NA)','(coorCov//A/A`3/N7)');
817 | cmd.bond('(coorCov//A/NA`19/NA)','(coorCov//A/HOH`119/O)');
818 | cmd.bond('(coorCov//A/NA`19/NA)','(coorCov//A/HOH`219/O)');
819 | cmd.bond('(coorCov//A/NA`19/NA)','(coorCov//A/HOH`319/O)');
820 | cmd.bond('(coorCov//A/NA`19/NA)','(coorCov//A/HOH`419/O)');
821 | cmd.bond('(coorCov//A/NA`19/NA)','(coorCov//A/HOH`519/O)');
822 | cmd.distance('(3nd4_1 and chain A and resi 19 and name NA)','(3nd4_1 and chain A and resi 519)');
823 | cmd.distance('(3nd4_1 and chain A and resi 19 and name NA)','(3nd4_1 and chain A and resi 419)');
824 | cmd.distance('(3nd4_1 and chain A and resi 19 and name NA)','(3nd4_1 and chain A and resi 119)');
825 | cmd.distance('(3nd4_1 and chain A and resi 19 and name NA)','(3nd4_1 and chain A and resi 319)');
826 | cmd.distance('(3nd4_1 and chain A and resi 19 and name NA)','(3nd4_1 and chain A and resi 219)');
827 | cmd.show('nb_spheres');
828 | cmd.set('nb_spheres_size', '.35');
829 | cmd.distance('hbond1', '/3nd4_1/1/A/HOH`119/O', '/3nd4_1/1/A/A`3/OP2');
830 | cmd.distance('hbond2', '/3nd4_1/1/A/HOH`319/O', '/3nd4_1/1/A/A`3/OP2');
831 | cmd.distance('hbond3', '/3nd4_1/1/A/HOH`91/O', '/3nd4_1/1/A/HOH`119/O');
832 | cmd.distance('hbond4', '/3nd4_1/1/A/G`4/N7', '/3nd4_1/1/A/HOH`91/O');
833 | cmd.distance('hbond5', '/3nd4_1/1/A/G`4/O6', '/3nd4_1/1/A/HOH`419/O');
834 | cmd.distance('hbond6', '/3nd4_1/1/A/HOH`91/O', '/3nd4_1/1/A/G`4/OP2');
835 | cmd.distance('hbond7', '/3nd4_1/1/A/HOH`319/O', '/3nd4_1/1/A/G`2/OP2');
836 | cmd.distance('hbond9', '/3nd4_1/1/A/HOH`419/O', '/3nd4_2/2/A/HOH`74/O');
837 | cmd.distance('hbond10', '/3nd4_2/2/A/C`15/O2', '/3nd4_1/1/A/G`2/N2');
838 | cmd.distance('hbond11', '/3nd4_2/2/A/C`15/N3', '/3nd4_1/1/A/G`2/N1');
839 | cmd.distance('hbond12', '/3nd4_2/2/A/C`15/N4', '/3nd4_1/1/A/G`2/O6');
840 | cmd.distance('hbond13', '/3nd4_2/2/A/U`14/N3', '/3nd4_1/1/A/A`3/N1');
841 | cmd.distance('hbond14', '/3nd4_2/2/A/U`14/O4', '/3nd4_1/1/A/A`3/N6');
842 | cmd.distance('hbond15', '/3nd4_2/2/A/C`13/N4', '/3nd4_1/1/A/G`4/O6');
843 | cmd.distance('hbond16', '/3nd4_2/2/A/C`13/N3', '/3nd4_1/1/A/G`4/N1');
844 | cmd.distance('hbond17', '/3nd4_1/1/A/G`4/N2', '/3nd4_2/2/A/C`13/O2');
845 | cmd.distance('hbond18', '/3nd4_1/1/A/G`2/N2', '/3nd4_2/2/A/C`15/O2');
846 | cmd.distance('hbond19', '/3nd4_1/1/A/HOH`91/O', '/3nd4_1/1/A/G`4/OP2');
847 | cmd.set('depth_cue', '0');
848 | cmd.set('ray_trace_fog', '0');
849 | cmd.set('dash_color', 'black');
850 | cmd.set('label_font_id', '5');
851 | cmd.set('label_size', '36')
852 | cmd.set('label_position', '(0.5, 1.0,2.0)');
853 | cmd.set('label_color', 'black');
854 | cmd.set('dash_gap', '0.2');
855 | cmd.set('dash_width', '2.0');
856 | cmd.set('dash_length', '0.2');
857 | cmd.set('label_color', 'black');
858 | cmd.set('dash_gap', '0.2');
859 | cmd.set('dash_width', '2.0');
860 | cmd.set('dash_length', '0.2');
861 | cmd.select('carbon', 'element C');
862 | cmd.color('yellow', 'carbon');
863 | cmd.disable('carbon');
864 | cmd.set_view('-0.9,0.34,-0.26,0.33,0.18,-0.93,-0.27,-0.92,-0.28,-0.07,-0.23,-27.83,8.63,19.85,13.2,16.0,31.63,-20.0');
865 | cmd.extend('NA',NA)
866 |
867 |
868 |
869 | # ##### Commands applicable to displayed molecules. ##########
870 | def AO():
871 | '''
872 | DESCRIPTION
873 |
874 | Commands to make ambient occlusion image like those in Qutemole.
875 |
876 |
877 | USAGE
878 |
879 | Type 'AO' to execute. Type 'help AO' to see this documentation
880 | printed to the command history window. Select from the command
881 | history individual lines of code to build a new script. Select the
882 | hortizontal script at the bottom if retaining most of the commands
883 | in your new script. Copy and paste onto the comand line below.
884 | Works only with the command line immediately under the command
885 | history window at the top of the gui.
886 |
887 | The commands with linebreaks:
888 |
889 | set_color oxygen, [1.0,0.4,0.4];
890 | set_color nitrogen, [0.5,0.5,1.0];
891 | remove solvent;
892 | as spheres;
893 | util.cbaw;
894 | bg white;
895 | set light_count,10;
896 | set spec_count,1;
897 | set shininess, 10;
898 | set specular,0.25;
899 | set ambient,0;
900 | set direct,0;
901 | set reflect,1.5;
902 | set ray_shadow_decay_factor, 0.1;
903 | set ray_shadow_decay_range, 2;
904 | unset depth_cue;
905 | ray
906 |
907 | The commands without linebreaks:
908 |
909 | 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;unset depth_cue;ray
910 |
911 | '''
912 | cmd.set_color('oxygen', '[1.0,0.4,0.4]')
913 | cmd.set_color('nitrogen', '[0.5,0.5,1.0]')
914 | cmd.remove('solvent')
915 | cmd.show_as('spheres')
916 | cmd.util.cbaw()
917 | cmd.bg_color('white')
918 | cmd.set('light_count', '10')
919 | cmd.set('spec_count', '1')
920 | cmd.set('shininess', '10')
921 | cmd.set('specular', '0.25')
922 | cmd.set('ambient', '0')
923 | cmd.set('direct', '0')
924 | cmd.set('reflect', '1.5')
925 | cmd.set('ray_shadow_decay_factor', '0.1')
926 | cmd.set('ray_shadow_decay_range', '2')
927 | cmd.unset('depth_cue')
928 | cmd.ray()
929 | cmd.extend('AO',AO)
930 |
931 |
932 | def BW():
933 | '''
934 | DESCRIPTION
935 |
936 | Commands to make black-and white-ribbon cartoon on a white background.
937 | Good for avoiding color figure charges. Requires a pdb file. Can cause PyMOL
938 | to crash if applied to a cartoon representation. Best applied while object is
939 | still shown as lines.
940 |
941 |
942 | USAGE
943 |
944 | Orient struture as desired. Then type 'BW' to execute the function. Type
945 | 'help BW' to see this documentation printed to the command history window.
946 | Select from the command history individual lines of code to build a new
947 | script. Select the hortizontal script at the bottom if retaining most of
948 | the commands in your new script. Copy and paste onto the command line below.
949 | Works only with the command line immediately under the command
950 | history window at the top of the gui.
951 |
952 | The commands with linebreaks:
953 |
954 | show cartoon;
955 | hide lines;
956 | hide nonbonded;
957 | # black and white cartoon;
958 | # note how the dcomment is on a separate line and not to the right of a command;
959 | set ray_trace_mode, 2;
960 | bg_color white;
961 | set antialias, 2;
962 | ray 1600,1600;
963 | png test.png
964 |
965 | Commands without linebreaks:
966 |
967 | show cartoon; hide lines; hide nonbonded; set ray_trace_mode, 2; # black and white cartoon; bg_color white; set antialias, 2; ray 1600,1600; png test.png
968 |
969 | '''
970 | cmd.show_as("cartoon", "all");
971 | cmd.hide('lines');
972 | cmd.hide('nonbonded');
973 | # black and white cartoon;
974 | cmd.set('ray_trace_mode', '2');
975 | cmd.bg_color('white');
976 | cmd.set('antialias', '2');
977 | cmd.ray('600','600');
978 | cmd.png('test.png')
979 | cmd.extend('BW',BW)
980 |
981 |
982 | def BU():
983 | '''
984 | DESCRIPTION
985 |
986 | Commands to make biological unit. Requires a pdb file. There are
987 | other ways of displaying the biological unit in PyMOL. Depends on
988 | the quat.py script by Thomas Holder.
989 |
990 | USAGE
991 |
992 | Type 'BU' to execute. Type 'help BU' to see this documentation
993 | printed to the command history window. Select from the command
994 | history individual lines of code to build a new script. Select the
995 | hortizontal script at the bottom if retaining most of the commands
996 | in your new script. Copy and paste onto the command line below.
997 | Works only with the command line immediately under the command
998 | history window at the top of the gui.
999 |
1000 | The commands with linebreaks:
1001 |
1002 | run ~/Scripts/PyMOLScripts/quat.py;
1003 | quat
1004 |
1005 | The commands without linebreaks:
1006 |
1007 | run ~/Scripts/PyMOLScripts/quat.py; quat
1008 |
1009 | '''
1010 | # cmd.alias('aBU', 'run ~/Scripts/PyMOLScripts/quat.py; quat')
1011 | cmd.do('run /Users/blaine-mooers/Scripts/PyMOLScripts/quat.py')
1012 | # cmd.run('/Users/blaine-mooers/Scripts/PyMOLScripts/quat.py')
1013 | cmd.do('quat')
1014 | cmd.extend('BU',BU)
1015 |
1016 | def CB():
1017 | '''
1018 | DESCRIPTION
1019 |
1020 | Loads Jared Sampson's script "colorblindfriendly.py" from the
1021 | ~/Pymol-script-repo directory. The colorblind-friendly color
1022 | names are printed to the command history window and are available
1023 | for use like standard colors in PyMOL.
1024 |
1025 | Read the header of colorblindfriendly.py for more information. Although
1026 | this script is also in my PyMOL plugin collection, it is out of sight
1027 | and out of mind. The listing of the alias to this script is a
1028 | reminder to use it.
1029 |
1030 | USAGE
1031 |
1032 | Type 'CB' to execute. Type 'help CB' to see this documentation
1033 | printed to the command history window.
1034 |
1035 | Command:
1036 |
1037 | run ~/Pymol-script-repo/colorblindfriendly.py
1038 |
1039 | '''
1040 | cmd.run('~/Pymol-script-repo/colorblindfriendly.py')
1041 | cmd.extend('CB',CB)
1042 |
1043 |
1044 | def CR():
1045 | '''
1046 | DESCRIPTION
1047 |
1048 | Commands to make colored filled-ring cartoon of nucleic acids. May
1049 | need to 'hide everything' first. If asymmetric unit has one strand
1050 | of a dsRNA or dsDNA, remember to apply the BU alias to display the
1051 | second strand. ddd
1052 |
1053 | Adapted from KP Wu's blog post:
1054 | https://kpwu.wordpress.com/2012/05/24/pymol-different-colors-of-
1055 | nucleic-acid-rings/
1056 |
1057 | USAGE
1058 |
1059 | Type 'CR' to execute. Type 'help CR' to see this documentation
1060 | printed to the command history window. Select from the command
1061 | history individual lines of code to build a new
1062 | script. Select the hortizontal script at the bottom if retaining most of
1063 | the commands in your new script. Copy and paste onto the command line below.
1064 | Works only with the command line immediately under the command
1065 | history window at the top of the gui.
1066 |
1067 | The commands with linebreaks:
1068 |
1069 | hide everything;
1070 | bg_color white;
1071 | cartoon oval;
1072 | set cartoon_ring_mode,3;
1073 | set cartoon_nucleic_acid_color, blue;
1074 | select rna_A, resn A;
1075 | select rna_C, resn C;
1076 | select rna_G, resn G;
1077 | select rna_U, resn U;
1078 | color yellow, rna_A;
1079 | color red, rna_C;
1080 | color gray40, rna_G;
1081 | color palecyan, rna_U;
1082 | as cartoon
1083 |
1084 | The commands without linebreaks:
1085 |
1086 | hide everything;bg_color white;cartoon oval;set cartoon_ring_mode,3;set cartoon_nucleic_acid_color, blue;select rna_A, resn A;select rna_C, resn C;select rna_G, resn G;select rna_U, resn U;color yellow, rna_A;color red, rna_C;color gray40, rna_G;color palecyan, rna_U;as cartoon
1087 |
1088 | '''
1089 | cmd.hide('everything')
1090 | cmd.bg_color('white')
1091 | cmd.cartoon('oval')
1092 | cmd.set('cartoon_ring_mode', '3')
1093 | cmd.set('cartoon_nucleic_acid_color', 'blue')
1094 | cmd.select('rna_A', 'resn A')
1095 | cmd.select('rna_C', 'resn C')
1096 | cmd.select('rna_G', 'resn G')
1097 | cmd.select('rna_U', 'resn U')
1098 | cmd.color('yellow', 'rna_A')
1099 | cmd.color('red', 'rna_C')
1100 | cmd.color('gray40', 'rna_G')
1101 | cmd.color('palecyan', 'rna_U')
1102 | cmd.show_as('cartoon')
1103 | cmd.disable('rna_U')
1104 | cmd.extend('CR',CR)
1105 |
1106 |
1107 | def CSS():
1108 | '''
1109 | DESCRIPTION
1110 |
1111 | Commands to color ribbon or cartoon representations of proteins by
1112 | secondary structures.
1113 |
1114 | USAGE
1115 |
1116 | Type 'CSS' to activateexecute. Type 'help CSS' to see this documentation
1117 | printed to the command history window. Select from the command
1118 | history individual lines of code to build a new
1119 | script. Select the hortizontal script at the bottom if retaining most of
1120 | the commands in your new script. Copy and paste onto the command line below.
1121 | Works only with the command line immediately under the command
1122 | history window at the top of the gui.
1123 |
1124 | The commands with linebreaks:
1125 |
1126 | as cartoon;
1127 | color red, ss H;
1128 | color yellow,ss S;
1129 | color green, ss L+;
1130 |
1131 | The commands without linebreaks:
1132 |
1133 | as cartoon; color red, ss H; color yellow,ss S; color green, ss L+;
1134 |
1135 | '''
1136 | cmd.show_as('cartoon')
1137 | cmd.color('red', 'ss H')
1138 | cmd.color('yellow', 'ss S')
1139 | cmd.color('green', 'ss L+')
1140 | cmd.extend('CSS',CSS)
1141 |
1142 |
1143 | def CBSS():
1144 | '''
1145 | DESCRIPTION
1146 |
1147 | Commands to do colorblind friendly coloring by secondary
1148 | structures of ribbon or cartoon representations of proteins.
1149 | Depends on colorblindfriendly.py. Script assumed to be stored in
1150 | the home directory in ~/Pymol-script-repo.
1151 |
1152 | USAGE
1153 |
1154 | Type 'CBSS' to execute. Type 'help CBSS' to see this
1155 | documentation printed to the command history window. Select from the command
1156 | history individual lines of code to build a new
1157 | script. Select the hortizontal script at the bottom if retaining most of
1158 | the commands in your new script. Copy and paste onto the command line below.
1159 | Works only with the command line immediately under the command
1160 | history window at the top of the gui.
1161 |
1162 | The commands with linebreaks:
1163 |
1164 | run ~/Pymol-script-repo/colorblindfriendly.py;
1165 | as cartoon;
1166 | color cb_red, ss H;
1167 | color cb_yellow,ss S;
1168 | color cb_green, ss L+;
1169 |
1170 | The commands without linebreaks:
1171 |
1172 | run ~/Pymol-script-repo/colorblindfriendly.py;as cartoon;color cb_red, ss H;color cb_yellow,ss S;color cb_green, ss L+;
1173 |
1174 | '''
1175 |
1176 | cmd.run('~/Pymol-script-repo/colorblindfriendly.py')
1177 | cmd.show_as('cartoon')
1178 | cmd.color('cb_red', 'ss H')
1179 | cmd.color('cb_yellow', 'ss S')
1180 | cmd.color('cb_green', 'ss L+')
1181 | cmd.extend('CBSS',CBSS)
1182 |
1183 |
1184 | def DU():
1185 | '''
1186 | DESCRIPTION
1187 |
1188 | Commands to make dumbbell (ribbons with rolled edges) cartoon of
1189 | the main chains of nucleic acids and proteins. 50% transparent
1190 | cartoon so it can be combined with lines, sticks, and
1191 | ball-and-sticks (try BS alias).
1192 |
1193 | USAGE
1194 |
1195 | Type 'DU' to execute. Type 'help DU' to see this documentation
1196 | printed to the command history window. Select from the command
1197 | history individual lines of code to build a new script. Select the
1198 | hortizontal script at the bottom if retaining most of the commands
1199 | in your new script. Copy and paste onto the comand line below.
1200 | Works only with the command line immediately under the command
1201 | history window at the top of the gui.
1202 |
1203 | Commands with linebreaks:
1204 |
1205 | cartoon dumbbell;
1206 | set cartoon_dumbbell_width, 0.2;
1207 | set cartoon_dumbbell_radius, 0.4;
1208 | show cartoon;
1209 |
1210 | Commands without linebreaks:
1211 |
1212 | cartoon dumbbell;set cartoon_dumbbell_width, 0.2;set cartoon_dumbbell_radius, 0.4;show cartoon;
1213 |
1214 | '''
1215 | cmd.cartoon('dumbbell')
1216 | cmd.set('cartoon_dumbbell_width', '0.2')
1217 | cmd.set('cartoon_dumbbell_radius', '0.4')
1218 | cmd.show('cartoon')
1219 | cmd.extend('DU',DU)
1220 |
1221 |
1222 | def FR():
1223 | '''
1224 | DESCRIPTION
1225 |
1226 | Commands to make filled-ring cartoon of nucleic acids. May need to
1227 | 'hide everything' first. Adapted from the script on
1228 | http://www-cryst.bioc.cam.ac.uk/members/zbyszek/figures_pymol.
1229 |
1230 | USAGE
1231 |
1232 | Type 'FR' to execute. Type 'help FR' to see this documentation
1233 | printed to the command history window. Select from the command
1234 | history individual lines of code to build a new script. Select the
1235 | hortizontal script at the bottom if retaining most of the commands
1236 | in your new script. Copy and paste onto the command line below.
1237 | Works only with the command line immediately under the command
1238 | history window at the top of the PyMOL gui.
1239 |
1240 | Commands with linebreaks:
1241 |
1242 | show sticks;
1243 | set cartoon_ring_mode, 3;
1244 | set cartoon_ring_finder, 1;
1245 | set cartoon_ladder_mode, 1;
1246 | set cartoon_nucleic_acid_mode, 4;
1247 | set cartoon_ring_transparency, 0.5;
1248 | as cartoon;
1249 |
1250 | Commands without linebreaks:
1251 |
1252 | show sticks;set cartoon_ring_mode, 3;set cartoon_ring_finder, 1;set cartoon_ladder_mode, 1;set cartoon_nucleic_acid_mode, 4;set cartoon_ring_transparency, 0.5;as cartoon;
1253 |
1254 | '''
1255 | cmd.show('sticks')
1256 | cmd.set('cartoon_ring_mode', '3')
1257 | cmd.set('cartoon_ring_finder', '1')
1258 | cmd.set('cartoon_ladder_mode', '1')
1259 | cmd.set('cartoon_nucleic_acid_mode', '4')
1260 | cmd.set('cartoon_ring_transparency', '0.5')
1261 | cmd.show_as('cartoon')
1262 | cmd.extend('FR',FR)
1263 |
1264 |
1265 | def HH():
1266 | '''
1267 | DESCRIPTION
1268 |
1269 | Command to hide hydrogen atoms.
1270 |
1271 | USAGE
1272 |
1273 | Type 'HH' to execute. Type 'help HH' to see this documentation
1274 | printed to the command history window.
1275 |
1276 | The command:
1277 |
1278 | hide everything, name H*
1279 |
1280 | '''
1281 | cmd.hide('everything', 'name H*')
1282 | cmd.extend('HH',HH)
1283 |
1284 |
1285 | def PU():
1286 | '''
1287 | DESCRIPTION
1288 |
1289 | Commands to make putty cartoon of main chain of nucleic acids and
1290 | proteins. The radius of the cartoon is inversely proportional to
1291 | the B-factors. 50% transparent cartoon so it can be combined with
1292 | lines, sticks, and ball-and-sticks (try BS alias).
1293 |
1294 | USAGE
1295 |
1296 | Type 'PU' to execute. Type 'help PU' to see this documentation
1297 | printed to the command history window. Select from the command
1298 | history individual lines of code to build a new script. Select the
1299 | hortizontal script at the bottom if retaining most of the commands
1300 | in your new script. Copy and paste onto the comand line below.
1301 | Works only with the command line immediately under the command
1302 | history window at the top of the gui.
1303 |
1304 | The commands with linebreaks:
1305 |
1306 | cartoon putty;
1307 | set cartoon_ladder_mode, 0;
1308 | set cartoon_transparency,0.5;
1309 | set cartoon_ring_finder, 0;
1310 | show cartoon
1311 |
1312 | The commands without linebreaks:
1313 |
1314 | cartoon putty;set cartoon_ladder_mode, 0;set cartoon_transparency,0.5;set cartoon_ring_finder, 0;show cartoon
1315 |
1316 | '''
1317 | cmd.cartoon('putty')
1318 | cmd.set('cartoon_ladder_mode', '0')
1319 | cmd.set('cartoon_transparency', '0.5')
1320 | cmd.set('cartoon_ring_finder', '0')
1321 | cmd.show('cartoon')
1322 | cmd.extend('PU',PU)
1323 |
1324 |
1325 | def SE():
1326 | '''
1327 | DESCRIPTION
1328 |
1329 | Commands to make SAXS envelope from a bead model.
1330 |
1331 | USAGE
1332 |
1333 | Type 'SE' to execute. Type 'help SE' to see this documentation
1334 | printed to the command history window. Select from the command
1335 | history individual lines of code to build a new script. Select the
1336 | hortizontal script at the bottom if retaining most of the commands
1337 | in your new script. Copy and paste onto the comand line below.
1338 | Works only with the command line immediately under the command
1339 | history window at the top of the gui.
1340 |
1341 | Commands with linebreaks:
1342 |
1343 | alter all,vdw=4.5;
1344 | set solvent_radius, 4.3;
1345 | show surface;
1346 |
1347 | Commands without linebreaks:
1348 | alter all,vdw=4.5;set solvent_radius, 4.3;show surface;
1349 |
1350 | '''
1351 | cmd.alter('all,vdw=4.5')
1352 | cmd.set('solvent_radius', '4.3')
1353 | cmd.show('surface')
1354 | cmd.extend('SE',SE)
1355 |
1356 |
1357 | def rline():
1358 | '''
1359 | DESCRIPTION
1360 |
1361 | Navigating the command line with readline commands.
1362 |
1363 | These commands are sufficient for most editing tasks:
1364 | To edit code, positon cursor on command line with left mouse button.
1365 | Control-e moves the cursor to the end of the line, even when it is out of view.
1366 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
1367 | Up arrow key recalls last line of commands for editing.
1368 |
1369 | These commands may not be available on all systems:
1370 | Shift-control-a selects everything from the right of the cursor to the end of the line.
1371 | Shift-control-e selects everything to the left of the cursor to the end of the line.
1372 | Command-f moves the cursor to the end of the current word.
1373 | Command-b moves the cursor to the begining of the current word.
1374 | Control-f moves the cursor to the right by one character.
1375 | Control-b moves the cursor to the left by one character.
1376 | '''
1377 | cmd.extend("rline",rline)
1378 |
1379 |
1380 | """ Print the aliases on startup of PyMOL"""
1381 | print(SA.__doc__)
1382 |
--------------------------------------------------------------------------------
/wtT4L.py:
--------------------------------------------------------------------------------
1 | from __future__ import print_function
2 | # -*- coding: utf-8 -*-
3 | """
4 |
5 | Copyright Notice
6 | ================
7 |
8 | Copyright (C) 2016 Blaine Mooers
9 |
10 | This program is free software: you can redistribute it and/or modify
11 | it under the terms of the GNU General Public License as published by
12 | the Free Software Foundation, either version 3 of the License.
13 |
14 | This program is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 | See the GNU General Public License for more details:
18 | http://www.gnu.org/licenses/.
19 |
20 | The source code in this file is copyrighted, but you can
21 | freely use and copy it as long as you don't change or
22 | remove any of the copyright notices.
23 |
24 | Blaine Mooers, PhD
25 | blaine-mooers@ouhsc.edu
26 | 975 NE 10th St, BRC 466
27 | University of Oklahoma Health Sciences Center,
28 | Oklahoma City, OK, USA 73104
29 | """
30 | from pymol import cmd
31 | __author__ = "Blaine Mooers"
32 | __copyright__ = "Blaine Mooers, University of Oklahoma Health Sciences Center, Oklahoma City, OK, USA 73104"
33 | __license__ = "GPL-3"
34 | __version__ = "1.0.3"
35 | __credits__ = ["William Beasley","Chiedza Kanyumbu"] # people who reported bug fixes, made suggestions, etc.
36 | __date__ = "24 July 2016"
37 | __maintainer__ = "Blaine Mooers"
38 | __email__ = "blaine-mooers@ouhsc.edu"
39 | __status__ = "Production"
40 |
41 | print("Enter the name of the alias to the left of the semicolon.")
42 | print(" ")
43 | print("site11: the active side glutamate Glu11")
44 | print(" ")
45 | print("site31: the His31-Asp 70 salt bridge in which His31's pKa")
46 | print(" is shifted by 3 orders of magnitude")
47 | print(" ")
48 | print("site96: the site of the Arg96-->His mutation that has a large loss in stability")
49 | print(" that was hard to explain from the structure alone.")
50 | print(" ")
51 | print("site99: the Leu99-->Ala mutant protein has a large cavity")
52 | print(" that can accomodate benzene.")
53 | print(" ")
54 | print("site145: poor H-bond geometery between Arg-145 and ")
55 | print(" Glu-11 suggests that the pKa of Glu11 is shifted upwards ")
56 | print(" by the unfavroable interactions.")
57 | print(" ")
58 | print("Type 'help wtT4L' for more information. ")
59 | print(" ")
60 |
61 | def wtT4L():
62 | """
63 | DESCRIPTION
64 |
65 | Creates aliases to compound commands or horizontal scripts. The compound commands
66 | are executed in PyMOL by typing their name. The command
67 | wtT4L.py only needs to be run once in a PyMOL session to
68 | create the aliases. The aliases disappear upon ending
69 | the PyMOL session. The names of the aliases and a short description
70 | of each aliases is printed to the command history window.
71 |
72 | LIMITATIONS
73 |
74 | The site31 alias requires the additional script 'wtT4Llabels.pml' must
75 | be present in the same directory as the wtT4L.py. You may have to
76 | give the full path to site31labels.pml if it is not in the present
77 | working directory.
78 |
79 | After changing the molecule's orientation, run the program
80 | 'roundview.py' to obtained a short version of the viewport settings.
81 |
82 | USAGE
83 |
84 | run wtT4L.py
85 |
86 | Then enter the name of an alias from the list above, for example:
87 |
88 | site11
89 |
90 | To reuse of parts or all of the above commands, copy and paste the commands
91 | onto the command line or into a plain text file.
92 |
93 | These commands are sufficient for most editing tasks:
94 | To edit code, positon cursor on command line with left mouse button.
95 | Control-e moves the cursor to the end of the line, even when it is out of view.
96 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
97 | Up arrow key recalls last line of commands for editing.
98 |
99 | These commands may not be available on all systems:
100 | Shift-control-a selects everything from the right of the cursor to the end of the line.
101 | Shift-control-e selects everything to the left of the cursor to the end of the line.
102 | Command-f moves the cursor to the end of the current word.
103 | Command-b moves the cursor to the begining of the current word.
104 | Control-f moves the cursor to the right by one character.
105 | Control-b moves the cursor to the left by one character.
106 | """
107 | cmd.extend('wtT4L',wtT4L)
108 | print(wtT4L.__doc__)
109 | cmd.bg_color("white")
110 | cmd.fetch(code="3fa0", name="wtT4L",state = 0,async='0')
111 | cmd.alias('site11', 'zoom resi 11; preset.technical("wtT4L")')
112 | cmd.alias('site31', 'preset.ball_and_stick("wtT4L");@S3_File.pml;set_view (0.31,-0.93,0.21,0.92,0.24,-0.29,0.22,0.28,0.93,-0.09,-0.05,-9.88,37.55,10.06,30.09,20.0,23.82,-20.0);')
113 | cmd.alias('site96', 'preset.technical("wtT4L");set_view (-0.75,-0.65,0.11,0.62,-0.75,-0.22,0.22,-0.1,0.97,0.0,-0.0,-32.32,29.16,-1.45,6.77,27.32,37.32,-20.0);')
114 | cmd.alias('site99', 'preset.ball_and_stick("wtT4L");color bluewhite, i. 99; set_view (-0.24,-0.95,-0.21,0.51,0.07,-0.85,0.83,-0.32,0.46,0.03,-0.5,-5.37,22.35,-18.6,18.83,29.89,37.68,-20.0);')
115 | cmd.alias('site145', 'preset.technical("wtT4L");set_view (0.02,-0.63,-0.78,0.37,0.73,-0.56,0.93,-0.27,0.24,0.19,-0.3,-0.0,24.28,2 .24,13.53,15.23,21.26,-20.0);')
116 |
--------------------------------------------------------------------------------
/wtT4LWindows.py:
--------------------------------------------------------------------------------
1 | from __future__ import print_function
2 | """
3 |
4 | Copyright Notice
5 | ================
6 |
7 | Copyright (C) 2016 Blaine Mooers
8 |
9 | This program is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License.
12 |
13 | This program is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 | See the GNU General Public License for more details:
17 | http://www.gnu.org/licenses/.
18 |
19 | The source code in this file is copyrighted, but you can
20 | freely use and copy it as long as you don't change or
21 | remove any of the copyright notices.
22 |
23 | Blaine Mooers, PhD
24 | blaine-mooers@ouhsc.edu
25 | 975 NE 10th St, BRC 466
26 | University of Oklahoma Health Sciences Center,
27 | Oklahoma City, OK, USA 73104
28 | """
29 | from pymol import cmd
30 | __author__ = "Blaine Mooers"
31 | __copyright__ = "Blaine Mooers, University of Oklahoma Health Sciences Center, Oklahoma City, OK, USA 73104"
32 | __license__ = "GPL-3"
33 | __version__ = "1.0.3"
34 | __credits__ = ["William Beasley","Chiedza Kanyumbu"] # people who reported bug fixes, made suggestions, etc.
35 | __date__ = "24 July 2016"
36 | __maintainer__ = "Blaine Mooers"
37 | __email__ = "blaine-mooers@ouhsc.edu"
38 | __status__ = "Production"
39 |
40 | print("Enter the name of the alias to the left of the semicolon.")
41 | print(" ")
42 | print("site11: the active side glutamate Glu11")
43 | print(" ")
44 | print("site31: the His31-Asp 70 salt bridge in which His31's pKa")
45 | print(" is shifted by 3 orders of magnitude")
46 | print(" ")
47 | print("site96: the site of the Arg96-->His mutation that has a large loss in stability")
48 | print(" that was hard to explain from the structure alone.")
49 | print(" ")
50 | print("site99: the Leu99-->Ala mutant protein has a large cavity")
51 | print(" that can accomodate benzene.")
52 | print(" ")
53 | print("site145: poor H-bond geometery between Arg-145 and ")
54 | print(" Glu-11 suggests that the pKa of Glu11 is shifted upwards ")
55 | print(" by the unfavroable interactions.")
56 | print(" ")
57 | print("Type 'help wtT4L' for more information. ")
58 | print(" ")
59 |
60 | def wtT4L():
61 | """
62 | DESCRIPTION
63 |
64 | Creates aliases to compound commands or horizontal scripts. The compound commands
65 | are executed in PyMOL by typing their name. The command
66 | wtT4L.py only needs to be run once in a PyMOL session to
67 | create the aliases. The aliases disappear upon ending
68 | the PyMOL session. The names of the aliases and a short description
69 | of each aliases is printed to the command history window.
70 |
71 | LIMITATIONS
72 |
73 | The site31 alias requires the additional script 'wtT4Llabels.pml' must
74 | be present in the same directory as the wtT4L.py. You may have to
75 | give the full path to site31labels.pml if it is not in the present
76 | working directory.
77 |
78 | After changing the molecule's orientation, run the program
79 | 'roundview.py' to obtained a short version of the viewport settings.
80 |
81 | USAGE
82 |
83 | run wtT4L.py
84 |
85 | Then enter the name of an alias from the list above, for example:
86 |
87 | site11
88 |
89 | To reuse of parts or all of the above commands, copy and paste the commands
90 | onto the command line or into a plain text file.
91 |
92 | These commands are sufficient for most editing tasks:
93 | To edit code, positon cursor on command line with left mouse button.
94 | Control-e moves the cursor to the end of the line, even when it is out of view.
95 | Control-a moves the cursor to the beginning of the line, even when it is out of view.
96 | Up arrow key recalls last line of commands for editing.
97 |
98 | These commands may not be available on all systems:
99 | Shift-control-a selects everything from the right of the cursor to the end of the line.
100 | Shift-control-e selects everything to the left of the cursor to the end of the line.
101 | Command-f moves the cursor to the end of the current word.
102 | Command-b moves the cursor to the begining of the current word.
103 | Control-f moves the cursor to the right by one character.
104 | Control-b moves the cursor to the left by one character.
105 | """
106 | cmd.extend('wtT4L',wtT4L)
107 | print(wtT4L.__doc__)
108 | cmd.bg_color("white")
109 | cmd.fetch(code="3fa0", name="wtT4L",state = 0,async='0')
110 | cmd.alias('site11', 'zoom resi 11; preset.technical("wtT4L")')
111 | cmd.alias('site31', 'preset.ball_and_stick("wtT4L");@S3_File.pml;set_view (0.31,-0.93,0.21,0.92,0.24,-0.29,0.22,0.28,0.93,-0.09,-0.05,-9.88,37.55,10.06,30.09,20.0,23.82,-20.0);')
112 | cmd.alias('site96', 'preset.technical("wtT4L");set_view (-0.75,-0.65,0.11,0.62,-0.75,-0.22,0.22,-0.1,0.97,0.0,-0.0,-32.32,29.16,-1.45,6.77,27.32,37.32,-20.0);')
113 | cmd.alias('site99', 'preset.ball_and_stick("wtT4L");color bluewhite, i. 99; set_view (-0.24,-0.95,-0.21,0.51,0.07,-0.85,0.83,-0.32,0.46,0.03,-0.5,-5.37,22.35,-18.6,18.83,29.89,37.68,-20.0);')
114 | cmd.alias('site145', 'preset.technical("wtT4L");set_view (0.02,-0.63,-0.78,0.37,0.73,-0.56,0.93,-0.27,0.24,0.19,-0.3,-0.0,24.28,2 .24,13.53,15.23,21.26,-20.0);')
115 |
--------------------------------------------------------------------------------