Issue loading CIF file with Crystal Toolkit

Hello
I have tried to upload a .cif-File. Only an error message appeared:

“Could not parse uploaded file. If this seems like a bug, please report it. Crystal Toolkit understands all crystal structure file types and molecule file types supported by pymatgen.”

How can I upload a .cif-File?

Thanks in advance

Hi @Leonie,

Could you share your CIF file here so we can diagnose? Thanks!

Matt

Hi @mkhorton
I have tried two different structures

First structure:

# CIF file generated by openbabel 3.0.0, see http://openbabel.sf.net
data_I
_chemical_name_common ''
loop_
    _atom_site_label
    _atom_site_type_symbol
    _atom_site_fract_x
    _atom_site_fract_y
    _atom_site_fract_z
    _atom_site_occupancy
    Mg0     Mg   -2.01731   1.58051   0.28654   1.000
    O1      O    -1.73276  -0.11750   1.55691   1.000
    C2      C    -2.16639  -1.36746   1.05232   1.000
    C3      C    -2.05791  -0.06401   2.93956   1.000
    O4      O    -0.77788   0.64712  -1.14983   1.000
    C5      C    0.35636  -0.08425  -0.71608   1.000
    C6      C    -0.60951   1.13651  -2.47069   1.000
    O7      O    -0.34605   2.54724   1.16292   1.000
    C8      C    0.89368   2.67616   0.49477   1.000
    C9      C    -0.13123   2.47580   2.55657   1.000
    O10     O    -2.29179   3.29541  -0.94726   1.000
    C11     C    -1.44592   4.42870  -0.85050   1.000
    C12     C    -2.90870   3.27181  -2.22173   1.000
    O13     O    -3.22545   2.47071   1.76788   1.000
    C14     C    -3.40213   3.87290   1.74131   1.000
    C15     C    -4.41092   1.82555   2.20126   1.000
    O16     O    -3.71877   0.63918  -0.58631   1.000
    C17     C    -3.59762  -0.32918  -1.61826   1.000
    C18     C    -4.92140   1.37579  -0.75274   1.000
    H19     H    -2.11700   0.96439   3.30879   1.000
    H20     H    -1.25601  -0.56018   3.52702   1.000
    H21     H    -3.04311  -0.52512   3.18341   1.000
    H22     H    -1.63952  -1.61089   0.11868   1.000
    H23     H    -3.26786  -1.38939   0.91677   1.000
    H24     H    -1.86535  -2.20547   1.72324   1.000
    H25     H    0.17804   0.59204  -3.04200   1.000
    H26     H    -0.33238   2.20471  -2.47521   1.000
    H27     H    -1.52251   0.94969  -3.06200   1.000
    H28     H    0.38569  -0.12717   0.38781   1.000
    H29     H    1.31623   0.38265  -1.03125   1.000
    H30     H    0.30406  -1.12547  -1.09831   1.000
    H31     H    0.63680   3.20835   2.89623   1.000
    H32     H    -1.03594   2.81449   3.09247   1.000
    H33     H    0.18688   1.45632   2.85736   1.000
    H34     H    0.74828   2.64901  -0.59301   1.000
    H35     H    1.61310   1.88001   0.78689   1.000
    H36     H    1.33068   3.67951   0.69191   1.000
    H37     H    -2.01589   5.36043  -1.06546   1.000
    H38     H    -0.56951   4.34745  -1.52707   1.000
    H39     H    -1.08320   4.57539   0.17706   1.000
    H40     H    -3.19583   2.25485  -2.49596   1.000
    H41     H    -3.82710   3.89624  -2.20929   1.000
    H42     H    -2.22858   3.59713  -3.04223   1.000
    H43     H    -3.89757   4.20328   0.80609   1.000
    H44     H    -3.99601   4.23093   2.61369   1.000
    H45     H    -2.42569   4.36906   1.87912   1.000
    H46     H    -5.73772   0.90228  -0.16853   1.000
    H47     H    -4.77829   2.41253  -0.40635   1.000
    H48     H    -5.25388   1.48195  -1.81047   1.000
    H49     H    -3.72847   0.09288  -2.63733   1.000
    H50     H    -2.60688  -0.80116  -1.61695   1.000
    H51     H    -4.32584  -1.15113  -1.44745   1.000
    H52     H    -4.42028   0.77663   1.85398   1.000
    H53     H    -5.33912   2.30814   1.82034   1.000
    H54     H    -4.43750   1.80099   3.31133   1.000

Second structure:

# CIF file generated by openbabel 3.0.0, see http://openbabel.sf.net
data_I
_chemical_name_common ''
loop_
    _atom_site_label
    _atom_site_type_symbol
    _atom_site_fract_x
    _atom_site_fract_y
    _atom_site_fract_z
    _atom_site_occupancy
    B0      B    -2.58909  -0.51262   0.21715   1.000
    O1      O    -1.17512  -0.60759   0.74738   1.000
    O2      O    -2.65235   0.09453  -1.16859   1.000
    O3      O    -3.40805   0.27028   1.20719   1.000
    C4      C    -3.60634  -0.38611   2.45352   1.000
    C5      C    -0.17464   0.14919   0.07845   1.000
    C6      C    -3.44705   1.26171  -1.32711   1.000
    O7      O    -3.16401  -1.89448   0.12086   1.000
    C8      C    -2.39253  -2.79362  -0.66161   1.000
    C9      C    -2.80918   2.11885  -2.43683   1.000
    H10     H    -3.43882   1.91087  -0.42411   1.000
    C11     C    -4.90531   0.88132  -1.67110   1.000
    C12     C    1.12494  -0.67814   0.07498   1.000
    C13     C    0.02060   1.51191   0.77609   1.000
    H14     H    -0.39917   0.32351  -0.99404   1.000
    C15     C    -3.28647  -3.36406  -1.77645   1.000
    C16     C    -1.83199  -3.89648   0.25732   1.000
    H17     H    -1.52791  -2.30903  -1.17452   1.000
    C18     C    -5.08791  -0.79864   2.58083   1.000
    C19     C    -3.17989   0.56986   3.58168   1.000
    H20     H    -2.98526  -1.30739   2.57450   1.000
    F21     F    -5.91110   0.30922   2.48033   1.000
    F22     F    -5.31679  -1.42111   3.79504   1.000
    F23     F    -5.42307  -1.68600   1.57562   1.000
    F24     F    -3.91108   1.74372   3.53012   1.000
    F25     F    -1.84173   0.87892   3.44432   1.000
    F26     F    -3.36078  -0.02171   4.81933   1.000
    F27     F    -2.86117  -4.57373   0.88757   1.000
    F28     F    -1.02126  -3.33422   1.22586   1.000
    F29     F    -1.07639  -4.79860  -0.47021   1.000
    F30     F    -4.38629  -4.00950  -1.23885   1.000
    F31     F    -2.57782  -4.25569  -2.56206   1.000
    F32     F    -3.73084  -2.33443  -2.58368   1.000
    F33     F    1.52629  -0.96397   1.36827   1.000
    F34     F    2.13901   0.00639  -0.57150   1.000
    F35     F    0.91618  -1.87093  -0.59233   1.000
    F36     F    0.42086   1.33662   2.08815   1.000
    F37     F    -1.16188   2.22595   0.76825   1.000
    F38     F    0.97927   2.25884   0.11494   1.000
    F39     F    -4.95455   0.13893  -2.83693   1.000
    F40     F    -5.67507   2.01928  -1.83357   1.000
    F41     F    -5.46123   0.13256  -0.65218   1.000
    F42     F    -1.51812   2.45985  -2.07790   1.000
    F43     F    -3.52703   3.28636  -2.62747   1.000
    F44     F    -2.76173   1.41796  -3.62927   1.000

Thanks for your help

Leonie

Thanks @Leonie, I’ll look into it. Just taking a quick glance I suspect the issue is that these CIF files do not contain any information about the crystal lattice, so may be out of spec. Whether in spec or not, this would be the reason pymatgen is failing to parse them. In general, CIF files are meant to store crystallographic information (the ‘C’ in CIF), and I haven’t seen them storing just isolated molecules previously. It could be that this is completely valid and we just need to fix the pymatgen implementation. You could also try exporting as .xyz

Thanks for the answer!
I’ve tried to upload the .xyz file. It worked but the preview of the material looks not identical to the created file.
The file was original created with Avogadro and exported from a cml-file to a .xyz-file.


That’s the preview from the web app


That’s the created molecule ( blue = F, grey = C, red = O, pink = B)

Why ist there such a big difference between the two molecules?

Hi @Leonie,

The difference is due to a bug in the bonding algorithm for molecules (which has been fixed but not deployed to the website yet).

Note that the atomic positions are correct and the same between both. The xyz file does not contain information on which atoms are bonded to which other atoms, so we have to work that out. There are many algorithms in pymatgen which try to answer the question of if two atoms are bonded. Unfortunately, the ones for molecules had a bug where atom labels were permuted leading to the wacky bonds shown. As mentioned, this has been fixed in pymatgen, and will be fixed on the next update to the website too.

Best,

Matt