Hi Jan,<div><br></div><div>Thanks for pointing out the problem. There is a fix now on the svn, so you can either grab the updates off sourceforge, or for now just comment out (with a #) the offending line (43, beginning _[local]), since this line is of no use (to the cctbx) anyway.</div>
<div><br></div><div>Cheers,</div><div><br></div><div>Richard</div><div><br><div class="gmail_quote">2010/12/14 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;">Am Samstag 11 Dezember 2010 14:16:37 schrieb Richard Gildea:<br>
&gt; Hi Jan,<br>
&gt;<br>
&gt; This should be fairly straightforward:<br>
&gt;<br>
&gt; from cctbx import xray<br>
&gt;<br>
&gt; xs = xray.structure.from_cif(file_path=&quot;my.cif&quot;)<br>
&gt;<br>
&gt; This will return you an instance of xray.structure. If you have more than<br>
&gt; one data block in your cif, you can specify which structure you want to<br>
&gt; extract using the block_heading keyword (by default it just returns the<br>
&gt; first structure it can successfully extract from the cif). There is also<br>
&gt; similar functionality that can be used to extract miller arrays from fcf or<br>
&gt; hkl formats.<br>
<br>
Ok, my code is now like this:<br>
file_name = &quot;./xtal_data/9008806.cif&quot;<br>
#file_name = &quot;./xtal_data/9010017.cif&quot;<br>
structure = xray.structure.from_cif(file_path=file_name)<br>
print(str(structure))<br>
structure.show_summary().show_scatterers()<br>
<br>
&gt; Please let me know if you have any further questions about this.<br>
<br>
I&#39;ve tested it with 2 cif files chosen at will from COD:<br>
<br>
* <a href="http://www.crystallography.net/cif/9/9010017.cif" target="_blank">http://www.crystallography.net/cif/9/9010017.cif</a><br>
works like expected.<br>
<br>
* <a href="http://www.crystallography.net/cif/9/9008806.cif" target="_blank">http://www.crystallography.net/cif/9/9008806.cif</a><br>
gives an error:<br>
<br>
&quot;<br>
./xtal_data/9008806.cif(43)  : error 3 : ()* loopback of 150:8: ( ( WHITESPACE<br>
)+ ( data_items | save_frame ) )*, at offset 0<br>
    near _<br>
     : cannot match to any predicted input...<br>
<br>
Traceback (most recent call last):<br>
  File &quot;Check_F_calc.py2&quot;, line 12, in &lt;module&gt;<br>
    structure = xray.structure.from_cif(file_path=file_name)<br>
  File &quot;/home/marten/Arbeit/cctbx-<br>
latest/cctbx_sources/cctbx/xray/structure.py&quot;, line 1366, in from_cif<br>
    data_structure_builder=builders.crystal_structure_builder).structure<br>
AttributeError: &#39;NoneType&#39; object has no attribute &#39;structure&#39;<br>
&quot;<br>
<br>
This either suggests an error in the .cif file or in the cif file parser of<br>
cctbx. From taking a look at both cif files I&#39;m not sure why it breaks on the<br>
2nd one.<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></div>