On Oct 17 2004, SourceForge.net wrote:

Bugs item #1048504, was opened at 2004-10-17 01:25 Message generated for change (Comment added) made by migueljmol You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=379133&aid=1048504&group_id=23629

Category: File Input/Output
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Miguel (migueljmol)
Summary: Jmol doesn't read CIF file

Initial Comment:
I tried opening a file Peter suggested from
http://journals.iucr.org/e/issues/2004/10/00/EAtxtisscontsbdy.html
(inorganic compounds-- Acta Cryst. (2004). E60, i120-i123)
(checkCIF/PLATON results: No syntax errors found)
But nonetheless, Jmol does not read

http://scripts.iucr.org/cgi-bin/sendcif?hb6095sup1

We have initially a problem identifying this as a CIF
file, because there are too many comments:

I think this is a valid CIF


FileManager.openFile(t.cif)
java.lang.ArrayIndexOutOfBoundsException: 2048
at org.jmol.adapter.smarter.LimitedLineReader.readLineWithNewline(ModelResolver.java:221)
at org.jmol.adapter.smarter.ModelResolver.determineModelReader(ModelResolver.java:70)
at
org.jmol.adapter.smarter.ModelResolver.resolveModel(ModelResolver.java:37)
at org.jmol.adapter.smarter.SmarterModelAdapter.openBufferedReader(SmarterModelAdapter.java:55)
at org.openscience.jmol.viewer.managers.FileManager$FileOpenThread.openReader(FileManager.java:409)
at org.openscience.jmol.viewer.managers.FileManager$FileOpenThread.openInputStream(FileManager.java:402)
at org.openscience.jmol.viewer.managers.FileManager$FileOpenThread.run(FileManager.java:379)
at org.openscience.jmol.viewer.managers.FileManager.openFile(FileManager.java:100)
at
org.openscience.jmol.viewer.JmolViewer.openFile(JmolViewer.java:945)
at
org.openscience.jmol.viewer.script.Eval.load(Eval.java:1606)
at org.openscience.jmol.viewer.script.Eval.instructionDispatchLoop(Eval.java:348)
at
org.openscience.jmol.viewer.script.Eval.run(Eval.java:290)
at java.lang.Thread.run(Unknown Source)


error opening file:/D:/js/jmol/docs/examples/t.cif
java.lang.ArrayIndexOutOfBoundsException: 2048

----------------------
after removal of 4 top header lines we have a
successful identification but still can't read data:

FileManager.openFile(t.cif)
SmarterModelAdapter:The model resolver thinks:Cif

java.lang.NullPointerException
at
org.jmol.adapter.smarter.ModelReader.parseFloat(ModelReader.java:45)
at org.jmol.adapter.smarter.CifReader.processAtomSiteLoopBlock(CifReader.java:306)
at
org.jmol.adapter.smarter.CifReader.processLoopBlock(CifReader.java:144)
at
org.jmol.adapter.smarter.CifReader.readModel(CifReader.java:65)
at
org.jmol.adapter.smarter.ModelResolver.resolveModel(ModelResolver.java:57)
at org.jmol.adapter.smarter.SmarterModelAdapter.openBufferedReader(SmarterModelAdapter.java:55)
at org.openscience.jmol.viewer.managers.FileManager$FileOpenThread.openReader(FileManager.java:409)
at org.openscience.jmol.viewer.managers.FileManager$FileOpenThread.openInputStream(FileManager.java:402)
at org.openscience.jmol.viewer.managers.FileManager$FileOpenThread.run(FileManager.java:379)
at org.openscience.jmol.viewer.managers.FileManager.openFile(FileManager.java:100)
at
org.openscience.jmol.viewer.JmolViewer.openFile(JmolViewer.java:945)
at
org.openscience.jmol.viewer.script.Eval.load(Eval.java:1606)
at org.openscience.jmol.viewer.script.Eval.instructionDispatchLoop(Eval.java:348)
at
org.openscience.jmol.viewer.script.Eval.run(Eval.java:290)
at java.lang.Thread.run(Unknown Source)


error opening file:/D:/js/jmol/docs/examples/t.cif


-------------------------------------- after adding #END in atom block loop, we have a successful read:

FileManager.openFile(t.cif)
SmarterModelAdapter:The model resolver thinks:Cif
openFile(t.cif) 0 ms

[model displays properly]

This #END is at:

loop_
    _atom_site_label
    _atom_site_fract_x
    _atom_site_fract_y
    _atom_site_fract_z
    _atom_site_U_iso_or_equiv
    _atom_site_adp_type
    _atom_site_calc_flag
    _atom_site_refinement_flags
    _atom_site_occupancy
    _atom_site_disorder_assembly
    _atom_site_disorder_group
    _atom_site_type_symbol
    Sr 0.3333 0.6667 0.1667 0.0145(3) Uani d S 1 . . Sr
    N 0.0000 0.0000 0.0820(3) 0.0182(10) Uani d S 1 . . N
    C 0.0000 0.0000 0.0000 0.0126(14) Uani d S 1 . . C
#END

this is NOT a keyword in CIF. There is no endLoop token. A loop is ended either by the end of file or by a loop_ or data_ or _foo. The only way to read CIFs reliably is to read the CIF spec and implement it! There are no half measures - it will break somewhere else. It is like trying to write an XML reader on the assumption there is a newline after every tag. CIF, like XML need not have any newlines at all


P.


loop_
    _atom_site_aniso_label
    _atom_site_aniso_U_11
    _atom_site_aniso_U_22
    _atom_site_aniso_U_33
    _atom_site_aniso_U_12
    _atom_site_aniso_U_13
    _atom_site_aniso_U_23
    Sr 0.0131(3) 0.0131(3) 0.0172(4) 0.00654(15) 0.000
0.000
    N 0.0179(16) 0.0179(16) 0.019(2) 0.0089(8) 0.000 0.000
    C 0.009(2) 0.009(2) 0.020(4) 0.0044(10) 0.000 0.000
_geom_special_details

P.



Bob Hanson





----------------------------------------------------------------------

>Comment By: Miguel (migueljmol)
Date: 2004-10-17 16:47

Message:
Logged In: YES user_id=1050060


OK, the 'lots of comments' problem was certainly my bug. It
is now fixed.


It is not clear to me that this is a valid .cif file. There
is no clear indication of loop_ termination. I will post a
message for Peter.


Miguel


----------------------------------------------------------------------

You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=379133&aid=1048504&group_id=23629


------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Jmol-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jmol-developers


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to