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)
| Compound | Category | MW | Targets |
|---|---|---|---|
| Aspirin | NSAID | 180.16 | COX-1, COX-2 |
| Metformin | Biguanide | 129.16 | AMPK, Complex-I |
| Atorvastatin | Statin | 558.64 | HMG-CoA reductase |
| Amoxicillin | Beta-lactam | 365.40 | PBP |
| Ibuprofen | NSAID | 206.28 | COX-1, COX-2 |
| Lisinopril | ACE inhibitor | 405.49 | ACE |
| Omeprazole | PPI | 345.42 | H+/K+-ATPase |
| Dexamethasone | Corticosteroid | 392.46 | GR |
| Warfarin | Coumarin | 308.33 | VKORC1 |
| Ciprofloxacin | Fluoroquinolone | 331.34 | DNA gyrase |
| Morphine | Opioid | 285.34 | mu-opioid receptor |
| Insulin Glargine | Insulin analog | 6063.0 | Insulin 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:
| Rule | Pass 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:
| Class | Solubility | Permeability | Strategy |
|---|---|---|---|
| I | High | High | Standard oral formulation |
| II | Low | High | Micronization, lipid formulation |
| III | High | Low | Permeation enhancers |
| IV | Low | Low | IV 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
- med.pk — pharmacokinetic profiling of screened compounds
- med.genomics — pharmacogenomic context for drug candidates
- Drug Discovery Pipeline — walkthrough using chem with PK and genomics