snurr-group / mofid

A system for rapid identification and analysis of metal-organic frameworks
https://snurr-group.github.io/mofid/
GNU General Public License v2.0
42 stars 24 forks source link

Rare AssertionError in Python interface #24

Closed Andrew-S-Rosen closed 4 years ago

Andrew-S-Rosen commented 4 years ago

The Python interface crashes for the following CIF: mof.txt. The web interface works fine. Need to fix assertion statement.

Traceback:

==============================
*** Open Babel Error  in WriteSystre
  Found two neighboring 2-c sites.  Flagging the cgd output to get an error instead of the incorrect topology.
Note: Rerun ExportSystre() with simplify_two_conn=false if an unsimplified net is useful.
==============================
*** Open Babel Error  in WriteSystre
  Found two neighboring 2-c sites.  Flagging the cgd output to get an error instead of the incorrect topology.
Note: Rerun ExportSystre() with simplify_two_conn=false if an unsimplified net is useful.
Traceback (most recent call last):
  File "test.py", line 3, in <module>
    mofid = cif2mofid(cif_path)
  File "C:\Users\asros\Anaconda3\lib\site-packages\mofid\run_mofid.py", line 24, in cif2mofid
    'SingleNode','topology.cgd'))
  File "C:\Users\asros\Anaconda3\lib\site-packages\mofid\id_constructor.py", line 134, in extract_topology
    assert line[-2] == str(current_component)
AssertionError
YOUNG-JAME commented 3 months ago

Open Babel Error in WriteSystre Found two neighboring 2-c sites. Flagging the cgd output to get an error instead of the incorrect topology. Note: Rerun ExportSystre() with simplify_two_conn=false if an unsimplified net is useful. —————————————————————————————————————————————————— Can you tell me what this error means in terms of molecular structure? Is there any solution?

bbucior commented 3 months ago

For this structure, MOFid ran into an unexpected topology when attempting to deconstruct it into building blocks. It's been awhile since working with the code, but my guess would be either (a) something with assigning bond lengths, (b) a metal note connecting to two points instead of more (e.g., if you had a copper paddlewheel with only two points of contact instead of four, then an organic linker only connected to the paddlewheel and one other component), or (c) a structure that the code is not yet able to process correctly.

My main advice for debugging would be visualizing the generated CIFs in the Output/ directory (specifically Output/SingleNode and Output/AllNode), either in your favorite visualization tool or the web-mofid UI. I used to flip between the Nodes + Linkers and the Simplified Topology views to see how the MOFid code was interpreting the structure and understand what chemistry was leading to the code assigning a pair of 2-coordinated neighbors.

YOUNG-JAME commented 3 months ago

Subject: Request for Further Guidance on Molecular Topology and MOFID Conversion Issues

Dear Ben Bucior,

First and foremost, I would like to extend my heartfelt thanks for your valuable guidance.

Based on your advice, it seems that when such issues arise with topology, it is necessary to visualize the molecule to determine its topological structure manually. Is that correct? In situations where we encounter this problem, is it generally impossible to resolve it purely through code, thus requiring human judgment?

Also, I have another question that I hope you can help me with if you don't mind. During the conversion of MOFID, I encounter cases resulting in && NA.NA. Upon reviewing the source code, I found that this issue arises during the extract_fragments process, where information extraction fails. This occurs specifically within the cpp file. I really hope you can give me some insight into the underlying chemical principles causing the &&NA.NA issue and suggest any potential improvements from a molecular structure perspective.

My research focuses on data-driven materials design. Firstly, my understanding of molecular structure knowledge is not very deep, and secondly, my field requires extensive data, making manual judgment highly inefficient. Therefore, I am keen to resolve these two issues from a code perspective. If you have any recommendations or suggestions, I would be incredibly grateful. Additionally, I would appreciate any guidance on learning more about MOF molecular structures. I hope you can recommend a learning path about molecular structure knowledge.

Lastly, I would like to thank you once again for taking the time to address my questions. Your willingness to share your knowledge is greatly appreciated.

Best regards,

Young

Ben Bucior @.***> 于2024年5月28日周二 04:04写道:

For this structure, MOFid ran into an unexpected topology when attempting to deconstruct it into building blocks. It's been awhile since working with the code, but my guess would be either (a) something with assigning bond lengths, (b) a metal note connecting to two points instead of more (e.g., if you had a copper paddlewheel with only two points of contact instead of four, then an organic linker only connected to the paddlewheel and one other component), or (c) a structure that the code is not yet able to process correctly.

My main advice for debugging would be visualizing the generated CIFs in the Output/ directory (specifically Output/SingleNode and Output/AllNode), either in your favorite visualization tool or the web-mofid UI https://snurr-group.github.io/web-mofid/sbu.html. I used to flip between the Nodes + Linkers and the Simplified Topology views to see how the MOFid code was interpreting the structure and understand what chemistry was leading to the code assigning a pair of 2-coordinated neighbors.

— Reply to this email directly, view it on GitHub https://github.com/snurr-group/mofid/issues/24#issuecomment-2133998244, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMEFMPDKAJZLBIDWNYIFMVDZEOGTTAVCNFSM4I52LFZKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJTGM4TSOBSGQ2A . You are receiving this because you commented.Message ID: @.***>