LCMD db logoLCMD[db]

Loading Data

How to load molecular datasets from LCMD

uv add lcmd-db
pip install lcmd-db

Molecules

from lcmd_db import load_dataset

data = load_dataset("oscar_nhc")
molecules = data.as_dataset("molecules")

mol = molecules[0]
mol.properties["smiles"]
mol.properties["energy"]

Reactions

data = load_dataset("pictet_spengler", include=["molecules", "reactions"])
reactions = data.as_dataset("reactions")

rxn = reactions[0]
for p in rxn.participants:
    print(p.role.value, p.molecule.properties["smiles"][:40])

Fragments

data = load_dataset("fragflp", include=["fragments"])
fragments = data.as_dataset("fragments")

frag = fragments[0]
frag.properties["smiles"]
frag.fragment_type  # "backbone", "lewis_acid_aryl", etc.

Assembly

Combine fragments into molecules using assembly templates:

data = load_dataset("fragflp", include=["fragments"])
template = data.assembly_templates["default"]

smiles = template.assemble(
    LAr1="c1c(C)c(C)c(C)c(C)c1(C)",
    LAr2="c1c(C)c(C)c(C)c(C)c1(C)",
    LBr1="*cncc1",
    LBr2="*cncc1",
    BB="*c1c2c()cnc()c2c()",
)

For the full guide — filtering, splitting, typed stubs, CLI, and more — see the Python client documentation.

On this page