<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Jessica,<br>
    <br>
    try with&nbsp;<b>sites_mod_positive=False</b> (this is what I mentioned
    this morning in my previous email). I think (but not sure) one of
    them should do "what you want" . I just tried. Run the attached
    script with the PDB file of your choice, and compare the results.<br>
    <br>
    Pavel<br>
    <br>
    <br>
    On 11/3/11 12:42 PM, Jessica Grant wrote:
    <blockquote cite="mid:a0624080ccad89b1d504e@%5B10.0.1.3%5D"
      type="cite">
      <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>
      <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="pdb").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("unit_cell.pdb",
          "w")<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__ == "__main__" :</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
        "split" 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>
        <a class="moz-txt-link-abbreviated" href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a><br>
        <a class="moz-txt-link-freetext" href="http://phenix-online.org/mailman/listinfo/cctbxbb">http://phenix-online.org/mailman/listinfo/cctbxbb</a></blockquote>
      <div><br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
cctbxbb mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a>
<a class="moz-txt-link-freetext" href="http://phenix-online.org/mailman/listinfo/cctbxbb">http://phenix-online.org/mailman/listinfo/cctbxbb</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>