Skip to main content

med.chem - Medicinal Chemistry

Molecular property calculations, drug-likeness screening, ADMET prediction, toxicity analysis, and a built-in compound database for drug discovery workflows.

Built-in Compound Database (12)

CompoundCategoryMWTargets
AspirinNSAID180.16COX-1, COX-2
MetforminBiguanide129.16AMPK, Complex-I
AtorvastatinStatin558.64HMG-CoA reductase
AmoxicillinBeta-lactam365.40PBP
IbuprofenNSAID206.28COX-1, COX-2
LisinoprilACE inhibitor405.49ACE
OmeprazolePPI345.42H+/K+-ATPase
DexamethasoneCorticosteroid392.46GR
WarfarinCoumarin308.33VKORC1
CiprofloxacinFluoroquinolone331.34DNA gyrase
MorphineOpioid285.34mu-opioid receptor
Insulin GlargineInsulin analog6063.0Insulin receptor

Methods

molecular_weight(formula) → dict

Calculate molecular weight from a chemical formula (e.g., C9H8O4).

lib.chem.molecular_weight("C9H8O4")
# {'molecular_weight': 180.04, 'composition': {'C': 9, 'H': 8, 'O': 4}}

lipinski_check(mw, logp, hbd, hba) → dict

Lipinski's Rule of Five - oral drug-likeness screening:

RulePass if
Molecular Weight≤ 500
LogP≤ 5
H-Bond Donors≤ 5
H-Bond Acceptors≤ 10

Drug-like if ≤ 1 violation.

lib.chem.lipinski_check(180, 1.2, 1, 4)
# {'violations': 0, 'drug_like': True, 'assessment': 'PASS - drug-like'}

bcs_classify(solubility, permeability) → dict

Biopharmaceutical Classification System:

ClassSolubilityPermeabilityStrategy
IHighHighStandard oral formulation
IILowHighMicronization, lipid formulation
IIIHighLowPermeation enhancers
IVLowLowIV route or advanced delivery

admet_screen(mw, logp, psa, rotatable_bonds) → dict

Rule-based ADMET property screening. Predicts absorption, distribution, metabolism, CNS penetration.

Returns assessment: FAVORABLE, ACCEPTABLE, CONCERNING, or POOR.

tox_screen(compound_name, dose_mg_kg=0) → dict

Toxicity screening against the compound database. Returns LD50, therapeutic index, and safety classification.

lib.chem.tox_screen("aspirin")
# {'ld50_mg_kg': 200, 'therapeutic_index': 3.5,
# 'safety': 'NARROW therapeutic window - monitor closely'}

screen_compound(compound_name) → dict

Full drug-likeness screening pipeline - runs Lipinski, BCS, ADMET, and toxicity checks, then returns a combined verdict.

lib.chem.screen_compound("aspirin")
# {'verdict': 'GOOD CANDIDATE', 'screening_scores': {'lipinski': 1, 'bcs': 1, 'admet': 1, 'toxicity': 0}}

lookup(compound_name) → dict

Get the full profile (MW, LogP, targets, etc.) for a compound.

search_by_target(target) → dict

Find compounds that act on a molecular target.

lib.chem.search_by_target("COX")
# {'matches': [{'name': 'Aspirin', ...}, {'name': 'Ibuprofen', ...}], 'count': 2}

search_by_class(therapeutic_class) → dict

Find compounds by therapeutic class (e.g., "antibiotic", "analgesic").

list_compounds(category=None) → list

List all compounds, optionally filtered by category.

Custom Compound Registration

from moisscode.modules.med_chem import ChemEngine, Compound

chem = ChemEngine()
chem.register_compound(Compound(
name="Remdesivir",
formula="C27H35N6O8P",
molecular_weight=602.58,
logp=1.9,
hbd=4,
hba=12,
psa=213.4,
rotatable_bonds=14,
category="antiviral",
solubility="low",
permeability="low",
known_targets=["RdRp"],
therapeutic_class="antiviral",
max_daily_dose_mg=200,
ld50_mg_kg=0,
))

See Also