Skip to content

Commit 8c6310f

Browse files
committed
fixed data
1 parent c06ab0e commit 8c6310f

6 files changed

Lines changed: 503 additions & 194 deletions

File tree

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,30 @@ mofstructure_topology net.cgd
125125
```
126126
127127
```bash
128-
mofstructure_systre ./folder
128+
mofstructure_topology ./folder
129129
```
130130
131-
```bash
132-
mofstructure_systre ./folder --no-recursive
131+
132+
You can also decided how the topology should be computed by
133+
defining which deconstruction you want. At the moment we have
134+
three major methods [`all_nodes`, `sbus` and `ligand_cluster`].
135+
Note that the topology from each could be thesame or different since
136+
these methods determines how the topological graph is constructed.
137+
138+
```bash
139+
mofstructure_topology structure.cif --method all_nodels
140+
```
141+
142+
```bash
143+
mofstructure_topology ./folder ligand_cluster
144+
```
145+
146+
For a very large dataset you can choose to write files to
147+
disk in small batches. for that you can use the `--flush-every` keyword
148+
as follows.
149+
150+
```bash
151+
mofstructure_topology ./folder ligand_cluster --flush-every 100
133152
```
134153
135154
### Use as a libray

docs/source/examples.rst

Lines changed: 135 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
How to Guide
22
============
3-
This section provides step-by-step instructions on how to use `mofstructure` both from the command line and as a Python library. Whether you're new to this module or just need a refresher, this guide will help you get started with ease.
3+
This section provides detailed
4+
step-by-step examples demonstrating how to use `mofstructure`
5+
both as a Python library and from the command line.
6+
The aim is to guide users from a raw crystal structure
7+
(e.g. CIF file) to meaningful structural, topological and chemical insights.
8+
49

510
Quick Start Guide
611
===================
712

13+
The `MOFstructure` class provides a simple
14+
and unified interface to most functionalities
15+
816
.. code-block:: python
917
from mofstructure import structure
1018
import mofstructure.filetyper as read_write
@@ -37,14 +45,138 @@ Quick Start Guide
3745
# get open metal sites
3846
open_metal_sites = mofdata.get_oms()
3947
48+
Reading Structures
49+
====================
50+
`mofstructure` supports all formats readable by ASE (e.g. CIF, POSCAR, XYZ).
51+
52+
.. code-block:: python
53+
54+
from mofstructure import structure
55+
56+
mof = structure.MOFstructure(filename="structure.cif")
57+
58+
Alternatively an ASE Atoms object can be passed directly:
59+
60+
.. code-block:: python
61+
62+
from mofstructure import structure
63+
mof = structure.MOFstructure(ase_atoms=ase_atoms)
64+
65+
66+
Removing Guest Molecules
67+
========================
68+
Many experimentally resolved MOFs contain solvent
69+
or guest molecules that are not part of the framework.
70+
These must be removed before analysis.
71+
72+
.. code-block:: python
73+
74+
clean_structure = mof.remove_guest()
75+
76+
This codes identifies disconnected components in the periodic graph and removes unbound fragments.
77+
78+
Deconstruction: Building Units
79+
===============================
80+
A central feature of mofstructure is the decomposition of a framework into:
81+
- Metal secondary building units (SBUs)
82+
- Organic SBUs (linkers)
83+
- Organic ligands
84+
- metal clusters
85+
86+
.. code-block:: python
87+
88+
metal_sbus, organic_sbus = mof.get_sbu()
89+
metal_clusters, organic_ligands = mof.get_ligands()
90+
91+
Each building unit is returned as an ASE Atoms object with additional metadata stored in .info.
92+
93+
.. code-block:: python
94+
95+
for sbu in metal_sbus:
96+
print(sbu.info["sbu_type"])
97+
print(sbu.info["inchikey"])
98+
99+
Available information includes:
100+
- SMILES
101+
- InChI / InChIKey
102+
- SBU type (e.g. paddlewheel, rod-like)
103+
- Points of extension
104+
105+
Saving building units:
106+
-----------------------
107+
.. code-block:: python
108+
109+
for i, sbu in enumerate(metal_sbus):
110+
sbu.write(f"metal_sbu_{i}.cif")
111+
112+
Topology Analysis
113+
=================
114+
115+
Topology is determined using a graph representation of the framework and analysed using Systre.
116+
This is possible becuase of the deconstruction into building units, which allows for different levels of abstraction.
117+
118+
.. code-block:: python
119+
120+
topology = mof.get_topology(method="all_node")
121+
print(topology["topology"]) # e.g. pcu, dia
122+
print(topology["dimension"]) # 2 or 3
123+
print(topology["td10"])
124+
125+
Available methods:
126+
127+
- all_node: full atomic network
128+
- sbus: SBU-based coarse graining
129+
- ligand_cluster: ligand-based abstraction
130+
131+
The output includes:
132+
- RCSR topology name
133+
- Dimensionality
134+
- Topological descriptors
135+
- TD10 value
136+
- Topology hash for uniqueness
137+
- systre optimised cgd string representation
138+
139+
Porosity Analysis
140+
=================
141+
Porosity properties are computed using our python wrapper around Zeo++ called pyzeo.
142+
143+
.. code-block:: python
144+
pores = mof.get_porosity(
145+
probe_radius=1.86,
146+
number_of_steps=10000,
147+
high_accuracy=True
148+
)
149+
print(pores["AV_Volume_fraction"])
150+
print(pores["ASA_m2_cm3"])
151+
152+
Typical outputs include:
153+
- Accessible volume fraction
154+
- Accessible surface area
155+
- Pore limiting diameter (PLD)
156+
- Largest cavity diameter (LCD)
157+
158+
For high-quality results, `high_accuracy=True` is recommended.
159+
160+
161+
Open Metal Sites (OMS)
162+
=======================
163+
Open metal sites are important for adsorption and catalysis.
164+
165+
.. code-block:: python
166+
oms = mof.get_oms()
167+
168+
The returned data typically includes:
169+
- Metal identity
170+
- Coordination environment
171+
- Atomic indices
40172

41173
Run on the Command Line
42174
==========================
43175

44176
One of the most powerful features of `mofstructure` is its ability to perform complex operations directly from the command line. Below, we walk you through how to deconstruct metal-organic frameworks (MOFs) into their building units and how to create a database of MOFs from multiple files.
45177

46-
Building Units
47-
----------------
178+
Deconstruct a structure:
179+
------------------------
48180

49181
If you have a CIF file (or any file format that ASE can read, such as POSCAR, XYZ, etc.) containing a MOF, you can deconstruct it into its constituent building units using a simple command. This command processes the MOF structure and saves the results in an organized folder structure.
50182

mofstructure/scripts/systre_cgd.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python3
22
from __future__ import annotations
3+
__author__ = "Dr. Dinga Wonanke"
4+
__status__ = "production"
35

46
import argparse
57
from pathlib import Path

0 commit comments

Comments
 (0)