LMucko's picture
Upload README.md with huggingface_hub
7d0b1c9 verified
|
Raw
History Blame Contribute Delete
7.34 kB
---
license: cc0-1.0
task_categories:
- text-classification
- feature-extraction
tags:
- crystallography
- chemistry
- materials-science
- CIF
- crystal-structure
size_categories:
- 100K<n<1M
---
# Crystallography Open Database (COD) — Full Snapshot
A complete mirror of the [Crystallography Open Database](https://www.crystallography.net/) (COD) as a single Parquet file, combining all crystallographic metadata with the raw CIF file content in one queryable dataset.
## Snapshot Details
| Field | Value |
|-------|-------|
| **Snapshot date** | 2026-07-06 |
| **Metadata fetched** | 2026-07-06 18:51 (UTC+2) — 533,486 entries |
| **CIF files downloaded** | 2026-07-06 18:34–21:58 — 533,862 files |
| **Total rows** | 533,486 (metadata) — 411 on-hold entries excluded |
| **File format** | Parquet (zstd compressed) |
| **License** | CC0 1.0 (Public Domain) |
## Dataset Structure
One Parquet file (`cod_full.parquet`) with 75 columns — the 74 COD metadata fields plus a `cif_text` column containing the full raw CIF file content as a string.
### Metadata Columns
| Column | Type | Description |
|--------|------|-------------|
| `file` | int64 | COD ID (7-digit identifier, e.g. `1553769`) |
| `a`, `b`, `c` | double | Unit cell lengths (Å) |
| `siga`, `sigb`, `sigc` | double | Standard uncertainties on cell lengths |
| `alpha`, `beta`, `gamma` | double | Unit cell angles (°) |
| `sigalpha`, `sigbeta`, `siggamma` | double | Standard uncertainties on cell angles |
| `vol` | double | Unit cell volume (ų) |
| `sigvol` | double | Standard uncertainty on volume |
| `celltemp` | double | Cell measurement temperature (K) |
| `sigcelltemp` | double | SU on cell temperature |
| `diffrtemp` | double | Diffraction measurement temperature (K) |
| `sigdiffrtemp` | double | SU on diffraction temperature |
| `cellpressure` | double | Cell measurement pressure (kPa) |
| `sigcellpressure` | double | SU on cell pressure |
| `diffrpressure` | double | Diffraction measurement pressure (kPa) |
| `sigdiffrpressure` | double | SU on diffraction pressure |
| `thermalhist` | string | Thermal history |
| `pressurehist` | string | Pressure history |
| `compoundsource` | string | Source of compound |
| `nel` | string | Number of distinct elements |
| `sg` | string | Space group (Hermann-Mauguin) |
| `sgHall` | string | Space group (Hall notation) |
| `sgNumber` | int64 | Space group number (1–230) |
| `commonname` | string | Common name |
| `chemname` | string | Chemical name |
| `mineral` | string | Mineral name |
| `formula` | string | Chemical formula (sum) |
| `calcformula` | string | Calculated formula |
| `cellformula` | string | Unit cell formula |
| `Z` | int64 | Number of formula units per unit cell |
| `Zprime` | double | Z′ (Z per asymmetric unit) |
| `acce_code` | string | CCDC accession code |
| `authors` | string | Publication authors |
| `title` | string | Publication title |
| `journal` | string | Journal name |
| `year` | int64 | Publication year |
| `volume` | int64 | Journal volume |
| `issue` | string | Journal issue |
| `firstpage` | string | First page |
| `lastpage` | string | Last page |
| `doi` | string | Digital Object Identifier |
| `method` | string | Structure determination method |
| `radiation` | string | Radiation type |
| `wavelength` | double | Wavelength (Å) |
| `radType` | string | Radiation type (detailed) |
| `radSymbol` | string | Radiation symbol |
| `Rall` | double | R-factor (all reflections) |
| `Robs` | double | R-factor (observed reflections) |
| `Rref` | double | R-factor (refined) |
| `wRall` | double | Weighted R-factor (all) |
| `wRobs` | double | Weighted R-factor (observed) |
| `wRref` | double | Weighted R-factor (refined) |
| `RFsqd` | double | R-factor on F² |
| `RI` | double | R-factor (intensity) |
| `gofall` | double | Goodness of fit (all) |
| `gofobs` | double | Goodness of fit (observed) |
| `gofgt` | double | Goodness of fit (I > 2σ(I)) |
| `gofref` | double | Goodness of fit (refined) |
| `duplicateof` | int64 | COD ID of which this is a duplicate |
| `optimal` | int64 | Flag for optimal structure |
| `status` | string | Status (e.g. `warnings`) |
| `flags` | string | Status flags |
| `text` | string | Concatenated bibliography text |
| `svnrevision` | int64 | SVN revision of the COD entry |
| `date` | string | Deposition date (`YYYY-MM-DD`) |
| `time` | string | Deposition time (`HH:MM:SS`) |
| `onhold` | string | On-hold release date (empty if released) |
### CIF Text Column
| Column | Type | Description |
|--------|------|-------------|
| `cif_text` | string | Full raw CIF file content (text) |
Each CIF contains:
- Unit cell parameters and standard uncertainties
- Space group information (Hermann-Mauguin, Hall, IT number)
- Atomic site coordinates (fractional) with displacement parameters
- SHELX `.res` file (refinement details, atom lists, restraints)
- SHELX `.hkl` file (observed structure factors — Fobs)
- Publication metadata and COD database codes
## Loading
```python
from datasets import load_dataset
ds = load_dataset("your-username/cod", split="train")
print(ds[0]["formula"]) # e.g. "C16 H11 F N2 O"
print(ds[0]["sg"]) # e.g. "P 1 21/c 1"
print(ds[0]["cif_text"][:200]) # first 200 chars of the CIF
```
Or directly with PyArrow / DuckDB for out-of-core querying:
```python
import pyarrow.parquet as pq
table = pq.read_table("cod_full.parquet", columns=["file", "formula", "sg", "year"])
```
```sql
SELECT file, formula, sg, year
FROM 'cod_full.parquet'
WHERE year >= 2020 AND sgNumber = 14
LIMIT 10;
```
## Parsing CIF Text
For crystallographic analysis, parse `cif_text` with:
```python
# gemmi (fastest, C++ bindings)
import gemmi
doc = gemmi.cif.read_string(row["cif_text"])
block = doc[0]
# pymatgen (full crystallography)
from pymatgen.core import Structure
import io
struct = Structure.from_str(row["cif_text"], fmt="cif")
```
## Coverage
- **Earliest publication**: 1915
- **Peak deposition years**: 2012–2015 (~25–28K structures/year)
- **Recent deposits**: ~10K/year
- **Compound types**: organic, inorganic, metal-organic, minerals (excluding biopolymers)
- **Data sources**: CCDC, AMCSD, IUCr journals, direct depositions
## License
All data in the COD is dedicated to the public domain under [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/).
Users of the data should acknowledge the original authors of the structural data. The `authors`, `title`, `journal`, `year`, and `doi` columns are provided for this purpose.
## Citation
If you use this dataset, please cite the COD:
> Grazulis, S., Chateigner, D., Downs, R. T., Yokochi, A. F. T., Quirós, M., Lutterotti, L., Manakova, E., Butkus, J., Moeck, P. & Le Bail, A. (2009). *Crystallography Open Database – an open-access collection of crystal structures.* J. Appl. Cryst. 42, 726–729. doi:10.1107/S0021889809016690
> Merkys, A., Vaitkus, A., Butkus, J., Okulič-Kazarinas, V., Kairys, V. & Gražulis, S. (2016). *COD::CIF::Parser: an error-correcting CIF parser for the Perl language.* J. Appl. Cryst. 49, 292–301. doi:10.1107/S1600576716000414
## Source
- **Website**: https://www.crystallography.net/
- **SQL database**: `sql.crystallography.net` (user: `cod_reader`, database: `cod`)
- **Rsync**: `rsync://www.crystallography.net/cif/`