Replies: 1 comment
-
Hi @aahil1412 I believe you are just one step from there! You would need to check the distance between two sites ( # Only add edges if the bond length is within the atom-specific cutoff
- if neighbor.nn_distance < bond_cutoff:
+ if structure.get_distance(i, j, jimage=0) < bond_cutoff: # use jimage=0 to ignore PBC
G.add_edge(i, j, distance=neighbor.nn_distance) Then the plot becomes: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am trying to get a graph representation of covalent organic frameworks (COF). However, I faced a problem while creating the plot. So, COFs have periodic structures like crystals, and I want to incorporate them into the graph structure.
I am attaching the code I used below:
This is the output I got:


However, the actual structure should look like this:
I tried using this code for a Metal-organic framework (which has a more defined crystal system than COFs), and it worked perfectly, but in this case, the periodic conditions mismatched.
I also tried doing it for another COf structure, but that led to the same result, too.

I am not sure what I need to change in the code. I am also attaching the cif file below.
Thank you
COF-5.zip
Beta Was this translation helpful? Give feedback.
All reactions