Invert hand of shelxd res file from cctbx
Hi Folks, This should be easy but I can't find anything! I have a .res file: [gw56@ws050 fast_ep]$ cat sad_fa.res REM Best SHELXD solution: CC 41.11 CC(weak) 23.51 CFOM 64.62 REM TITL sad_fa.ins SAD in P422 CELL 0.98000 78.17 78.17 37.87 90.00 90.00 90.00 LATT -1 SYMM -Y+1/2,X+1/2,Z+1/4 SYMM -X,-Y,Z+1/2 SYMM Y+1/2,-X+1/2,Z+3/4 SYMM X+1/2,-Y+1/2,-Z+3/4 SYMM Y,X,-Z SYMM -X+1/2,Y+1/2,-Z+1/4 SYMM -Y,-X,-Z+1/2 SFAC SE UNIT 256 SE01 1 0.600227 0.892868 0.042187 1.0000 0.2 SE02 1 0.627518 0.852661 0.427392 0.8667 0.2 SE03 1 0.867409 0.911667 0.394418 0.8420 0.2 SE04 1 0.489761 0.805634 0.391009 0.7279 0.2 SE05 1 0.642792 0.649048 0.369694 0.7172 0.2 SE06 1 0.678879 0.535027 0.477918 0.4571 0.2 SE07 1 0.609207 0.572754 0.421746 0.4212 0.2 SE08 1 0.584526 0.536499 0.322047 0.4154 0.2 SE09 1 0.843063 0.846794 0.480296 0.3831 0.2 SE10 1 0.622429 0.743332 0.157899 0.3604 0.2 SE11 1 0.626114 0.528595 0.644789 0.3590 0.2 HKLF 3 END which I would like to read, invert the hand of and write as a pdb file. I got stuck trying to work through the example / test code. Can someone point me in the right direction? Thanks, Graeme -- 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
Hi Graeme,
This should be easy but I can’t find anything!
I have a .res file:
[...]
which I would like to read, invert the hand of and write as a pdb file. I got stuck trying to work through the example / test code. Can someone point me in the right direction?
from cctbx import xray from cStringIO import StringIO res= """ REM Best SHELXD solution: CC 41.11 CC(weak) 23.51 CFOM 64.62 REM TITL sad_fa.ins SAD in P422 CELL 0.98000 78.17 78.17 37.87 90.00 90.00 90.00 LATT -1 SYMM -Y+1/2,X+1/2,Z+1/4 SYMM -X,-Y,Z+1/2 SYMM Y+1/2,-X+1/2,Z+3/4 SYMM X+1/2,-Y+1/2,-Z+3/4 SYMM Y,X,-Z SYMM -X+1/2,Y+1/2,-Z+1/4 SYMM -Y,-X,-Z+1/2 SFAC SE UNIT 256 SE01 1 0.600227 0.892868 0.042187 1.0000 0.2 SE02 1 0.627518 0.852661 0.427392 0.8667 0.2 SE03 1 0.867409 0.911667 0.394418 0.8420 0.2 SE04 1 0.489761 0.805634 0.391009 0.7279 0.2 SE05 1 0.642792 0.649048 0.369694 0.7172 0.2 SE06 1 0.678879 0.535027 0.477918 0.4571 0.2 SE07 1 0.609207 0.572754 0.421746 0.4212 0.2 SE08 1 0.584526 0.536499 0.322047 0.4154 0.2 SE09 1 0.843063 0.846794 0.480296 0.3831 0.2 SE10 1 0.622429 0.743332 0.157899 0.3604 0.2 SE11 1 0.626114 0.528595 0.644789 0.3590 0.2 HKLF 3 END """ xs = xray.structure.from_shelx(file=StringIO(res)) # replace "file" by "filename" here to load from disk xs_other_hand = xs.change_hand() print xs.as_pdb_file()
Thank you to Oleg and Luc for sending the solutions, they were as simple as I thought they should be :o) Cheerio, Graeme From: [email protected] [mailto:[email protected]] On Behalf Of Luc Bourhis Sent: 30 May 2012 13:07 To: cctbx mailing list Subject: Re: [cctbxbb] Invert hand of shelxd res file from cctbx Hi Graeme, This should be easy but I can't find anything! I have a .res file: [...] which I would like to read, invert the hand of and write as a pdb file. I got stuck trying to work through the example / test code. Can someone point me in the right direction? from cctbx import xray from cStringIO import StringIO res= """ REM Best SHELXD solution: CC 41.11 CC(weak) 23.51 CFOM 64.62 REM TITL sad_fa.ins SAD in P422 CELL 0.98000 78.17 78.17 37.87 90.00 90.00 90.00 LATT -1 SYMM -Y+1/2,X+1/2,Z+1/4 SYMM -X,-Y,Z+1/2 SYMM Y+1/2,-X+1/2,Z+3/4 SYMM X+1/2,-Y+1/2,-Z+3/4 SYMM Y,X,-Z SYMM -X+1/2,Y+1/2,-Z+1/4 SYMM -Y,-X,-Z+1/2 SFAC SE UNIT 256 SE01 1 0.600227 0.892868 0.042187 1.0000 0.2 SE02 1 0.627518 0.852661 0.427392 0.8667 0.2 SE03 1 0.867409 0.911667 0.394418 0.8420 0.2 SE04 1 0.489761 0.805634 0.391009 0.7279 0.2 SE05 1 0.642792 0.649048 0.369694 0.7172 0.2 SE06 1 0.678879 0.535027 0.477918 0.4571 0.2 SE07 1 0.609207 0.572754 0.421746 0.4212 0.2 SE08 1 0.584526 0.536499 0.322047 0.4154 0.2 SE09 1 0.843063 0.846794 0.480296 0.3831 0.2 SE10 1 0.622429 0.743332 0.157899 0.3604 0.2 SE11 1 0.626114 0.528595 0.644789 0.3590 0.2 HKLF 3 END """ xs = xray.structure.from_shelx(file=StringIO(res)) # replace "file" by "filename" here to load from disk xs_other_hand = xs.change_hand() print xs.as_pdb_file() -- 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
Sent from my iPhone
On May 30, 2012, at 5:37 AM,
Thank you to Oleg and Luc for sending the solutions, they were as simple as I thought they should be :o)
Cheerio,
Graeme
From: [email protected] [mailto:[email protected]] On Behalf Of Luc Bourhis Sent: 30 May 2012 13:07 To: cctbx mailing list Subject: Re: [cctbxbb] Invert hand of shelxd res file from cctbx
Hi Graeme,
This should be easy but I can’t find anything!
I have a .res file:
[...]
which I would like to read, invert the hand of and write as a pdb file. I got stuck trying to work through the example / test code. Can someone point me in the right direction?
from cctbx import xray from cStringIO import StringIO
res= """ REM Best SHELXD solution: CC 41.11 CC(weak) 23.51 CFOM 64.62 REM TITL sad_fa.ins SAD in P422 CELL 0.98000 78.17 78.17 37.87 90.00 90.00 90.00 LATT -1 SYMM -Y+1/2,X+1/2,Z+1/4 SYMM -X,-Y,Z+1/2 SYMM Y+1/2,-X+1/2,Z+3/4 SYMM X+1/2,-Y+1/2,-Z+3/4 SYMM Y,X,-Z SYMM -X+1/2,Y+1/2,-Z+1/4 SYMM -Y,-X,-Z+1/2 SFAC SE UNIT 256 SE01 1 0.600227 0.892868 0.042187 1.0000 0.2 SE02 1 0.627518 0.852661 0.427392 0.8667 0.2 SE03 1 0.867409 0.911667 0.394418 0.8420 0.2 SE04 1 0.489761 0.805634 0.391009 0.7279 0.2 SE05 1 0.642792 0.649048 0.369694 0.7172 0.2 SE06 1 0.678879 0.535027 0.477918 0.4571 0.2 SE07 1 0.609207 0.572754 0.421746 0.4212 0.2 SE08 1 0.584526 0.536499 0.322047 0.4154 0.2 SE09 1 0.843063 0.846794 0.480296 0.3831 0.2 SE10 1 0.622429 0.743332 0.157899 0.3604 0.2 SE11 1 0.626114 0.528595 0.644789 0.3590 0.2 HKLF 3 END """ xs = xray.structure.from_shelx(file=StringIO(res)) # replace "file" by "filename" here to load from disk xs_other_hand = xs.change_hand() print xs.as_pdb_file()
--
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 Graeme, I am not sure where you got stuck, but this will work for you: ##############################from cctbx import xrayf = xray.structure.from_shelx(filename="e:/graeme.ins")out = open("e:/gareme.pdb", "w+")print >> out, f.change_hand().as_pdb_file(fractional_coordinates=True)out.close()##################################### Cheers, OlegFrom: [email protected] To: [email protected] Date: Wed, 30 May 2012 10:18:29 +0000 Subject: [cctbxbb] Invert hand of shelxd res file from cctbx Hi Folks, This should be easy but I can’t find anything! I have a .res file: [gw56@ws050 fast_ep]$ cat sad_fa.res REM Best SHELXD solution: CC 41.11 CC(weak) 23.51 CFOM 64.62 REM TITL sad_fa.ins SAD in P422 CELL 0.98000 78.17 78.17 37.87 90.00 90.00 90.00 LATT -1 SYMM -Y+1/2,X+1/2,Z+1/4 SYMM -X,-Y,Z+1/2 SYMM Y+1/2,-X+1/2,Z+3/4 SYMM X+1/2,-Y+1/2,-Z+3/4 SYMM Y,X,-Z SYMM -X+1/2,Y+1/2,-Z+1/4 SYMM -Y,-X,-Z+1/2 SFAC SE UNIT 256 SE01 1 0.600227 0.892868 0.042187 1.0000 0.2 SE02 1 0.627518 0.852661 0.427392 0.8667 0.2 SE03 1 0.867409 0.911667 0.394418 0.8420 0.2 SE04 1 0.489761 0.805634 0.391009 0.7279 0.2 SE05 1 0.642792 0.649048 0.369694 0.7172 0.2 SE06 1 0.678879 0.535027 0.477918 0.4571 0.2 SE07 1 0.609207 0.572754 0.421746 0.4212 0.2 SE08 1 0.584526 0.536499 0.322047 0.4154 0.2 SE09 1 0.843063 0.846794 0.480296 0.3831 0.2 SE10 1 0.622429 0.743332 0.157899 0.3604 0.2 SE11 1 0.626114 0.528595 0.644789 0.3590 0.2 HKLF 3 END which I would like to read, invert the hand of and write as a pdb file. I got stuck trying to work through the example / test code. Can someone point me in the right direction? Thanks, Graeme -- 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
participants (4)
-
Graeme.Winter@diamond.ac.uk
-
Luc Bourhis
-
Oleg Dolomanov
-
Phzwart