chem-db-mof
Goal
Provide a unified interface for retrieving Metal-Organic Framework (MOF) crystal structures from multiple curated databases. Currently supported:
| Database |
Alias |
Size |
Access |
Structures |
| Quantum MOF (QMOF) |
qmof |
~20,000 DFT-relaxed |
MPContribs API |
DFT-optimized CIFs + bandgaps |
| ARC-MOF DB7 (Majumdar et al.) |
arcmof-majumdar |
12,316 hypothetical |
Zenodo stream |
CIFs with REPEAT partial charges |
Prerequisites
- Environment:
base-agent
- Packages:
mpcontribs-client, requests, pandas, pymatgen
- Credentials:
MP_API_KEY environment variable (required for qmof only)
Instructions
Step 1: Choose a database and set filters
Decide which database to query and which element/identifier filters to apply.
For QMOF — best for DFT-validated, experimentally-derived MOFs:
- Use
--formula for element filtering (e.g., Zn or Cu,N,O)
- Use
--identifier for a specific CSD refcode (e.g., KAXQIL)
For ARC-MOF DB7 (Majumdar et al.) — best for diverse hypothetical MOFs with underrepresented inorganic SBUs:
- Use
--elements for element filtering (e.g., Zn,O,C)
- Use
--identifier for a specific structure ID (e.g., DB7_00042)
- First run: downloads
geometric_properties.csv (110 MB) to `/.cache/arcmof/` — one-time only; subsequent runs are fast
Step 2: Run the query
# Env: base-agent
# QMOF — 10 Zn-containing MOFs
MP_API_KEY=<your_key> python .agents/skills/chem-db-mof/scripts/query_mof_db.py \
--database qmof \
--formula Zn \
--max-results 10 \
--output-dir ./research/<date>_<task>/structures/qmof
# Env: base-agent
# ARC-MOF DB7 (Majumdar) — 20 Zn,O,C hypothetical MOFs
python .agents/skills/chem-db-mof/scripts/query_mof_db.py \
--database arcmof-majumdar \
--elements Zn,O,C \
--max-results 20 \
--output-dir ./research/<date>_<task>/structures/arcmof_db7
# Env: base-agent
# ARC-MOF DB7 — retrieve a specific structure by identifier
python .agents/skills/chem-db-mof/scripts/query_mof_db.py \
--database arcmof-majumdar \
--identifier DB7_00042 \
--output-dir ./research/<date>_<task>/structures/arcmof_db7
Available Arguments
| Argument |
Applies to |
Description |
--database |
both |
qmof or arcmof-majumdar |
--formula |
qmof |
Element/formula filter string (e.g., Zn,O,C) |
--elements |
arcmof-majumdar |
Comma-separated required elements; ALL must be present |
--identifier |
both |
Specific structure name or ID substring |
--max-results |
both |
Max CIFs to download (default: 10) |
--output-dir |
both |
Directory for output CIF files |
--cache-dir |
arcmof-majumdar |
Override default cache ~/.cache/arcmof/ |
Step 3: Inspect outputs
The script saves:
- Individual
.cif files named by structure identifier
arcmof_db7_metadata.csv (ARC-MOF only) — geometric properties for the downloaded subset
Verify the download:
ls -lh <output-dir>/*.cif | head -20
Download Behavior: ARC-MOF DB7
The first call with --database arcmof-majumdar performs:
- Metadata download (
110 MB, one-time): geometric_properties.csv cached at `/.cache/arcmof/`
- DB7 filtering: identifies the 12,316 Majumdar structures from the full 288k-entry CSV
- CIF streaming: streams the ARC-MOF tarball (
ARCMOF_20241004.tar.gz, ~670 MB) and extracts only the requested CIFs — the stream is read once but only matching files are written to disk
Subsequent runs with the same --output-dir skip already-downloaded CIFs.
Examples
Example 1: Query Zn MOFs from QMOF for CO₂ screening pre-processing
# Env: base-agent
MP_API_KEY=<your_mp_api_key> \
python .agents/skills/chem-db-mof/scripts/query_mof_db.py \
--database qmof \
--formula Zn \
--max-results 10 \
--output-dir ./research/2026-03-27_test/qmof_zn
Example 2: Query Zn, Ni, or Mg hypothetical MOFs from ARC-MOF DB7
# Env: base-agent
# Zn-based
python .agents/skills/chem-db-mof/scripts/query_mof_db.py \
--database arcmof-majumdar \
--elements Zn,O,C \
--max-results 50 \
--output-dir ./research/2026-03-27_arcmof_zn
# Ni-based
python .agents/skills/chem-db-mof/scripts/query_mof_db.py \
--database arcmof-majumdar \
--elements Ni,O,C \
--max-results 50 \
--output-dir ./research/2026-03-27_arcmof_ni
# Mg-based
python .agents/skills/chem-db-mof/scripts/query_mof_db.py \
--database arcmof-majumdar \
--elements Mg,O,C \
--max-results 50 \
--output-dir ./research/2026-03-27_arcmof_mg
Tip: You can expand diversity by adding more elements to --elements (e.g., Zn,Ni,O,C,N to retrieve MOFs containing all of those elements simultaneously), or run separate queries per metal node and combine the resulting CIF directories for a broader screening campaign.
Constraints
- API limits: QMOF via MPContribs has rate limits; keep
--max-results ≤ 100 per call.
- ARC-MOF first-run time: Downloading the metadata CSV (~110 MB) takes ~1–2 min; streaming the tarball for CIF extraction adds ~5–15 min depending on how many structures are requested and network speed.
- ARC-MOF CIF fallback: If some DB7 structures are not found in
ARCMOF_20241004.tar.gz, they may reside in all_structures_1.tar.gz or all_structures_2.tar.gz. Update ARCMOF_STRUCTURES_NAME in the script if needed.
- Element filtering (ARC-MOF): Requires a
formula or chemical_formula column in geometric_properties.csv. If the column is absent, all DB7 entries are returned without element filtering.
- Post-download: Structures from ARC-MOF DB7 include REPEAT partial charges embedded in the CIF. These can be used directly for classical force-field simulations but should be relaxed with an MLIP before running Widom insertion (see
chem-sorption-relax).
References
- Raza, A. et al., "ARC–MOF: A Diverse Database of Metal-Organic Frameworks with DFT-Derived Partial Atomic Charges and Descriptors for Machine Learning", Chem. Mater., 2022. DOI: 10.1021/acs.chemmater.2c02485
- Majumdar, S., Moosavi, S.M., Jablonka, K.M., Ongari, D., Smit, B., "Diversifying Databases of Metal Organic Frameworks for High-Throughput Computational Screening", ACS Appl. Mater. Interfaces, 2021. DOI: 10.1021/acsami.1c16220; dataset: Materials Cloud Archive 2021.126, DOI: 10.24435/materialscloud:yn-de
- Chung, Y.G. et al., "Computation-Ready, Experimental Metal-Organic Frameworks: A Tool To Enable High-Throughput Screening of Nanoporous Crystals", Chem. Mater., 2014 (QMOF precursor). DOI: 10.1021/cm502594j
- Rosen, A.S. et al., "Machine learning the quantum-chemical properties of metal-organic frameworks for accelerated materials discovery", Matter, 2021 (QMOF). DOI: 10.1016/j.matt.2021.02.015
Author: Sauradeep Majumdar
Contact: GitHub @sauradeep93
1---2name: chem-db-mof3description: Query multiple MOF databases (QMOF via MPContribs; ARC-MOF DB7/Majumdar et al. via Zenodo) and download CIF structures with optional element or identifier filters.4---56# chem-db-mof78## Goal910Provide a unified interface for retrieving Metal-Organic Framework (MOF) crystal structures from multiple curated databases. Currently supported:1112| Database | Alias | Size | Access | Structures |13|---|---|---|---|---|14| Quantum MOF (QMOF) | `qmof` | ~20,000 DFT-relaxed | MPContribs API | DFT-optimized CIFs + bandgaps |15| ARC-MOF DB7 (Majumdar et al.) | `arcmof-majumdar` | 12,316 hypothetical | Zenodo stream | CIFs with REPEAT partial charges |1617## Prerequisites1819- **Environment**: `base-agent`20- **Packages**: `mpcontribs-client`, `requests`, `pandas`, `pymatgen`21- **Credentials**: `MP_API_KEY` environment variable (required for `qmof` only)2223## Instructions2425### Step 1: Choose a database and set filters2627Decide which database to query and which element/identifier filters to apply.2829**For QMOF** — best for DFT-validated, experimentally-derived MOFs:30- Use `--formula` for element filtering (e.g., `Zn` or `Cu,N,O`)31- Use `--identifier` for a specific CSD refcode (e.g., `KAXQIL`)3233**For ARC-MOF DB7 (Majumdar et al.)** — best for diverse hypothetical MOFs with underrepresented inorganic SBUs:34- Use `--elements` for element filtering (e.g., `Zn,O,C`)35- Use `--identifier` for a specific structure ID (e.g., `DB7_00042`)36- **First run**: downloads `geometric_properties.csv` (~110 MB) to `~/.cache/arcmof/` — one-time only; subsequent runs are fast3738### Step 2: Run the query3940```bash41# Env: base-agent42# QMOF — 10 Zn-containing MOFs43MP_API_KEY=<your_key> python .agents/skills/chem-db-mof/scripts/query_mof_db.py \44 --database qmof \45 --formula Zn \46 --max-results 10 \47 --output-dir ./research/<date>_<task>/structures/qmof48```4950```bash51# Env: base-agent52# ARC-MOF DB7 (Majumdar) — 20 Zn,O,C hypothetical MOFs53python .agents/skills/chem-db-mof/scripts/query_mof_db.py \54 --database arcmof-majumdar \55 --elements Zn,O,C \56 --max-results 20 \57 --output-dir ./research/<date>_<task>/structures/arcmof_db758```5960```bash61# Env: base-agent62# ARC-MOF DB7 — retrieve a specific structure by identifier63python .agents/skills/chem-db-mof/scripts/query_mof_db.py \64 --database arcmof-majumdar \65 --identifier DB7_00042 \66 --output-dir ./research/<date>_<task>/structures/arcmof_db767```6869### Available Arguments7071| Argument | Applies to | Description |72|---|---|---|73| `--database` | both | `qmof` or `arcmof-majumdar` |74| `--formula` | qmof | Element/formula filter string (e.g., `Zn,O,C`) |75| `--elements` | arcmof-majumdar | Comma-separated required elements; ALL must be present |76| `--identifier` | both | Specific structure name or ID substring |77| `--max-results` | both | Max CIFs to download (default: 10) |78| `--output-dir` | both | Directory for output CIF files |79| `--cache-dir` | arcmof-majumdar | Override default cache `~/.cache/arcmof/` |8081### Step 3: Inspect outputs8283The script saves:84- Individual `.cif` files named by structure identifier85- `arcmof_db7_metadata.csv` (ARC-MOF only) — geometric properties for the downloaded subset8687Verify the download:88```bash89ls -lh <output-dir>/*.cif | head -2090```9192## Download Behavior: ARC-MOF DB79394The first call with `--database arcmof-majumdar` performs:95961. **Metadata download** (~110 MB, one-time): `geometric_properties.csv` cached at `~/.cache/arcmof/`972. **DB7 filtering**: identifies the 12,316 Majumdar structures from the full 288k-entry CSV983. **CIF streaming**: streams the ARC-MOF tarball (`ARCMOF_20241004.tar.gz`, ~670 MB) and extracts only the requested CIFs — the stream is read once but only matching files are written to disk99100Subsequent runs with the same `--output-dir` skip already-downloaded CIFs.101102## Examples103104**Example 1: Query Zn MOFs from QMOF for CO₂ screening pre-processing**105```bash106# Env: base-agent107MP_API_KEY=<your_mp_api_key> \108python .agents/skills/chem-db-mof/scripts/query_mof_db.py \109 --database qmof \110 --formula Zn \111 --max-results 10 \112 --output-dir ./research/2026-03-27_test/qmof_zn113```114115**Example 2: Query Zn, Ni, or Mg hypothetical MOFs from ARC-MOF DB7**116```bash117# Env: base-agent118# Zn-based119python .agents/skills/chem-db-mof/scripts/query_mof_db.py \120 --database arcmof-majumdar \121 --elements Zn,O,C \122 --max-results 50 \123 --output-dir ./research/2026-03-27_arcmof_zn124125# Ni-based126python .agents/skills/chem-db-mof/scripts/query_mof_db.py \127 --database arcmof-majumdar \128 --elements Ni,O,C \129 --max-results 50 \130 --output-dir ./research/2026-03-27_arcmof_ni131132# Mg-based133python .agents/skills/chem-db-mof/scripts/query_mof_db.py \134 --database arcmof-majumdar \135 --elements Mg,O,C \136 --max-results 50 \137 --output-dir ./research/2026-03-27_arcmof_mg138```139140> **Tip:** You can expand diversity by adding more elements to `--elements` (e.g., `Zn,Ni,O,C,N` to retrieve MOFs containing all of those elements simultaneously), or run separate queries per metal node and combine the resulting CIF directories for a broader screening campaign.141142## Constraints143144- **API limits**: QMOF via MPContribs has rate limits; keep `--max-results` ≤ 100 per call.145- **ARC-MOF first-run time**: Downloading the metadata CSV (~110 MB) takes ~1–2 min; streaming the tarball for CIF extraction adds ~5–15 min depending on how many structures are requested and network speed.146- **ARC-MOF CIF fallback**: If some DB7 structures are not found in `ARCMOF_20241004.tar.gz`, they may reside in `all_structures_1.tar.gz` or `all_structures_2.tar.gz`. Update `ARCMOF_STRUCTURES_NAME` in the script if needed.147- **Element filtering (ARC-MOF)**: Requires a `formula` or `chemical_formula` column in `geometric_properties.csv`. If the column is absent, all DB7 entries are returned without element filtering.148- **Post-download**: Structures from ARC-MOF DB7 include REPEAT partial charges embedded in the CIF. These can be used directly for classical force-field simulations but should be relaxed with an MLIP before running Widom insertion (see [`chem-sorption-relax`](../chem-sorption-relax/SKILL.md)).149150## References151152- Raza, A. et al., "ARC–MOF: A Diverse Database of Metal-Organic Frameworks with DFT-Derived Partial Atomic Charges and Descriptors for Machine Learning", *Chem. Mater.*, 2022. [DOI: 10.1021/acs.chemmater.2c02485](https://doi.org/10.1021/acs.chemmater.2c02485)153- Majumdar, S., Moosavi, S.M., Jablonka, K.M., Ongari, D., Smit, B., "Diversifying Databases of Metal Organic Frameworks for High-Throughput Computational Screening", *ACS Appl. Mater. Interfaces*, 2021. [DOI: 10.1021/acsami.1c16220](https://doi.org/10.1021/acsami.1c16220); dataset: *Materials Cloud Archive* 2021.126, [DOI: 10.24435/materialscloud:yn-de](https://doi.org/10.24435/materialscloud:yn-de)154- Chung, Y.G. et al., "Computation-Ready, Experimental Metal-Organic Frameworks: A Tool To Enable High-Throughput Screening of Nanoporous Crystals", *Chem. Mater.*, 2014 (QMOF precursor). [DOI: 10.1021/cm502594j](https://doi.org/10.1021/cm502594j)155- Rosen, A.S. et al., "Machine learning the quantum-chemical properties of metal-organic frameworks for accelerated materials discovery", *Matter*, 2021 (QMOF). [DOI: 10.1016/j.matt.2021.02.015](https://doi.org/10.1016/j.matt.2021.02.015)156157---158159**Author:** Sauradeep Majumdar160**Contact:** [GitHub @sauradeep93](https://github.com/sauradeep93)