<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,</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 writing a python script to find the area between 2 proteins using the contact_area python command below.</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);">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span style="color: #9b2393"><b>def</b></span> contact_area(p1, p2, d, color = <span style="color: #9b2393">
<b>None</b></span>, offset = <span style="color: #9b2393"><b>None</b></span>, slab =
<span style="color: #9b2393"><b>None</b></span>,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span> </span>smooth = False, optimize = True):</p>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Is there a specific object for p1 and p2 and if so how do I get it?</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);">
My current code is as follows:</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);">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #9b2393; background-color: #ffffff">
<b>import</b><span style="color: #000000"> os</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span style="color: #9b2393"><b>import</b></span> chimera</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span style="color: #9b2393"><b>from</b></span> Measure <span style="color: #9b2393">
<b>import</b></span> contactarea</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span style="color: #9b2393"><b>from</b></span> chimera <span style="color: #9b2393">
<b>import</b></span> *</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff; min-height: 20.0px">
<br>
</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #c41a16; background-color: #ffffff">
<span style="color: #000000">Path = </span>"/Users/kevinwang/desktop/VEGFR_NO_LIGAND/results/clustering/pdbfit/split"</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff; min-height: 20.0px">
<br>
</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
filelist = os.listdir(Path)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span style="color: #9b2393"><b>for</b></span> x <span style="color: #9b2393"><b>in</b></span> filelist:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #536579; background-color: #ffffff">
<span style="color: #000000"><span> </span></span><i>#if x.startswith("trp.pdb."):</i></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #c41a16; background-color: #ffffff">
<span style="color: #000000"><span> </span></span><span style="color: #9b2393"><b>if</b></span><span style="color: #000000"> (x ==
</span>"trp.pdb.00001"<span style="color: #000000">):</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span> </span><span style="color: #9b2393"><b>print</b></span> x</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span> </span>opened = chimera.openModels.open(x, type =<span style="color: #c41a16">"PDB"</span>)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span> </span>runCommand(<span style="color: #1c00cf">'surface'</span>)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span> </span>y = contactarea.contact_area(<span style="color: #1c00cf">'0.1'</span>,
<span style="color: #1c00cf">'0.2'</span>, <span style="color: #1c00cf">2.5</span>)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span> </span>text_file = open(<span style="color: #c41a16">"buriedArea.txt"</span>,
<span style="color: #c41a16">"w"</span>)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span> </span>text_file.write(y)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Menlo; color: #000000; background-color: #ffffff">
<span> </span>text_file.close()</p>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The error message I am getting is as follows:</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);">
<span>AttributeError: 'str' object has no attribute 'geometry'<br>
</span>
<div><br>
</div>
<div> File "/Applications/Chimera.app/Contents/Resources/share/Measure/contactarea.py", line 8, in contact_area<br>
</div>
<div> v1, t1 = p1.geometry<br>
</div>
<span></span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
How should I be passing in my arguments?</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);">
Best,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Kevin</div>
</body>
</html>