|
1 | 1 | How to Guide |
2 | 2 | ============ |
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 | + |
4 | 9 |
|
5 | 10 | Quick Start Guide |
6 | 11 | =================== |
7 | 12 |
|
| 13 | +The `MOFstructure` class provides a simple |
| 14 | +and unified interface to most functionalities |
| 15 | + |
8 | 16 | .. code-block:: python |
9 | 17 | from mofstructure import structure |
10 | 18 | import mofstructure.filetyper as read_write |
@@ -37,14 +45,138 @@ Quick Start Guide |
37 | 45 | # get open metal sites |
38 | 46 | open_metal_sites = mofdata.get_oms() |
39 | 47 |
|
| 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 |
40 | 172 |
|
41 | 173 | Run on the Command Line |
42 | 174 | ========================== |
43 | 175 |
|
44 | 176 | 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. |
45 | 177 |
|
46 | | -Building Units |
47 | | ----------------- |
| 178 | +Deconstruct a structure: |
| 179 | +------------------------ |
48 | 180 |
|
49 | 181 | 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. |
50 | 182 |
|
|
0 commit comments