The dataset viewer is not available for this split.
Error code: TooManyColumnsError
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
Bober KRFP PubChem Patterns
Molecule-ID datasets for 1,652 acyclic, relaxed KRFP SMARTS patterns, built from 105,842,232 PubChem records. Each pattern has up to 5 million IDs per class.
Files
| File | Contents |
|---|---|
KRFPxxxx.npz |
Three uint32 arrays: positive, tversky, negative |
patterns.json |
Relaxed SMARTS queries used to label matches |
pre_patterns.json |
Original SMARTS queries used to construct similarity prototypes |
smiles.txt |
One SMILES per global row ID |
smiles_offsets.npy |
Byte offsets into smiles.txt (uint64, length N + 1) |
Labels: positive matches the relaxed SMARTS; tversky does not match but passes a Morgan-fingerprint Tversky similarity threshold (radius 2, 2048 bits, α=1, β=0, score ≥0.5); negative is a sampled nonmatch. Selected classes for each pattern are disjoint.
IDs are zero-based positions in the shared SMILES file, not PubChem CIDs.
Use
import numpy as np
from huggingface_hub import hf_hub_download
repo = "WiktorMatuszek/bober_patterns"
def get_file(name):
return hf_hub_download(repo, name, repo_type="dataset")
with np.load(get_file("KRFP0001.npz")) as data:
positive = data["positive"]
tversky = data["tversky"]
negative = data["negative"]
offsets = np.load(get_file("smiles_offsets.npy"), mmap_mode="r")
with open(get_file("smiles.txt"), "rb") as f:
idx = int(positive[0])
f.seek(int(offsets[idx]))
smiles = f.read(int(offsets[idx + 1] - offsets[idx])).decode().strip()
print(idx, smiles)
Download only the required pattern files; the shared smiles.txt and offset index are needed only to resolve IDs.
Notes
SMARTS are automatically relaxed; Some patterns have few or no positive examples. Duplicates are removed by exact SMILES text, not canonical structure.
- Downloads last month
- 19