Lattice options & changes of basis
Hi Folks, I have a very simple question which I *know* can be done with cctbx, using the Python API, but I cannot for the life of me figure out how to do it. I have even read the code, it's just not clear. I have a Bravais lattice and cell, say oP and 20, 30, 40, 90, 90, 90 - what I would like back is a list of pointgroup, cell, reindexing operation for all compatible unique settings i.e. 1 x P1, 3 x P2, 1 x P222 - from a Python loop. At the moment I run iotbx.lattice symmetry and grep the results, which is not a great idea. It would also be useful to give the reindex operations to centred lattices. I have also stared at phenix.explore_metric_symmetry and remain puzzled despite my attempt to essentially duplicate the code. I just can't get the reindex operation out. Has anyone some simple code to do this? I tried piggybacking on pointgroup tools but that did not lead to enlightenment. I suspect using elementary ish operations would be better... Thanks, Graeme Dr. Graeme Winter Senior Software Scientist Diamond Light Source +44 1235 778091 (work) +44 7786 662784 (work mobile) -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
On Mon, Sep 19, 2011 at 11:13 AM,
I have a Bravais lattice and cell, say oP and 20, 30, 40, 90, 90, 90 – what I would like back is a list of pointgroup, cell, reindexing operation for all compatible unique settings i.e. 1 x P1, 3 x P2, 1 x P222 – from a Python loop. At the moment I run iotbx.lattice symmetry and grep the results, which is not a great idea. It would also be useful to give the reindex operations to centred lattices.
+1 I've been wanting to add this to the Phenix GUI for a while - reindexing is non-trivial right now if you don't know the operations already. -Nat
Hi Graeme, try this:
from cctbx.sgtbx.lattice_symmetry import metric_subgroups
from cctbx import crystal
input_symmetry = crystal.symmetry(
unit_cell=(20, 30, 40, 90, 90, 90),
space_group_symbol="P222")
groups = metric_subgroups(input_symmetry=input_symmetry, max_delta=1.4)
groups.show()
for item in groups.result_groups:
print item['cb_op_inp_best'].as_hkl()
See also the implemenation of the .show() method
in cctbx/sgtbx/lattice_symmetry.py.
Ralf
On Mon, Sep 19, 2011 at 8:13 AM,
Hi Folks,****
** **
I have a very simple question which I **know** can be done with cctbx, using the Python API, but I cannot for the life of me figure out how to do it. I have even read the code, it’s just not clear.****
** **
I have a Bravais lattice and cell, say oP and 20, 30, 40, 90, 90, 90 – what I would like back is a list of pointgroup, cell, reindexing operation for all compatible unique settings i.e. 1 x P1, 3 x P2, 1 x P222 – from a Python loop. At the moment I run iotbx.lattice symmetry and grep the results, which is not a great idea. It would also be useful to give the reindex operations to centred lattices.****
** **
I have also stared at phenix.explore_metric_symmetry and remain puzzled despite my attempt to essentially duplicate the code. I just can’t get the reindex operation out.****
** **
Has anyone some simple code to do this?****
** **
I tried piggybacking on pointgroup tools but that did not lead to enlightenment. I suspect using elementary ish operations would be better…* ***
** **
Thanks,****
** **
Graeme****
** **
Dr. Graeme Winter****
Senior Software Scientist****
Diamond Light Source****
****
+44 1235 778091 (work)****
+44 7786 662784 (work mobile)****
****
** **
--
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
Hi Ralf,
Well that hit the spot - here's what I ended up with:
from cctbx.sgtbx.lattice_symmetry import metric_subgroups
from cctbx import crystal
input_symmetry = crystal.symmetry(
unit_cell=(20, 20, 20, 90, 90, 90),
space_group_symbol = "P23")
groups = metric_subgroups(input_symmetry=input_symmetry, max_delta = 0.0)
for item in groups.result_groups:
cell = item['ref_subsym'].unit_cell().parameters()
spacegroup_name = item['ref_subsym'].space_group().type(
).universal_hermann_mauguin_symbol()
reindex = item['cb_op_inp_best'].as_hkl()
print '%20s' % spacegroup_name, '%6.2f %6.2f %6.2f %6.2f %6.2f %6.2f' % \
cell, reindex
which works perfectly.
Many thanks,
Graeme
From: [email protected] [mailto:[email protected]] On Behalf Of Ralf Grosse-Kunstleve
Sent: 19 September 2011 17:23
To: cctbx mailing list
Subject: Re: [cctbxbb] Lattice options & changes of basis
Hi Graeme, try this:
from cctbx.sgtbx.lattice_symmetry import metric_subgroups
from cctbx import crystal
input_symmetry = crystal.symmetry(
unit_cell=(20, 30, 40, 90, 90, 90),
space_group_symbol="P222")
groups = metric_subgroups(input_symmetry=input_symmetry, max_delta=1.4)
groups.show()
for item in groups.result_groups:
print item['cb_op_inp_best'].as_hkl()
See also the implemenation of the .show() method in cctbx/sgtbx/lattice_symmetry.py.
Ralf
On Mon, Sep 19, 2011 at 8:13 AM,
participants (3)
-
Graeme.Winter@Diamond.ac.uk
-
Nat Echols
-
Ralf Grosse-Kunstleve