<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Eric,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
First of all, thanks for your help so far. If you can take a look at the next problem, I would appreciate it.
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I think the string suggestion worked for what I asked, but it appears there's another issue with the script. I realize I'm using code that's > 10 yrs old (and things change) but if you (or someone) know what's not right about this next section this would help
me not have to recode NMRCLUST from scratch (which is tempting, but not preferable). OR, if someone knows where NMRCLUST might be available, I'd be happy to download it.
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
If I don't change anything in the original script, it runs fine (using all heavy atoms presumably). When I change the value of subSelection (given Eric's example string), it runs through the RMSD portion (I think, I get 250 groups of "Running ksdssp" comments,
like below). Then it appears to get hung up in the function _getAtoms <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I am running basically what is referred to in the original (2010) posting, namely:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
chimera --nogui 3c4s.test.pdb cluster.py</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The 3c4s.test.pdb is 250 frames from an AMBER md run (just for testing this). The script cluster.py is the same as the one posed from 2010, with the exception of changing subSelection (to subSelection = "@CA" in this case). My Chimera version is "chimera candidate
version 1.15 (build 42258) 2020-12-18 05:17:29 UTC" (in case that matters at all).
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[portion of code from cluster.py referred to by output of running script]<br>
</div>
<blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, 102);" itemscope="" itemtype="https://schemas.microsoft.com/QuotedText">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
def _getAtoms(m, subSelection):
<div> if not subSelection:</div>
<div> #atoms = m.sortedAtoms()</div>
<div> atoms = m.atoms</div>
<div> else:</div>
<div> osl = '%s%s' % (m.oslIdent(), subSelection)</div>
<div> s = selection.OSLSelection(osl)</div>
<div> wanted = s.vertices(asDict=True)</div>
<div> #atoms = [ a for a in m.sortedAtoms() if a in wanted ]</div>
<div> atoms = [ a for a in m.atoms if a in wanted ]</div>
<div> return atoms</div>
<span></span><br>
</div>
</blockquote>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[end of the output from running script]<br>
</div>
<blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, 102);" itemscope="" itemtype="https://schemas.microsoft.com/QuotedText">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Computing secondary structure assignments...
<div>Computed secondary structure assignments (see reply log)</div>
<div>Model 0.250 (3c4s.test.pdb) has no secondary structure assignments. Running ksdssp.</div>
<div><br>
</div>
<div>Computing secondary structure assignments...</div>
<div>Computed secondary structure assignments (see reply log)</div>
<div>Compiling cluster.py...</div>
<div>Compiling cluster.py succeeded</div>
<div>Executing cluster.py...</div>
<div>Computing distance matrix</div>
<div> 0.02: created distance matrix</div>
<div><br>
</div>
<div>Traceback (most recent call last):</div>
<div> File "/opt/UCSF/Chimera64-1.15rc/share/chimeraInit.py", line 760, in init</div>
<div> chimera.openModels.open(a, prefixableType=1)</div>
<div> File "/opt/UCSF/Chimera64-1.15rc/share/chimera/__init__.py", line 1960, in open</div>
<div> models = func(filename, *args, **kw)</div>
<div> File "/opt/UCSF/Chimera64-1.15rc/share/chimera/__init__.py", line 1330, in _openPython</div>
<div> loadFunc(sandboxName, fileName, f)</div>
<div> File "cluster.py", line 113, in <module></div>
<div> main()</div>
<div> File "cluster.py", line 12, in main</div>
<div> clusterInfo = _cluster(modelList, subSelection)</div>
<div> File "cluster.py", line 23, in _cluster</div>
<div> for m in modelList ]</div>
<div> File "cluster.py", line 100, in _getAtoms</div>
<div> s = selection.OSLSelection(osl)</div>
<div>NameError: global name 'selection' is not defined</div>
<div><br>
</div>
<div>Error while processing cluster.py:</div>
<div>NameError: global name 'selection' is not defined</div>
<div><br>
</div>
<div> File "cluster.py", line 100, in _getAtoms</div>
<div> s = selection.OSLSelection(osl)</div>
<div><br>
</div>
<div>See reply log for Python traceback.</div>
<div><br>
</div>
<span></span><br>
</div>
</blockquote>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Laura<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<meta content="text/html; charset=UTF-8">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0; margin-bottom:0">-----</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0; margin-bottom:0">Laura C. Morris</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0; margin-bottom:0">Scientific Computing Professional</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0; margin-bottom:0"><span style="font-size:12pt">Edison & Prestegard Labs</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0; margin-bottom:0">Complex Carbohydrate Research Center</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0; margin-bottom:0">706-542-6286 (lab 1075)</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0; margin-bottom:0"><br>
</p>
</div>
</div>
</div>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Eric Pettersen <pett@cgl.ucsf.edu><br>
<b>Sent:</b> Friday, June 4, 2021 11:36 AM<br>
<b>To:</b> Laura Morris <lcmorris@uga.edu><br>
<b>Cc:</b> chimera-users@cgl.ucsf.edu <chimera-users@cgl.ucsf.edu><br>
<b>Subject:</b> Re: [Chimera-users] command line clustering (how to select a subSection?)</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space"><font color="BA0C2F">[EXTERNAL SENDER - PROCEED CAUTIOUSLY]</font><br>
<br>
<div>Hi Laura,
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>Looking at the code from that mail, the subSelection is just a string with the atom spec you want, but without the model number part. So for carbon alphas it would be "@CA". For the
example you gave it would be ":3-55@CA".</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">--Eric</div>
<div class=""><br class="">
</div>
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>Eric Pettersen</div>
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>UCSF Computer Graphics Lab</div>
</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Jun 4, 2021, at 8:07 AM, Laura Morris via Chimera-users <<a href="mailto:chimera-users@cgl.ucsf.edu" class="">chimera-users@cgl.ucsf.edu</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Recently I've been clustering in Chimera but running into memory limitations on my system. I'd like to do the clustering on a computer with more RAM, but I need to be able to do this using only the command line. I found an old post (<a href="http://plato.cgl.ucsf.edu/pipermail/chimera-users/2010-May/005166.html" id="LPlnk325162" class="">http://plato.cgl.ucsf.edu/pipermail/chimera-users/2010-May/005166.html</a>)
that includes an example script to do the clustering, but I don't know how to change the subSection to the residues and atoms I want. Here's the portion of relevant code:</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<div class=""><br class="">
</div>
<blockquote itemscope="" itemtype="https://schemas.microsoft.com/QuotedText" class="" style="border-color:rgb(200,200,200); border-left-width:3px; border-left-style:solid; padding-left:1ex; margin-left:0.8ex; color:rgb(102,102,102)">
<div class=""><span class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">def main():
<div class=""> import chimera</div>
<div class=""> modelList = chimera.openModels.list(modelTypes=[chimera.Molecule])</div>
<div class=""> subSelection = None # Change this to CAs or heavy atoms</div>
<div class=""> clusterInfo = _cluster(modelList, subSelection)</div>
<div class=""> saveReps(clusterInfo, "reps.pdb") # Change file name if needed</div>
<span class=""></span><br class="">
</span></div>
</blockquote>
The "Change this to CAs or heavy atoms" is exactly what I want to do, but I have no idea how to do it. If this were command line in Chimera, I'd use something like "select #0:3-55@CA". I know there's a "runCommand" function that can be included (using "from
chimera import runCommand"). Is this used in some way to set subSelection, and if so, how?<br class="">
</div>
<div class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Any help is appreciated.</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Regards,</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Laura<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div id="x_Signature" class="">
<div class="">
<div id="x_divtagdefaultwrapper" dir="ltr" class="" style="font-size:12pt; font-family:Calibri,Helvetica,sans-serif">
<div class="" style="margin-top:0px; margin-bottom:0px">-----</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Laura C. Morris</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Scientific Computing Professional</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><span class="" style="font-size:12pt">Edison & Prestegard Labs</span></div>
<div class="" style="margin-top:0px; margin-bottom:0px">Complex Carbohydrate Research Center</div>
<div class="" style="margin-top:0px; margin-bottom:0px">706-542-6286 (lab 1075)</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
</div>
</div>
</div>
</div>
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Chimera-users
mailing list:<span class="x_Apple-converted-space"> </span></span><a href="mailto:Chimera-users@cgl.ucsf.edu" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">Chimera-users@cgl.ucsf.edu</a><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Manage
subscription:<span class="x_Apple-converted-space"> </span></span><a href="https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
</body>
</html>