<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<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);">
Thank you, code is working as intended now. However, I am using this code to analyze a trajectory so it takes a while to run it for each frame. Is there any way I can optimize it to run faster?</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>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Eric Pettersen <pett@cgl.ucsf.edu><br>
<b>Sent:</b> Tuesday, August 27, 2019 6:30 PM<br>
<b>To:</b> Kevin Wang <kevinkw.wang@mail.utoronto.ca><br>
<b>Cc:</b> chimera-users@cgl.ucsf.edu <chimera-users@cgl.ucsf.edu><br>
<b>Subject:</b> Re: [Chimera-users] Python Script to Find Contact Area Between 2 Proteins</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">Hi Kevin,
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>Those arguments are “surface pieces”. Each molecular surface has only one “piece” (despite possibly looking like multiple disjoint pieces). Once you run the “surface” command (generating
two molecular surfaces) you can get the p1/p2 arguments with this code fragment:</div>
<div class=""><br class="">
</div>
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>p1, p2 = [s.surface_piece for s in openModels.list(modelTypes=[MSMSModel])]</div>
<div class=""><br class="">
</div>
<div class="">Both openModels and MSMSModel are in the “chimera” module, but since your code does a “from chimera import *” you can get away with just the above.</div>
<div class=""><br class="">
</div>
<div class="">—Eric</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">
<div class="" style="color:rgb(0,0,0); 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; text-decoration:none">
<span class="x_Apple-tab-span" style="white-space:pre"></span>Eric Pettersen</div>
<div class="" style="color:rgb(0,0,0); 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; text-decoration:none">
<span class="x_Apple-tab-span" style="white-space:pre"></span>UCSF Computer Graphics Lab</div>
<div class="" style="color:rgb(0,0,0); 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; text-decoration:none">
<br class="">
</div>
</div>
<div>
<blockquote type="cite" class="">
<div class="">On Aug 27, 2019, at 1:03 PM, Kevin Wang <<a href="mailto:kevinkw.wang@mail.utoronto.ca" class="">kevinkw.wang@mail.utoronto.ca</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">
Hi,</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">
I am writing a python script to find the area between 2 proteins using the contact_area python command below.</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="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class="" style="color:rgb(155,35,147)"><b class="">def</b></span><span class="x_Apple-converted-space"> </span>contact_area(p1, p2, d, color =<span class="x_Apple-converted-space"> </span><span class="" style="color:rgb(155,35,147)"><b class="">None</b></span>,
offset =<span class="x_Apple-converted-space"> </span><span class="" style="color:rgb(155,35,147)"><b class="">None</b></span>, slab =<span class="x_Apple-converted-space"> </span><span class="" style="color:rgb(155,35,147)"><b class="">None</b></span>,</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class=""> <span class="x_Apple-converted-space"> </span></span>smooth = False, optimize = True):</div>
<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">
Is there a specific object for p1 and p2 and if so how do I get it?</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">
My current code is as follows:</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="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; color:rgb(155,35,147); background-color:rgb(255,255,255)">
<b class="">import</b><span class="" style=""><span class="x_Apple-converted-space"> </span>os</span></div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class="" style="color:rgb(155,35,147)"><b class="">import</b></span><span class="x_Apple-converted-space"> </span>chimera</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class="" style="color:rgb(155,35,147)"><b class="">from</b></span><span class="x_Apple-converted-space"> </span>Measure<span class="x_Apple-converted-space"> </span><span class="" style="color:rgb(155,35,147)"><b class="">import</b></span><span class="x_Apple-converted-space"> </span>contactarea</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class="" style="color:rgb(155,35,147)"><b class="">from</b></span><span class="x_Apple-converted-space"> </span>chimera<span class="x_Apple-converted-space"> </span><span class="" style="color:rgb(155,35,147)"><b class="">import</b></span><span class="x_Apple-converted-space"> </span>*</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255); min-height:20px">
<br class="">
</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; color:rgb(196,26,22); background-color:rgb(255,255,255)">
<span class="" style="">Path =<span class="x_Apple-converted-space"> </span></span>"/Users/kevinwang/desktop/VEGFR_NO_LIGAND/results/clustering/pdbfit/split"</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255); min-height:20px">
<br class="">
</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
filelist = os.listdir(Path)</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class="" style="color:rgb(155,35,147)"><b class="">for</b></span><span class="x_Apple-converted-space"> </span>x<span class="x_Apple-converted-space"> </span><span class="" style="color:rgb(155,35,147)"><b class="">in</b></span><span class="x_Apple-converted-space"> </span>filelist:</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; color:rgb(83,101,121); background-color:rgb(255,255,255)">
<span class="" style=""><span class=""> <span class="x_Apple-converted-space"> </span></span></span><i class="">#if x.startswith("trp.pdb."):</i></div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; color:rgb(196,26,22); background-color:rgb(255,255,255)">
<span class="" style=""><span class=""> <span class="x_Apple-converted-space"> </span></span></span><span class="" style="color:rgb(155,35,147)"><b class="">if</b></span><span class="" style=""><span class="x_Apple-converted-space"> </span>(x ==<span class="x_Apple-converted-space"> </span></span>"trp.pdb.00001"<span class="" style="">):</span></div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class=""> <span class="x_Apple-converted-space"> </span></span><span class="" style="color:rgb(155,35,147)"><b class="">print</b></span><span class="x_Apple-converted-space"> </span>x</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class=""> <span class="x_Apple-converted-space"> </span></span>opened = chimera.openModels.open(x, type =<span class="" style="color:rgb(196,26,22)">"PDB"</span>)</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class=""> <span class="x_Apple-converted-space"> </span></span>runCommand(<span class="" style="color:rgb(28,0,207)">'surface'</span>)</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class=""> <span class="x_Apple-converted-space"> </span></span>y = contactarea.contact_area(<span class="" style="color:rgb(28,0,207)">'0.1'</span>,<span class="x_Apple-converted-space"> </span><span class="" style="color:rgb(28,0,207)">'0.2'</span>,<span class="x_Apple-converted-space"> </span><span class="" style="color:rgb(28,0,207)">2.5</span>)</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class=""> <span class="x_Apple-converted-space"> </span></span>text_file = open(<span class="" style="color:rgb(196,26,22)">"buriedArea.txt"</span>,<span class="x_Apple-converted-space"> </span><span class="" style="color:rgb(196,26,22)">"w"</span>)</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class=""> <span class="x_Apple-converted-space"> </span></span>text_file.write(y)</div>
<div class="" style="margin:0px; font-style:normal; font-variant-caps:normal; font-weight:normal; font-stretch:normal; font-size:17px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span class=""> <span class="x_Apple-converted-space"> </span></span>text_file.close()</div>
<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">
The error message I am getting is as follows:</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">
<span class="">AttributeError: 'str' object has no attribute 'geometry'<br class="">
</span>
<div class=""><br class="">
</div>
<div class=""> File "/Applications/Chimera.app/Contents/Resources/share/Measure/contactarea.py", line 8, in contact_area<br class="">
</div>
<div class=""> v1, t1 = p1.geometry<br class="">
</div>
<span class=""></span><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">
How should I be passing in my arguments?</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">
Best,</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">
Kevin</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="http://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">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>