[cctbxbb] How to load a structure from a .cif file?
rgildea at gmail.com
Sat Dec 11 05:16:37 PST 2010
This should be fairly straightforward:
from cctbx import xray
xs = xray.structure.from_cif(file_path="my.cif")
This will return you an instance of xray.structure. If you have more than
one data block in your cif, you can specify which structure you want to
extract using the block_heading keyword (by default it just returns the
first structure it can successfully extract from the cif). There is also
similar functionality that can be used to extract miller arrays from fcf or
Please let me know if you have any further questions about this.
2010/12/10 Jan Marten Simons <marten at xtal.rwth-aachen.de>
> I've just started to work up some code for my phd. I've found cctbx to be
> quite a nice code base for my goals. So far I've seen that there is quite a
> large ammount of functions implemented, but in my opinion documentation on
> to use them is either hidden or not in very verbose state.
> So from looking at the source I'm pretty confident that cctbx can load a
> crystalstructure from a .cif file (like those obtained from COD,
> http://www.crystallography.net/). But so far I've not been able to figure
> how to do this. My experiments included:
> from iotbx import crystal_symmetry_from_any as sym_from_any
> from iotbx import file_reader
> file_name = "./xtal_data/9008806.cif"
> structure = file_reader.any_file(file_name) #gives an object, but not a
> # or
> structure = sym_from_any.extract_from(file_name) # returns none
> Could you give me a hint into the right direction, please?
> With regards,
> Jan Simons
> cctbxbb mailing list
> cctbxbb at phenix-online.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cctbxbb