All courses / Data engineering / Series 1
Data Engineering for Chemistry · Series 1
Data Engineering for Cheminformatics
From SDF files to chemical data pipelines that scale to millions of molecules, survive failures and can be trusted.
Start here
- Open Module 1 and read it on any device.
- To run its code, click Open this lesson in Google Colab in its Get set up box: you need only a free Google account, nothing to install.
- New to notebooks? Start here shows every step, and what each word means.
The big picture: a chemist thinking like a data engineer
The problem
Every week, three suppliers send your group their catalogues as SDF and SMILES files, and ChEMBL publishes new activity data. Together that is about two million molecules, and it keeps growing. Some structures will not parse, the same compound arrives under five different names, one supplier quietly changes its file format, and last month's numbers cannot be rebuilt. Your colleagues want one clean, de-duplicated, searchable library, refreshed every Monday, that their models can train on and that can be traced back to its sources. Doing it by hand takes a week, and nobody can repeat it exactly.
How do you build a pipeline that does it for you, reliably, every week?
A chemist would solve this one file at a time. A data engineer solves it once, for every file, every week, without anyone watching. The diagram is that solution, step by step, with the module that teaches each step. Choose a step to see why it matters, how it is done, where the course covers it and when it happens.
The path of the data
Bring it in
Make it right
Put it to use
At every step
Fifteen modules on the engineering that sits between raw chemical files and machine learning. It starts with how molecules are represented and stored, in relational and graph databases; then the course turns to what breaks in practice: libraries too big for memory, jobs that need many cores, pipelines that fail halfway, data that drifts, and results nobody can reproduce. Each idea is built by hand first, so you understand it before Series 2 hands it to industry tools.
The cohort starts in January 2027, with one module a week. The modules already written are open now: you can start reading and running them today, on your own.
Modules
- Foundations
-
1
Open to read
Molecules as graphs and matrices
A molecule is a graph: atoms are nodes, bonds are edges. Build it in NetworkX, write it as adjacency, bond-order and distance matrices, encode atom and bond properties (weights, one-hot features, bond tensors, edge lists), and compute on it with NumPy, up to one step of message passing.
RDKitNetworkXNumPypandasRead the lesson → -
2
Open to read
Molecules as text, patterns and numbers
SMILES (canonical and isomeric), InChI and InChIKey, molfiles and SDF, 3D conformers, SMARTS patterns, fingerprints and descriptors: what each keeps, what each loses (stereochemistry, tautomers, aromaticity), and which to store for which job.
RDKitpandasRead the lesson → -
3
Open to read
Chemical files and identity
The files molecules travel in (SDF, SMILES, CSV, Parquet), what each costs in space and time, and a stable identity for every molecule (InChIKey) so duplicates can be found.
RDKitPyArrowParquetRead the lesson → -
4
Open to read
Databases, schemas and a chemical database
What a database is, the main kinds (relational, and the NoSQL kinds such as MongoDB and Neo4j), and which questions each answers best. How to plan the tables for chemical data before storing anything, and how to describe them so others can use them. Then run PostgreSQL with its RDKit chemistry add-on in Docker, log in safely, search molecules by substructure and similarity, and analyse a library quickly with DuckDB.
PostgreSQLRDKit cartridgeDuckDBSQLDockerRead the lesson → -
5
Open to read
Molecules as graphs, and graph databases
A molecule is a graph: atoms are nodes, bonds are edges. Work with it as one (rings, paths, substructure as subgraph matching, maximum common substructure), then store chemistry in a graph database: molecules linked to reactions, targets and assays, queried with Cypher. Compare it with the relational database and see where each one wins.
RDKitNetworkXNeo4jCypherRead the lesson → -
6
Open to read
Validating molecules
Catch broken structures before they spread: parsing and sanitisation errors, impossible valences, unexpected elements and charges, missing or contradictory stereochemistry, size limits; decide what to fix, what to reject and how to record why.
RDKitRead the lesson → -
7
Open to read
Standardisation as a tested transformation
Strip salts, neutralise charges and choose one tautomer as a pure, deterministic function with versioned rules and unit tests.
RDKit MolStandardizepytestRead the lesson → - Scale
-
8
Open to read
Libraries larger than memory
Stream molecules in batches instead of loading them all, write partitioned Parquet, and query far more rows than fit in memory; measure memory and throughput as you go.
PyArrowParquetDuckDBRead the lesson → -
9
Open to read
Parallel and distributed processing
Spread standardisation and fingerprints across cores with joblib, then across memory and machines with Dask: chunk sizes, passing SMILES instead of molecule objects, when parallel work stops helping, and a scaling curve; the same code on Windows, macOS and Linux.
joblibDaskRead the lesson → - Reliability
-
10
Open to read
Pipelines that survive failure
Idempotent steps, checkpoints and cached results, resuming from the last good batch, retries with back-off, atomic writes, quarantining bad molecules instead of crashing, settings checked before a run starts, and running long jobs on a server or virtual machine with tmux.
Pythonjoblib.MemoryPydantic settingsPostgreSQLtmuxRead the lesson → -
11
Open to read
Incremental ingestion from ChEMBL and PubChem
Fetch only what changed, page through APIs within their rate limits, cache responses, check every response against a model so a changed API fails loudly, and run backfills safely.
ChEMBL and PubChem APIsPydanticParquetRead the lesson → -
12
Open to read
Validating data: records with Pydantic, tables with Pandera
Check single records at the edges with Pydantic and whole batches in bulk with Pandera: column types, required fields, value ranges, units (nM, µM, pIC50), duplicates, links between tables, and counts that agree across sources; measure why a million rows are not checked one at a time; stop or quarantine a batch that fails, and report why.
PydanticPanderaRDKitPostgreSQLRead the lesson → -
13
Open to read
Versioning everything
Version code, environments, database schemas, standardisation rules, datasets and results, so any number can be traced back and rebuilt exactly.
GituvDockerSQL migrationsDVCRead the lesson → -
14
Open to read
Monitoring pipelines
Structured logs, run history, counts in and out that must reconcile, throughput and error rates, freshness, drift in molecular properties, and alerts when something goes wrong.
Python loggingPostgreSQLalertsRead the lesson → - Capstone
-
15
Open to read
Capstone: a resumable, monitored pipeline over a large library
Standardise, deduplicate, filter and fingerprint millions of molecules end to end; stop it halfway, resume it, version the output and show that every count reconciles.
Everything aboveRead the lesson →