<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
 --></style><title>Re: [cctbxbb] crystal packing/unit cell
question</title></head><body>
<div>Thanks everyone, for the input.&nbsp; I have written a little
script using your help.&nbsp; Attached is an image -- the green is the
output of my script, the blue is the original pdb file.</div>
<div><br></div>
<div>code looks like this:</div>
<div><br></div>
<div><b>from iotbx.file_reader import any_file</b></div>
<div><b>import sys</b></div>
<div><b>from mmtbx import utils<br>
<br>
def run (args) :<br>
<x-tab> </x-tab>pdb_file = args[0]</b></div>
<div><b><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>pdb_inp = any_file(pdb_file,
force_type=&quot;pdb&quot;).file_object</b></div>
<div><b><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>xray =
pdb_inp.xray_structure_simple()<br>
<x-tab>&nbsp; </x-tab>uc =
xray.expand_to_p1(sites_mod_positive=True)<br>
<br>
<x-tab> </x-tab>outfile = open(&quot;unit_cell.pdb&quot;,
&quot;w&quot;)<br>
<br>
&nbsp;</b></div>
<div><b><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>utils.write_pdb_file(xray_structure = uc, pdb_hierarchy =
pdb_inp.construct_hierarchy(), out = outfile)</b></div>
<div><b><br></b></div>
<div><b>if __name__ == &quot;__main__&quot; :</b></div>
<div><b><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>run(sys.argv[1:])</b></div>
<div><br></div>
<div><br></div>
<div>It doesn't look like it is doing quite what I want.&nbsp; Oh...I
just had the thought that perhaps I should apply the symmetry
operators before using 'expand_to_P1'</div>
<div>&nbsp;</div>
<div>Maybe?</div>
<div><br></div>
<div>Jessica</div>
<div><br></div>
<div><br></div>
<div><br></div>
<div><br></div>
<div><br></div>
<blockquote type="cite" cite>
<blockquote type="cite" cite>1) isn't this a method of the X-ray
structure object, not one of the PDB objects?</blockquote>
</blockquote>
<blockquote type="cite" cite><br>
expand_to_p1 is a method from xray/structure.py. I just used it
yesterday.<br>
<blockquote type="cite" cite>2) won't it split up molecules to keep
the sites all inside the unit cell?<br>
<br>
I'm getting annoyed that it's not easier to do this kind of lattice
generation for proteins, so I may just try coding it myself later
today or tomorrow.&nbsp; (I'd like to figure out something analogous
to the 'symexp' function in PyMOL, but I think that's a little more
work.)</blockquote>
</blockquote>
<blockquote type="cite" cite><br>
I can't imagine what can be easier than this? If you don't want to
&quot;split&quot; copies to be all atoms from 1 to -1, then I guess
sites_mod_positive=True (or False, I don't remember) should probably
simply multiply copies.<br>
Anyway, it's faster to try than typing this email: try both, save
xray_structure as PDB file and open it in PyMol.<br>
<br>
What is 'symexp' function in PyMOL ?<br>
<br>
Pavel<br>
<br>
_______________________________________________<br>
cctbxbb mailing list<br>
cctbxbb@phenix-online.org<br>
http://phenix-online.org/mailman/listinfo/cctbxbb</blockquote>
<div><br></div>
</body>
</html>