Hi Jan,

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 hkl formats.

Please let me know if you have any further questions about this.

Cheers,

Richard

2010/12/10 Jan Marten Simons <marten@xtal.rwth-aachen.de>
Hi,

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 how
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 out
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 structure
# or
structure = sym_from_any.extract_from(file_name) # returns none

print(str(structure))

structure.show_summary().show_scatterers()


Could you give me a hint into the right direction, please?

With regards,

Jan Simons
_______________________________________________
cctbxbb mailing list
cctbxbb@phenix-online.org
http://phenix-online.org/mailman/listinfo/cctbxbb