Support Toxicity (LD50 / LC50) #7

Open
opened 2026-04-12 16:34:06 -04:00 by aalexmmaldonado · 0 comments
aalexmmaldonado commented 2026-04-12 16:34:06 -04:00 (Migrated from github.com)

Toxicity data lives under PubChem's "Toxicity" heading, and it's a different animal from scalar properties. A single entry might read "LD50 Oral - Rat - 5000 mg/kg" or "LC50 (96h) Bluegill Sunfish: 12 mg/L". The values carry an endpoint type (LD50, LC50, NOAEL), a species, a route of administration, and a unit. Delimiters and word orderings vary across depositors.

This is hard parsing, but it's also one of the most valuable annotation types for ML-ready chemical datasets.

Scope

Add TOXICITY = "Toxicity" to Annotation. Create pcdigitizer/data/toxicity.py with a ToxicityData processor. Output schema: cid, sid, pclid, endpoint (String — "LD50", "LC50", "NOAEL", etc.), value (Float64), unit (String), species (String, nullable), route (String, nullable), comment (String, nullable).

Start with LD50 and LC50 and treat other endpoints as follow-up work. A string that can't be parsed should never raise; log a warning and skip, as with pKa.

Because the data is so varied, write a dedicated test file with at least 15–20 hand-picked real examples from PubChem covering different endpoints, species, routes, and units.

Register, export, and test.

Definition of done

Working pipeline for LD50 and LC50 entries. Other endpoints are a stretch goal. Tests pass. Docstrings present.

Toxicity data lives under PubChem's `"Toxicity"` heading, and it's a different animal from scalar properties. A single entry might read `"LD50 Oral - Rat - 5000 mg/kg"` or `"LC50 (96h) Bluegill Sunfish: 12 mg/L"`. The values carry an endpoint type (LD50, LC50, NOAEL), a species, a route of administration, and a unit. Delimiters and word orderings vary across depositors. This is hard parsing, but it's also one of the most valuable annotation types for ML-ready chemical datasets. ### Scope Add `TOXICITY = "Toxicity"` to `Annotation`. Create `pcdigitizer/data/toxicity.py` with a `ToxicityData` processor. Output schema: `cid`, `sid`, `pclid`, `endpoint` (String — "LD50", "LC50", "NOAEL", etc.), `value` (Float64), `unit` (String), `species` (String, nullable), `route` (String, nullable), `comment` (String, nullable). Start with LD50 and LC50 and treat other endpoints as follow-up work. A string that can't be parsed should never raise; log a warning and skip, as with pKa. Because the data is so varied, write a dedicated test file with at least 15–20 hand-picked real examples from PubChem covering different endpoints, species, routes, and units. Register, export, and test. ### Definition of done Working pipeline for LD50 and LC50 entries. Other endpoints are a stretch goal. Tests pass. Docstrings present.
Sign in to join this conversation.