2026.07.21
Automated data preparation for QSAR modeling
In modern drug discovery, predicting activity against targets like the Pregnane X Receptor (PXR) is a critical step in assessing potential drug-drug interactions and toxicity. However, the reliability of Quantitative Structure-Activity Relationship (QSAR) models is fundamentally tied to the quality of the data used for training. Achieving this quality requires meticulous data preparation—standardizing chemical structures, filtering compounds, and deduplicating records—which has historically been a significant bottleneck.

Traditional open-source approaches often rely on manual, brittle scripting using tools like RDKit and Pandas. This process is not only time-consuming and prone to human error, but it also creates inconsistencies that can compromise downstream machine-learning models.

To overcome these challenges, we introduce Insilico Medicine's Cheminformatics Engine—MolTools, a robust framework that binds AI agents to advanced cheminformatics tools to streamline these workflows. Powered by the MolTools MCP connector, an agent like Claude Code transforms manual data preparation into a seamless, automated process. It lets you set up and adapt the preparation workflow to your needs without writing a single line of data-wrangling code. By replacing fragmented scripts with a unified, AI-driven pipeline, MCP allows researchers to focus on science rather than data wrangling.

To demonstrate, we will use MolTools MCP to prepare the PXR dataset gathered by our chemists from public sources. Traditionally, standardizing and deduplicating this dataset would take several hundred lines of RDKit/Pandas code—with MolTools MCP we did it in two prompts.
A Transparent Engine, Not a Black Box
Before processing a single molecule, you can simply ask the engine what it is capable of. Unlike an opaque script buried in someone's repository, MolTools exposes its entire toolkit on request—so you know exactly what will run before you commit to a pipeline.

In our case, one question returns the complete registry: 14 configurable structure filters—from macrocycle and isotope detection to disallowed-atom and mixture checks—and 10 standardization transformers, including charge neutralization, dearomatization, and functional-group standardization. Each tool reports its default ON/OFF state, giving you full control over the workflow instead of hidden, hardcoded behavior.

Figure 1.

Asking the MolTools MCP engine to list its available filters and transformers—every step is inspectable, not buried in code.

In this case study, we will adjust the data standardization protocol by switching off the macrocycle filter to allow macrocyclic structures to pass. You could also switch on the ionization module needed for certain tasks, but we will skip it for now. Hence, the data preparation workflow consists of two steps: 1) data standardization, and 2) deduplication. Each step is driven by a single natural-language prompt.
Step 1
Standardization with a Full Audit Trail
The prompt we used to start the process was “Standardize the chemical structures in PXR_data.csv using Structure_ID as the ID and smiles as the mol_tag with macrocycle_filter turned off”. Standardization of a thousand structures finished in under a minute. The result is reported transparently: 971 of the 1,003 original structures were standardized and saved to standardized.csv—each row gaining a new column with a clean, canonical SMILES representation.

Figure 2.

Standardizing the full PXR dataset in a single prompt: 1,003 in, 971 out, and 32 removed—each with a documented reason.

Every removed structure is itemized by reason—deuterium-containing structures (13), structures containing silicon and gold elements (10), mixtures (4), acyclic molecules (4), and a single invalid SMILES entry. To confirm the logic is sound, we asked the engine to render three of the discarded molecules.

Figure 3.

The engine accounts for each rejection by Structure_ID, reason, and the offending structural feature.

The rejections are chemically sensible: an organometallic structure, an organosilicon structure, and two isomers of the same structure stored as a single molecule. These records require special attention, so the agent highlights them.

Figure 4.

Rendered structures of the three discarded examples, saved directly to a PNG on request.

Step 2
Intelligent, Value-Aware Deduplication
Molecules are rarely duplicated under the exact same name or representation. Our MCP goes beyond plain canonical SMILES by comparing key structural features and then running a complete graph comparison. It also checks metadata fields to resolve conflicts—ensuring you don't lose vital biological activity data during the merge.

The prompt for the second step was just as compact: “Deduplicate the standardized structures in standardized.csv using Structure_ID as the ID and smiles as the mol_tag, merging STANDARD_VALUE on the median only when the values agree.” Applied to the 971 standardized molecules, deduplication produced 954 unique compounds in PXR_data_deduplicated.csv. Rather than blindly averaging matches, the engine applied a safety check: it merges values only when they agree—specifically, when the Coefficient of Variation (CV) for the duplicated values—the standard deviation divided by the mean—stays below 0.3 (i.e., under 30%).

Figure 5.

Value-aware deduplication: identical structures are merged on the median STANDARD_VALUE, but only when their reported activities agree.

The tool found 12 identical pairs. Of these, 7 pairs had consistent activity values (CV below 0.3) and were merged into 7 records using the median STANDARD_VALUE, while the remaining 5 pairs had conflicting values (CV 0.67–0.82). All 10 records from those 5 conflicting pairs were dropped. In total, 17 records were eliminated, taking the dataset from 971 to 954. Tellingly, each duplicate paired an early Structure_ID with a much later one.
The Takeaway: Automated data preparation removes the biggest bottleneck in QSAR modeling. By binding an AI agent to Insilico Medicine's Cheminformatics Engine, MolTools, through the MCP connector, the entire pipeline—standardization, custom filtering, and value-aware deduplication—runs from a handful of plain-language prompts instead of hours of RDKit and Pandas scripting. In this case study, that meant turning 1,003 raw PXR records into 971 curated, deduplicated, and fully documented compounds, with every removed structure and every merged value logged and explained. The result is a dataset that is not only smaller and model-ready, but demonstrably clean and fully auditable.

Ready to try it yourself? Reach out via petrina@insilicomedicine.com
Stay tuned, follow us on social media!