<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Kevin,<div class=""><br class=""></div><div class=""> The Chimera buried_area() function does not return a value, it prints its various buried area results to the reply log, so that isn't going to work in your script. But here is how to call it.</div><div class=""><br class=""></div><div class=""><div class="">>>> from chimera.specifier import evalSpec</div><div class="">>>> a1 = evalSpec(':899-1230').atoms()</div><div class="">>>> a2 = evalSpec(':286-596').atoms()</div><div class="">>>> from Measure.measure import buried_area</div><div class="">>>> buried_area('', a1, a2)</div><div><br class=""></div><div>The first argument "operation" is just a string, I think it says "buriedArea" but is not used by the code. You can see the code in chimera/share/Measure/measure.py or online</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/Measure/measure.py" class="">http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/Measure/measure.py</a></div><div><br class=""></div><div>The second and third arguments are lists of atoms, obtained above by the evalSpec() function. You could copy the buried_area() function to your script and modify it to return the values you need. The routine logs 12 different values. Also this routine computes the surface areas -- you do not need the lines in your script to compute surfaces runCommand('surface :286-596') ..., those will not be used.</div><div><br class=""></div><div>Chimera uses MSMS (a third-party surface library) to compute molecular surfaces and it is known to fail often, especially for large structures (> 10000 atoms). So if you plan to run this on lots of files you should expect it to fail a lot. You would be much better off using our newer ChimeraX program which will never fail computing buried area, as it uses new reliable code. The Python to get the two sets of atoms would be different -- if you want to use this, ask and I can give an example.</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre"> </span><a href="https://www.rbvi.ucsf.edu/chimerax/docs/devel/core/commands/user_commands.html#measure" class="">https://www.rbvi.ucsf.edu/chimerax/docs/devel/core/commands/user_commands.html#measure</a></div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Tom</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 29, 2019, at 8:49 AM, Kevin Wang <<a href="mailto:kevinkw.wang@mail.utoronto.ca" class="">kevinkw.wang@mail.utoronto.ca</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div 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; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">Hi,</div><div 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; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div 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; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">I am trying to use the buried_area function below. What are the arguments that I need to pass in?</div><div 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; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div 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; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><div 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);" class=""><span style="color: rgb(155, 35, 147);" class=""><b class="">def</b></span><span class="Apple-converted-space"> </span>buried_area(operation, atoms1, atoms2,</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>probeRadius =<span class="Apple-converted-space"> </span><span style="color: rgb(28, 0, 207);" class="">1.4</span>, vertexDensity =<span class="Apple-converted-space"> </span><span style="color: rgb(28, 0, 207);" class="">2.0</span>):</div><br class=""></div><div 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; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">My current code is as follows:</div><div 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; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div 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; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><div 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);" class=""><i class="">#calculate buried area</i></div><div 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;" class=""><br class=""></div><div 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);" class=""><b class="">import</b><span style="" class=""><span class="Apple-converted-space"> </span>os</span></div><div 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);" class=""><span style="color: rgb(155, 35, 147);" class=""><b class="">import</b></span><span class="Apple-converted-space"> </span>chimera</div><div 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);" class=""><span style="color: rgb(155, 35, 147);" class=""><b class="">import</b></span><span class="Apple-converted-space"> </span>xlsxwriter</div><div 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);" class=""><span style="color: rgb(155, 35, 147);" class=""><b class="">from</b></span><span class="Apple-converted-space"> </span>Measure<span class="Apple-converted-space"> </span><span style="color: rgb(155, 35, 147);" class=""><b class="">import</b></span><span class="Apple-converted-space"> </span>measure</div><div 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);" class=""><span style="color: rgb(155, 35, 147);" class=""><b class="">from</b></span><span class="Apple-converted-space"> </span>chimera<span class="Apple-converted-space"> </span><span style="color: rgb(155, 35, 147);" class=""><b class="">import</b></span><span class="Apple-converted-space"> </span>*</div><div 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);" class="">workbook = xlsxwriter.Workbook(<span style="color: rgb(28, 0, 207);" class="">'contactArea.xlsx'</span>)</div><div 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);" class="">worksheet = workbook.add_worksheet()</div><div 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);" class=""><span style="" class="">Path =<span class="Apple-converted-space"> </span></span>"/Users/kevinwang/desktop/VEGFR_NO_LIGAND/results/clustering/pdbfit/split"</div><div 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;" class=""><br class=""></div><div 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);" class="">i =<span class="Apple-converted-space"> </span><span style="color: rgb(28, 0, 207);" class="">0</span></div><div 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;" class=""><br class=""></div><div 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);" class="">filelist = os.listdir(Path)</div><div 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);" class=""><span style="color: rgb(155, 35, 147);" class=""><b class="">for</b></span><span class="Apple-converted-space"> </span>x<span class="Apple-converted-space"> </span><span style="color: rgb(155, 35, 147);" class=""><b class="">in</b></span><span class="Apple-converted-space"> </span>filelist:</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span><span style="color: rgb(155, 35, 147);" class=""><b class="">if</b></span><span class="Apple-converted-space"> </span>x.startswith(<span style="color: rgb(196, 26, 22);" class="">"trp.pdb."</span>):</div><div 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);" class=""><span style="" class=""><span class=""> <span class="Apple-converted-space"> </span></span></span><i class="">#if (x == "trp.pdb.00001"):</i></div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>opened = chimera.openModels.open(x, type =<span style="color: rgb(196, 26, 22);" class="">"PDB"</span>)</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>chimera.update.checkForChanges()</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span><span style="color: rgb(155, 35, 147);" class=""><b class="">try</b></span>:</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>runCommand(<span style="color: rgb(28, 0, 207);" class="">'surface :286-596'</span>)</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>runCommand(<span style="color: rgb(28, 0, 207);" class="">'surface :899-1230'</span>)</div><p 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;" class=""><span class=""> </span><br class="webkit-block-placeholder"></p><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>y = measure.buried_area()</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>worksheet.write(i,<span style="color: rgb(28, 0, 207);" class="">0</span>,x)</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>worksheet.write(i,<span style="color: rgb(28, 0, 207);" class="">1</span>,y)</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span><span style="color: rgb(155, 35, 147);" class=""><b class="">except</b></span>:</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>worksheet.write(i,<span style="color: rgb(28, 0, 207);" class="">0</span>,x)</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>worksheet.write(i,<span style="color: rgb(28, 0, 207);" class="">1</span>,<span style="color: rgb(196, 26, 22);" class="">"ERROR"</span>)</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>i = i +<span class="Apple-converted-space"> </span><span style="color: rgb(28, 0, 207);" class="">1</span></div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span><span style="color: rgb(155, 35, 147);" class=""><b class="">print</b></span>(<span style="color: rgb(196, 26, 22);" class="">"Processed: "</span><span class="Apple-converted-space"> </span>+ x)</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span><span style="color: rgb(155, 35, 147);" class=""><b class="">print</b></span>(<span style="color: rgb(196, 26, 22);" class="">"Total #: "</span><span class="Apple-converted-space"> </span>+ str(i))</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>runCommand(<span style="color: rgb(28, 0, 207);" class="">'close all'</span>)</div><div 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);" class=""><span class=""> <span class="Apple-converted-space"> </span></span>chimera.update.checkForChanges()</div><div 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;" class=""><br class=""></div><div 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);" class="">workbook.close()</div><div 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;" class=""><br class=""></div><br class=""><br class=""></div><div 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; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div 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; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">Best,</div><div 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; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">Kevin</div><span style="caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Chimera-users mailing list:<span class="Apple-converted-space"> </span></span><a href="mailto:Chimera-users@cgl.ucsf.edu" 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; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Chimera-users@cgl.ucsf.edu</a><br style="caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Manage subscription:<span class="Apple-converted-space"> </span></span><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" 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; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a></div></blockquote></div><br class=""></div></body></html>