[cctbxbb] Reducing coordinates to asymmetric unit

Graeme.Winter at Diamond.ac.uk Graeme.Winter at Diamond.ac.uk
Thu Feb 11 06:14:12 PST 2010


Hi Richard,

Many thanks for the pointers - I have managed to do exactly what I wanted (I think) with:

ds = cs.direct_space_asu()
sg = cs.space_group()
am = crystal.direct_space_asu.asu_mappings(
    space_group = cs.space_group(),
    asu = ds.as_float_asu(),
    buffer_thickness = 0.0)

fsites = [cs.unit_cell().fractionalize(site) for site in sites]

for fsite in fsites:
    am.process(fsite)

asu_sites = [cs.unit_cell().fractionalize(m[0].mapped_site()) \
             for m in am.mappings()]

for msite in asu_sites:
    print '%.3f %.3f %.3f' % msite

In case it is of any use to anyone! There are a couple of mysteries left here which don't make complete sense to me (why I can't process a list of coordinates, but have to pass them in one-at-a-time then gather them all together) - also why this takes frac coordinates and gives back cart. coordinates - though it's quite likely I am incorrect on both counts...!

Thanks for your help though, and for all the great code in cctbx,

Graeme


-----Original Message-----
From: cctbxbb-bounces at phenix-online.org on behalf of Richard Gildea
Sent: Thu 2/11/2010 12:59 PM
To: cctbx mailing list
Subject: Re: [cctbxbb] Reducing coordinates to asymmetric unit
 
Hi Graeme,

I think what you need are the direct space asu mappings tools - see
cctbx/crystal/tst_ext.py or cctbx/regression/tst_direct_space_asu.py if you
want to look at more of the tools that are available there.

If I understand correctly, something along the lines of this should do what
you want:

    asu_mappings = xs.asu_mappings(buffer_thickness=0)
    xs_asu = xs.deep_copy_scatterers()
    frac = xs.unit_cell().fractionalize
    for i, mappings in enumerate(asu_mappings.mappings()):
      xs_asu.scatterers()[i].site = frac(mappings[0].mapped_site())
    for sc in xs_asu.scatterers():
      assert asu_mappings.asu().is_inside(sc.site)

Hope that helps,

Richard

On 11 February 2010 11:45, <Graeme.Winter at diamond.ac.uk> wrote:

>  Hi Folks,
>
> Does anyone have a handy bit of CCTBX Python code which will take a
> spacegroup and unit cell, and a list of coordinates, and return the list of
> coordinates reduced to the asymmetric unit? I tried the "dumb" approach of:
>
> use unit cell and sites -> fractional sites
>
> for site in fractional sites:
>   for smx in sg.smx()
>     for ltr in sg.ltr()
>       apply smx, ltr
>       is in asu? return
>
> and it did not always return an answer, so there's clearly somthing I don't
> understand. Fractional coordinates are all in [0,1).
>
> I'm sure someone must have done this!
>
> Thanks in advance,
>
> Graeme
>
> Graeme Winter
> Software and MX Support 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
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb
>
>






-- 

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

 







-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 4854 bytes
Desc: not available
URL: <http://phenix-online.org/pipermail/cctbxbb/attachments/20100211/75f1b796/attachment-0001.bin>


More information about the cctbxbb mailing list