I am new to cctbx and crystallography in general. I am trying to take a pdb file and produce a representation of the crystal, similar to the symmetry mates produced in pymol. I have used cctbx to apply the symmetry operators, but this gives atomic coordinates that are quite spread out. I think what I want to do is to fill the unit cell, or in some way extract crystal packing information. I would like, in the end, to be able to build files with a physically realistic representation of different sized crystals, so I can go on to study the interactions of molecules within those crystals. Is there a way to do this in cctbx? Thanks! Jessica
Am Donnerstag 03 November 2011 11:58:34 schrieb Jessica Grant:
I am new to cctbx and crystallography in general. I am trying to take a pdb file and produce a representation of the crystal, similar to the symmetry mates produced in pymol. I have used cctbx to apply the symmetry operators, but this gives atomic coordinates that are quite spread out. I think what I want to do is to fill the unit cell, or in some way extract crystal packing information.
Hi Jessica, after loading the structure from the pdb file does this line do the trick for you?: my_structure = my_structure.expand_to_p1(sites_mod_positive=True) It should give you a completly filled unit cell with all symmetry operations applied and all atom coordinates in the interval [0,1[. With regards, Dipl. Phys. Jan M. Simons Institute of Crystallography RWTH Aachen University
2011/11/3 Jan Marten Simons
after loading the structure from the pdb file does this line do the trick for you?:
my_structure = my_structure.expand_to_p1(sites_mod_positive=True)
It should give you a completly filled unit cell with all symmetry operations applied and all atom coordinates in the interval [0,1[.
Two questions: 1) isn't this a method of the X-ray structure object, not one of the PDB objects? 2) won't it split up molecules to keep the sites all inside the unit cell? 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. (I'd like to figure out something analogous to the 'symexp' function in PyMOL, but I think that's a little more work.) -Nat
1) isn't this a method of the X-ray structure object, not one of the PDB objects?
expand_to_p1 is a method from xray/structure.py. I just used it yesterday.
2) won't it split up molecules to keep the sites all inside the unit cell?
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. (I'd like to figure out something analogous to the 'symexp' function in PyMOL, but I think that's a little more work.)
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. Anyway, it's faster to try than typing this email: try both, save xray_structure as PDB file and open it in PyMol. What is 'symexp' function in PyMOL ? Pavel
Thanks everyone, for the input. I have written a little script using your help. Attached is an image -- the green is the output of my script, the blue is the original pdb file. code looks like this: from iotbx.file_reader import any_file import sys from mmtbx import utils def run (args) : pdb_file = args[0] pdb_inp = any_file(pdb_file, force_type="pdb").file_object xray = pdb_inp.xray_structure_simple() uc = xray.expand_to_p1(sites_mod_positive=True) outfile = open("unit_cell.pdb", "w") utils.write_pdb_file(xray_structure = uc, pdb_hierarchy = pdb_inp.construct_hierarchy(), out = outfile) if __name__ == "__main__" : run(sys.argv[1:]) It doesn't look like it is doing quite what I want. Oh...I just had the thought that perhaps I should apply the symmetry operators before using 'expand_to_P1' Maybe? Jessica
1) isn't this a method of the X-ray structure object, not one of the PDB objects?
expand_to_p1 is a method from xray/structure.py. I just used it yesterday.
2) won't it split up molecules to keep the sites all inside the unit cell?
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. (I'd like to figure out something analogous to the 'symexp' function in PyMOL, but I think that's a little more work.)
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. Anyway, it's faster to try than typing this email: try both, save xray_structure as PDB file and open it in PyMol.
What is 'symexp' function in PyMOL ?
Pavel
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
Hi Jessica, try with *sites_mod_positive=False* (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. Pavel On 11/3/11 12:42 PM, Jessica Grant wrote:
Thanks everyone, for the input. I have written a little script using your help. Attached is an image -- the green is the output of my script, the blue is the original pdb file.
code looks like this:
*from iotbx.file_reader import any_file* *import sys* *from mmtbx import utils
def run (args) : pdb_file = args[0]* *pdb_inp = any_file(pdb_file, force_type="pdb").file_object* * xray = pdb_inp.xray_structure_simple() uc = xray.expand_to_p1(sites_mod_positive=True)
outfile = open("unit_cell.pdb", "w")
* *utils.write_pdb_file(xray_structure = uc, pdb_hierarchy = pdb_inp.construct_hierarchy(), out = outfile)* * * *if __name__ == "__main__" :* *run(sys.argv[1:])*
It doesn't look like it is doing quite what I want. Oh...I just had the thought that perhaps I should apply the symmetry operators before using 'expand_to_P1' Maybe?
Jessica
1) isn't this a method of the X-ray structure object, not one of the PDB objects?
expand_to_p1 is a method from xray/structure.py. I just used it yesterday.
2) won't it split up molecules to keep the sites all inside the unit cell?
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. (I'd like to figure out something analogous to the 'symexp' function in PyMOL, but I think that's a little more work.)
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. Anyway, it's faster to try than typing this email: try both, save xray_structure as PDB file and open it in PyMol.
What is 'symexp' function in PyMOL ?
Pavel
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
Neither of these will work, for the reasons that were already stated -
with sites_mod_positive=False, the symmetry mates do not necessarily
end up with most atoms in the minimal unit cell with origin at 0,0,0,
and with sites_mod_positive=True, all atoms are in the unit cell, but
the protein chains are chopped up. Neither of these shows how the
crystal is packed. Doing so requires sampling translations of the
fractional coordinates.
On Thu, Nov 3, 2011 at 2:29 PM, Pavel Afonine
Hi Jessica,
try with sites_mod_positive=False (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.
Pavel
On 11/3/11 12:42 PM, Jessica Grant wrote:
Thanks everyone, for the input. I have written a little script using your help. Attached is an image -- the green is the output of my script, the blue is the original pdb file. code looks like this: from iotbx.file_reader import any_file import sys from mmtbx import utils
def run (args) : pdb_file = args[0] pdb_inp = any_file(pdb_file, force_type="pdb").file_object
xray = pdb_inp.xray_structure_simple() uc = xray.expand_to_p1(sites_mod_positive=True)
outfile = open("unit_cell.pdb", "w")
utils.write_pdb_file(xray_structure = uc, pdb_hierarchy = pdb_inp.construct_hierarchy(), out = outfile) if __name__ == "__main__" : run(sys.argv[1:])
It doesn't look like it is doing quite what I want. Oh...I just had the thought that perhaps I should apply the symmetry operators before using 'expand_to_P1'
Maybe? Jessica
1) isn't this a method of the X-ray structure object, not one of the PDB objects?
expand_to_p1 is a method from xray/structure.py. I just used it yesterday.
2) won't it split up molecules to keep the sites all inside the unit cell?
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. (I'd like to figure out something analogous to the 'symexp' function in PyMOL, but I think that's a little more work.)
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. Anyway, it's faster to try than typing this email: try both, save xray_structure as PDB file and open it in PyMol.
What is 'symexp' function in PyMOL ?
Pavel
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
The original question did not mention the requirement for atoms to me in the minimal cell with the origin (0,0,0) or I probably missed it. Ok, this new requirement can be achieved by a few extra lines, so the whole algorithm is: - use expand_to_p1 using sites_mod_positive=False, exactly as before, then - use Ralf's minimal covering sphere algorithm to pack everything together (Ralf: is it in svn?) (is it necessary - need to think - can't tell right away); - then shift the whole thing such that the minimal atomic xyz is 000, or much better, use the underlying algorithm of iotbx.pdb.box_around_molecule, which will create a P1 box centered around symmetry expanded molecules. I think a combination of above should solve the issue even if I missed a detail. Pavel On 11/3/11 4:02 PM, Nat Echols wrote:
Neither of these will work, for the reasons that were already stated - with sites_mod_positive=False, the symmetry mates do not necessarily end up with most atoms in the minimal unit cell with origin at 0,0,0, and with sites_mod_positive=True, all atoms are in the unit cell, but the protein chains are chopped up. Neither of these shows how the crystal is packed. Doing so requires sampling translations of the fractional coordinates.
On Thu, Nov 3, 2011 at 2:29 PM, Pavel Afonine
wrote: Hi Jessica,
try with sites_mod_positive=False (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.
Pavel
On 11/3/11 12:42 PM, Jessica Grant wrote:
Thanks everyone, for the input. I have written a little script using your help. Attached is an image -- the green is the output of my script, the blue is the original pdb file. code looks like this: from iotbx.file_reader import any_file import sys from mmtbx import utils
def run (args) : pdb_file = args[0] pdb_inp = any_file(pdb_file, force_type="pdb").file_object
xray = pdb_inp.xray_structure_simple() uc = xray.expand_to_p1(sites_mod_positive=True)
outfile = open("unit_cell.pdb", "w")
utils.write_pdb_file(xray_structure = uc, pdb_hierarchy = pdb_inp.construct_hierarchy(), out = outfile) if __name__ == "__main__" : run(sys.argv[1:])
It doesn't look like it is doing quite what I want. Oh...I just had the thought that perhaps I should apply the symmetry operators before using 'expand_to_P1'
Maybe? Jessica
1) isn't this a method of the X-ray structure object, not one of the PDB objects?
expand_to_p1 is a method from xray/structure.py. I just used it yesterday.
2) won't it split up molecules to keep the sites all inside the unit cell?
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. (I'd like to figure out something analogous to the 'symexp' function in PyMOL, but I think that's a little more work.)
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. Anyway, it's faster to try than typing this email: try both, save xray_structure as PDB file and open it in PyMol.
What is 'symexp' function in PyMOL ?
Pavel
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
If I understand what Jessica is trying to do, it doesn't necessarily
need to be in the minimal cell (this is what I tried to do before, and
failed), as long as the symmetry mates are actually packing against
each other. But it should be possible to do it both ways with
additional translations.
On Thu, Nov 3, 2011 at 4:14 PM, Pavel Afonine
The original question did not mention the requirement for atoms to me in the minimal cell with the origin (0,0,0) or I probably missed it. Ok, this new requirement can be achieved by a few extra lines, so the whole algorithm is:
- use expand_to_p1 using sites_mod_positive=False, exactly as before, then - use Ralf's minimal covering sphere algorithm to pack everything together (Ralf: is it in svn?) (is it necessary - need to think - can't tell right away); - then shift the whole thing such that the minimal atomic xyz is 000, or much better, use the underlying algorithm of iotbx.pdb.box_around_molecule, which will create a P1 box centered around symmetry expanded molecules.
I think a combination of above should solve the issue even if I missed a detail.
Pavel
On 11/3/11 4:02 PM, Nat Echols wrote:
Neither of these will work, for the reasons that were already stated - with sites_mod_positive=False, the symmetry mates do not necessarily end up with most atoms in the minimal unit cell with origin at 0,0,0, and with sites_mod_positive=True, all atoms are in the unit cell, but the protein chains are chopped up. Neither of these shows how the crystal is packed. Doing so requires sampling translations of the fractional coordinates.
On Thu, Nov 3, 2011 at 2:29 PM, Pavel Afonine
wrote: Hi Jessica,
try with sites_mod_positive=False (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.
Pavel
On 11/3/11 12:42 PM, Jessica Grant wrote:
Thanks everyone, for the input. I have written a little script using your help. Attached is an image -- the green is the output of my script, the blue is the original pdb file. code looks like this: from iotbx.file_reader import any_file import sys from mmtbx import utils
def run (args) : pdb_file = args[0] pdb_inp = any_file(pdb_file, force_type="pdb").file_object
xray = pdb_inp.xray_structure_simple() uc = xray.expand_to_p1(sites_mod_positive=True)
outfile = open("unit_cell.pdb", "w")
utils.write_pdb_file(xray_structure = uc, pdb_hierarchy = pdb_inp.construct_hierarchy(), out = outfile) if __name__ == "__main__" : run(sys.argv[1:])
It doesn't look like it is doing quite what I want. Oh...I just had the thought that perhaps I should apply the symmetry operators before using 'expand_to_P1'
Maybe? Jessica
1) isn't this a method of the X-ray structure object, not one of the PDB objects?
expand_to_p1 is a method from xray/structure.py. I just used it yesterday.
2) won't it split up molecules to keep the sites all inside the unit cell?
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. (I'd like to figure out something analogous to the 'symexp' function in PyMOL, but I think that's a little more work.)
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. Anyway, it's faster to try than typing this email: try both, save xray_structure as PDB file and open it in PyMol.
What is 'symexp' function in PyMOL ?
Pavel
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
- use Ralf's minimal covering sphere algorithm to pack everything together (Ralf: is it in svn?)
No. I found this to be a tricky problem. My implementation was just good enough for a specific purpose. I'm attaching the old script just in case it is useful as a starting point. Probably it doesn't run without modifications. It aims to move protein chains around minimizing the radius of the covering sphere. It isn't always what one would choose after visual inspection. The conformational search isn't exhaustive. Ralf
Yes, in the end, I think it's a good idea to add a command like iotbx.pdb.expand_to_p1 (available in phenix. too) with a few popular options and the default behavior that would suit most popular one. Pavel On 11/3/11 4:02 PM, Nat Echols wrote:
Neither of these will work, for the reasons that were already stated - with sites_mod_positive=False, the symmetry mates do not necessarily end up with most atoms in the minimal unit cell with origin at 0,0,0, and with sites_mod_positive=True, all atoms are in the unit cell, but the protein chains are chopped up. Neither of these shows how the crystal is packed. Doing so requires sampling translations of the fractional coordinates.
On Thu, Nov 3, 2011 at 2:29 PM, Pavel Afonine
wrote: Hi Jessica,
try with sites_mod_positive=False (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.
Pavel
On 11/3/11 12:42 PM, Jessica Grant wrote:
Thanks everyone, for the input. I have written a little script using your help. Attached is an image -- the green is the output of my script, the blue is the original pdb file. code looks like this: from iotbx.file_reader import any_file import sys from mmtbx import utils
def run (args) : pdb_file = args[0] pdb_inp = any_file(pdb_file, force_type="pdb").file_object
xray = pdb_inp.xray_structure_simple() uc = xray.expand_to_p1(sites_mod_positive=True)
outfile = open("unit_cell.pdb", "w")
utils.write_pdb_file(xray_structure = uc, pdb_hierarchy = pdb_inp.construct_hierarchy(), out = outfile) if __name__ == "__main__" : run(sys.argv[1:])
It doesn't look like it is doing quite what I want. Oh...I just had the thought that perhaps I should apply the symmetry operators before using 'expand_to_P1'
Maybe? Jessica
1) isn't this a method of the X-ray structure object, not one of the PDB objects?
expand_to_p1 is a method from xray/structure.py. I just used it yesterday.
2) won't it split up molecules to keep the sites all inside the unit cell?
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. (I'd like to figure out something analogous to the 'symexp' function in PyMOL, but I think that's a little more work.)
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. Anyway, it's faster to try than typing this email: try both, save xray_structure as PDB file and open it in PyMol.
What is 'symexp' function in PyMOL ?
Pavel
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
participants (5)
-
Jan Marten Simons
-
Jessica Grant
-
Nat Echols
-
Pavel Afonine
-
Ralf Grosse-Kunstleve