<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div>Hi Jan,</div><div><br></div><div>This should be fairly straightforward:</div><div><br></div><div>from cctbx import xray</div>
<div><br></div><div>xs = xray.structure.from_cif(file_path=&quot;my.cif&quot;)</div><div><br></div><div>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.</div>
<div><br></div><div>Please let me know if you have any further questions about this.</div><div><br></div><div>Cheers,</div><div><br></div><div>Richard</div></span><br><div class="gmail_quote">2010/12/10 Jan Marten Simons <span dir="ltr">&lt;<a href="mailto:marten@xtal.rwth-aachen.de">marten@xtal.rwth-aachen.de</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
I&#39;ve just started to work up some code for my phd. I&#39;ve found cctbx to be<br>
quite a nice code base for my goals. So far I&#39;ve seen that there is quite a<br>
large ammount of functions implemented, but in my opinion documentation on how<br>
to use them is either hidden or not in very verbose state.<br>
<br>
So from looking at the source I&#39;m pretty confident that cctbx can load a<br>
crystalstructure from a .cif file (like those obtained from COD,<br>
<a href="http://www.crystallography.net/" target="_blank">http://www.crystallography.net/</a>). But so far I&#39;ve not been able to figure out<br>
how to do this. My experiments included:<br>
<br>
from iotbx import crystal_symmetry_from_any as sym_from_any<br>
from iotbx import file_reader<br>
<br>
file_name = &quot;./xtal_data/9008806.cif&quot;<br>
structure = file_reader.any_file(file_name) #gives an object, but not a structure<br>
# or<br>
structure = sym_from_any.extract_from(file_name) # returns none<br>
<br>
print(str(structure))<br>
<br>
structure.show_summary().show_scatterers()<br>
<br>
<br>
Could you give me a hint into the right direction, please?<br>
<br>
With regards,<br>
<br>
Jan Simons<br>
_______________________________________________<br>
cctbxbb mailing list<br>
<a href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a><br>
<a href="http://phenix-online.org/mailman/listinfo/cctbxbb" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
</blockquote></div><br>