<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Aditya,<div><span class="Apple-tab-span" style="white-space:pre"> </span>I think the issue here is that you don't do anything to specify what folder you are writing "sas111.txt" in. For instance, on the Mac if you start Chimera by double-clicking then the "current folder" is /, which you almost certainly don't have write permission for. So instead of opening just "sas111.txt" you need to specify the full path to the file, e.g.:</div><div><br></div><div>out = open("/Users/aditya/sas111.txt", "a")</div><div><br></div><div>Along the same lines, this code will always write sas111.txt in your home folder:</div><div><br></div><div>from os import expanduser</div><div>out = open(expanduser("~/sas111.txt"), "a")</div><div><br></div><div>--Eric</div><br><div><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> Eric Pettersen</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> UCSF Computer Graphics Lab</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> <a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></div></div></span></div><div><br><div><div>On Jan 28, 2011, at 4:04 AM, Aditya Padhi wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Elaine,<br> Hope you are fine. If you remember I was calculating per residue SASA using Chimera for my MD simulated protein. At that time it was working fine. But I did some more simulation run and now I want to calculate SASA for the entire trajectory but unfortunately Its showing the following error.<br> <br><b>Error</b><br>Problem in per-frame script:<br>IOError: [Errno 13] Permission denied: 'sas111.txt'<br><br> File "<string>", line 3, in <module><br><br>See reply log for Python traceback.<br> <br>For your reference, I am giving the script also. It was working fine previously but with the same procedure which I followed this script is not working and showing the above mentioned error.<br><b><br>Script </b><br>from chimera import openModels, Molecule<br> <br>out = open("sas111.txt", "a")<br>x='---------------------------------------------------------------------------------'<br>for m in openModels.list(modelTypes=[Molecule]):<br> for r in m.residues:<br> try:<br> sas = r.areaSAS<br> except AttributeError:<br> continue<br> print>>out, r, sas<br>print>>out,x<br>out.close()<br><br><br>Kindly help me.<br>Thank you.<br>Aditya.<br> _______________________________________________<br>Chimera-users mailing list<br><a href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</a><br>http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users<br></blockquote></div><br></div><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; "><span class="Apple-style-span" style="font-size: medium;"><br class="Apple-interchange-newline"></span></div></span> </div><br></body></html>