<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.apple-tab-span
{mso-style-name:apple-tab-span;}
span.apple-style-span
{mso-style-name:apple-style-span;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.EstiloCorreo21
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=ES link=blue vlink=purple style='word-wrap: break-word;-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space'>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hi Eric and others,<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I am having problems with the selection, is it a list or a
variable ?… sorry.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I selected some atoms and then open the IDLE.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Then goes the script :<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>>> import chimera<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>>>> from DetectClash import detectClash<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>>>> at=chimera.selection.currentAtoms() – this stocks
in at a list of atoms.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>>>> clashes=detectClash(at.atoms()) – I do what you
say<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>And the message error :<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Traceback (most recent call last):<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'> File "<pyshell#3>", line 1, in <module><o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'> clashes=detectClash(at.atoms())<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>AttributeError: 'list' object has no attribute 'atoms'<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I played around between list and variables but can’t find
the right way to move forward. Could you throw me a cable please .<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Best,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>jd<o:p></o:p></span></p>
<p class=MsoNormal><span lang=FR-BE style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Eric Pettersen
[mailto:pett@cgl.ucsf.edu] <br>
<b>Enviado el:</b> martes, 28 de octubre de 2008 19:18<br>
<b>Para:</b> JeanDidier.Marechal@uab.es<br>
<b>CC:</b> chimera-dev@cgl.ucsf.edu<br>
<b>Asunto:</b> Re: [chimera-dev] python for finding clashes<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Hi JD,<o:p></o:p></p>
<div>
<p class=MsoNormal><span class=apple-tab-span> </span>You should use
DetectClash.detectClash(). The only mandatory argument is a list of
atoms. So if your selection was in a variable named 's', you might call
the function like so:<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal><span class=apple-tab-span> </span>from
DetectClash import detectClash<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><span class=apple-tab-span> </span>clashes =
detectClash(s.atoms())<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal>The return value is a dictionary. The keys of the
dictionary are atoms that have clashes. The values are dictionaries.
These dictionaries have keys which are the atoms that clash with the
original key atom. The values are the amount of the clash. So to
get the number of clashes, you would use something like this:<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal><span class=apple-tab-span> </span>sum = 0<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><span class=apple-tab-span> </span>for clashDict
in clashes.values():<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><span class=apple-tab-span> </span>sum
+= len(clashDict)<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><span class=apple-tab-span> </span>numClashes =
sum / 2<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal><span class=apple-tab-span> </span>Now, there are
a lot of optional keyword arguments to the detectClash() function. They
are pretty well documented in the doc string of the function. So you
should look through the doc string and post any questions that you might still
have...<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal>--Eric<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
<div>
<div>
<p style='margin:0cm;margin-bottom:.0001pt'><span class=apple-converted-space><span
style='font-family:"Helvetica","sans-serif";color:black'>
</span></span><span
style='font-family:"Helvetica","sans-serif";color:black'>Eric Pettersen<o:p></o:p></span></p>
<p style='margin:0cm;margin-bottom:.0001pt'><span class=apple-converted-space><span
style='font-family:"Helvetica","sans-serif";color:black'>
</span></span><span
style='font-family:"Helvetica","sans-serif";color:black'>UCSF Computer Graphics
Lab<o:p></o:p></span></p>
<p style='margin:0cm;margin-bottom:.0001pt'><span class=apple-converted-space><span
style='font-family:"Helvetica","sans-serif";color:black'>
</span></span><span style='font-family:"Helvetica","sans-serif";
color:black'><a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Helvetica","sans-serif";
color:black'><o:p> </o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<div>
<div>
<p class=MsoNormal>On Oct 28, 2008, at 7:15 AM, Jean Didier Pie Marechal wrote:<o:p></o:p></p>
</div>
<p class=MsoNormal><br>
<br>
<o:p></o:p></p>
<div>
<p class=MsoNormal>Hi everyone,<br>
<br>
I am writing a script for which I need the number of clashes for a given
selection for continuing. <br>
<br>
My first thought was to simply run in my script: <br>
runCommand("findclash selection ignoreIntraRes false") <br>
after having selected the region I was interested in.<br>
However, I realize that I come to the recurrent problem: having the information
I am interested in printed in the reply log. I don't know how to have the info
passed into an array or any kind of variable in the python environment.
Could you tell me how to do so please? <br>
<br>
On the other side, I would be pleased if you could tell me what is the correct
arguments I have to pass and syntax I have to use for the functions
detectClash and/or cmdDetectClash (which I guess is the basis of the same
findclash). <br>
<br>
All the best,<br>
JD<br>
<br>
Dr. Jean-Didier Maréchal<br>
Lecturer<br>
Computational Bioorganic and Bioionorganic Chemistry @ Transmet<br>
Unitat de Química Física<br>
Departament de Química<br>
Universitat Autònoma de Barcelona<br>
Edifici C.n.<br>
08193 Cerdanyola (Barcelona)<br>
Tel: +34.935814936<br>
e-mail: <a href="mailto:JeanDidier.Marechal@uab.es">JeanDidier.Marechal@uab.es</a><br>
<br>
<br>
<br>
_______________________________________________<br>
Chimera-dev mailing list<br>
<a href="mailto:Chimera-dev@cgl.ucsf.edu">Chimera-dev@cgl.ucsf.edu</a><br>
http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev<o:p></o:p></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</div>
</body>
</html>