<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi all,
<div><br>
</div>
<div>Can anyone show me a good way to select all residues that are <2Å from zinc atoms, then rename any selected CYS and HIS, to CYM and HIN respectively ... I'm trying to write a script to do this on ~300 files.</div>
<div><br>
</div>
<div>Thanks!!</div>
<div>Mike</div>
<div><br>
</div>
<div>Here's what I have so far</div>
<div><br>
</div>
<div>
<div>import os</div>
<div>from chimera import runCommand as rc</div>
<div>from chimera import replyobj</div>
<div><br>
</div>
<div># gather the names of .pdb files in the folder</div>
<div>file_names = [fn for fn in os.listdir(".") if fn.endswith(".pdb")]</div>
<div><br>
</div>
<div># loop through the files, opening, processing, and closing each in turn</div>
<div>for fn in file_names:</div>
<div> replyobj.status("Processing " + fn) # show what file we're working on</div>
<div><br>
</div>
<div> rc("open " + fn)</div>
<div><br>
</div>
<div> rc("select :ZNB zr<2")</div>
<div> rc("writesel "reslist + fn")</div>
<div> </div>
<div> rc("close all")</div>
<div><br>
</div>
<div>rc("stop now")</div>
</div>
</div>
</body>
</html>