<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi JD,<div><span class="Apple-tab-span" style="white-space:pre"> </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:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>from DetectClash import detectClash<br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>clashes = detectClash(s.atoms())<br></div><div><br></div><div>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:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>sum = 0<br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>for clashDict in clashes.values():<br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>sum += len(clashDict)<br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>numClashes = sum / 2<br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </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...<br></div><div><br></div><div>--Eric</div><div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>Eric Pettersen</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>UCSF Computer Graphics Lab</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> </span><a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></p><br class="Apple-interchange-newline"></div></span> </div><br><div><div>On Oct 28, 2008, at 7:15 AM, Jean Didier Pie Marechal wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>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<br></div></blockquote></div><br></div></body></html>