https://pymolwiki.org/index.php?title=ToGroup&feed=atom&action=history
ToGroup - Revision history
2024-03-29T11:02:27Z
Revision history for this page on the wiki
MediaWiki 1.35.7
https://pymolwiki.org/index.php?title=ToGroup&diff=11541&oldid=prev
Desastre: Add script repo entry
2014-04-05T16:03:21Z
<p>Add script repo entry</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:03, 5 April 2014</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{Infobox script-repo</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|type = script</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|filename = togroup.py</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|author = [[User:Inchoate|Jason Vertrees]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|license = -</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">}}</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>= Overview =</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>= Overview =</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[toGroup]] will convert a multistate object into a group of single-state objects. ''Be warned, by default it deletes your original object (since it's extracting a copy).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[toGroup]] will convert a multistate object into a group of single-state objects. ''Be warned, by default it deletes your original object (since it's extracting a copy).</div></td></tr>
</table>
Desastre
https://pymolwiki.org/index.php?title=ToGroup&diff=8681&oldid=prev
Inchoate at 13:52, 2 December 2010
2010-12-02T13:52:12Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 13:52, 2 December 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l73" >Line 73:</td>
<td colspan="2" class="diff-lineno">Line 73:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>= See Also =</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>= See Also =</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[group]], [[select]], [[Category:States]], [[split_states]], [[delete]], [[extend]].</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[group<ins class="diffchange diffchange-inline">]], [[saveGroup</ins>]], [[select]], [[Category:States]], [[split_states]], [[delete]], [[extend]].</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Script_Library]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Script_Library]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:ObjSel_Scripts]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:ObjSel_Scripts]]</div></td></tr>
</table>
Inchoate
https://pymolwiki.org/index.php?title=ToGroup&diff=6484&oldid=prev
Inchoate: Created page with '= Overview = toGroup will convert a multistate object into a group of single-state objects. ''Be warned, by default it deletes your original object (since it's extracting a ...'
2009-05-22T22:26:00Z
<p>Created page with '= Overview = <a href="/index.php/ToGroup" title="ToGroup">toGroup</a> will convert a multistate object into a group of single-state objects. ''Be warned, by default it deletes your original object (since it's extracting a ...'</p>
<p><b>New page</b></p><div>= Overview =<br />
[[toGroup]] will convert a multistate object into a group of single-state objects. ''Be warned, by default it deletes your original object (since it's extracting a copy).<br />
<br />
PyMOL does a great job at handling multistate objects and grouping them together. One thing that I found myself doing over and over again was <br />
* loading a multistate object (say a PDBQT file with 100 ligand poses)<br />
* splitting that object into all 100 states, with some given prefix<br />
* then grouping them into their own group<br />
* and then finally removing the original.<br />
<br />
This became tedious, so I automated that with this script.<br />
<br />
= Examples =<br />
<source lang="python"><br />
# A multistate object (20 NMR states)<br />
fetch 1nmr<br />
<br />
# Create the group called, "nmrEnsemble"<br />
# from '1nmr' and name all the new states state1,<br />
# state2, state3, etc.<br />
toGroup nmrEnsemble, 1nmr, prefix=state<br />
</source><br />
<br />
= The Code =<br />
<source lang="python"><br />
import pymol<br />
from pymol import cmd<br />
<br />
def toGroup(groupName,sel,prefix="",delOrig=True):<br />
"""<br />
DESCRIPTION<br />
toGroup will take a multistate object and extract it<br />
to a group with N objects all in state #1. It essentially<br />
performs the following:<br />
<br />
split_states myObj, prefix=somePrefix<br />
group newGroup, somePrefix*<br />
delete myObj<br />
<br />
PARAMETERS:<br />
<br />
groupName (string)<br />
The name of the group to create<br />
<br />
sel (string)<br />
The name of the selection/object from which<br />
to make the group<br />
<br />
prefix (string)<br />
The prefix of the names of each of split states.<br />
For example, if your prefix is ''obj'' and is in<br />
states 1 through 100 then the states will be labeled<br />
obj1, obj2, obj3, ..., obj100.<br />
<br />
delOrig (string/boolean)<br />
If true then delete the original selection, otherwise not.<br />
<br />
RETURN<br />
<br />
Nothing, it makes a new group.<br />
<br />
"""<br />
if prefix=="":<br />
prefix="grouped"<br />
<br />
cmd.split_states(sel, prefix=prefix)<br />
cmd.group(groupName,prefix+"*")<br />
<br />
if delOrig:<br />
cmd.delete(sel)<br />
<br />
cmd.extend("toGroup", toGroup)<br />
</source><br />
<br />
= See Also =<br />
[[group]], [[select]], [[Category:States]], [[split_states]], [[delete]], [[extend]].<br />
<br />
[[Category:Script_Library]]<br />
[[Category:ObjSel_Scripts]]</div>
Inchoate