Skip to main content

Perform sanity checks for MOFs.

Project description


Tests PyPI PyPI - Python Version PyPI - License Documentation Status Code style: black

What does it do?

mofchecker performs quick sanity checks on crystal structures of metal-organic frameworks (MOFs).

Try the live web app at !

Sanity checks:

  • Presence of at least one metal, carbon and hydrogen atom
  • Overlapping atoms (distance between atoms above covalent radius of the smaller atom)
  • Overvalent carbons (coordination number above 4), nitrogens (heuristics), or hydrogens (CN > 1)
  • Missing hydrogen on common coordination geometries of C and N (heuristics)
  • Atoms with excessive EQeq partial charge

Basic analysis:

  • Presence of floating atoms or molecules
  • Hash of the atomic structure graph (useful to identify duplicates)

The sanity checks can be used to weed out really unreasonable structures (nothing too fancy). The code is a rewrite of similar tools in structure_comp.

🚀 Installation

Development version:

pip install git+

Latest stable release

pip install mofchecker

Note that you need to install zeopp if you want to use the porosity features.

conda install -c conda-forge zeopp-lsmo

A web app is currently being developed in another repository and deployed on MatCloud.

💪 Getting Started

Command line interface

mofchecker --help # list options
mofchecker structure1.cif structure2.cif  # prints JSON output
mofchecker -d has_metal -d has_atomic_overlaps *.cif  # compute only selected descriptors

In Python

from mofchecker import MOFChecker
mofchecker = MOFChecker.from_cif(<path_to_cif>)
# or: MOFChecker(structure=my_pymatgen_structure)

# Test for OMS

# Test for clashing atoms

# Run basic checks on a list of cif paths (sample_structures)
results = []

for structure in sample_structures:
    mofchecker = MOFChecker.from_cif(structure)

👐 Contributing

Contributions, whether filing an issue, making a pull request, or forking, are appreciated. See CONTRIBUTING.rst for more information on getting involved.

⚖️ License

The code in this package is licensed under the MIT License.

💰 Funding

The research was supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement 666983, MaGic), by the NCCR-MARVEL, funded by the Swiss National Science Foundation, and by the Swiss National Science Foundation (SNSF) under Grant 200021_172759.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mofchecker-0.9.6.tar.gz (8.8 MB view hashes)

Uploaded source

Built Distribution

mofchecker-0.9.6-py3-none-any.whl (5.0 MB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page