Python for Data

From Medical Charts to Modern Code: How a Glasgow Gastroenterologist Built Foundry120 to Solve Big Data’s Healthcare Crisis

The modern practice of medicine is increasingly defined not just by stethoscopes and surgical tools, but by petabytes of complex biological data. For clinical researchers navigating the intersection of patient care and molecular science, data management has historically presented a daunting administrative bottleneck. This challenge became starkly apparent in 2020, when Dr. Shaun Chuah, a gastroenterologist and clinical researcher at the University of Glasgow, calculated the logistical scope of a new inflammatory bowel disease (IBD) study. Confronted with the prospect of tracking 30,000 biological samples collected across multiple cities and dozens of hospitals over a two-year period, Chuah discovered that the industry standard for managing such critical research remained surprisingly rudimentary: Microsoft Excel.

With little prior programming experience beyond writing raw HTML in Notepad during his high school years, Chuah undertook a self-taught journey into software development. That initial decision to open a Django tutorial eventually catalyzed the creation of Foundry120, a specialized research operating system. Six years later, the platform manages 10 terabytes of clinical and genomic data, powered by an advanced agentic artificial intelligence layer designed to accelerate translational science.

The Genesis of a Clinical Data Crisis

In 2020, as healthcare systems worldwide strained under the pressures of the COVID-19 pandemic, clinical researchers like Chuah faced concurrent operational hurdles. The specific study in question—focused on inflammatory bowel diseases such as Crohn’s disease and ulcerative colitis—required recruiting roughly 200 participants and tracking them at three-month intervals. At each milestone, researchers planned to harvest multiple biological specimens, including blood, stool, and saliva samples.

When multiplied across the timeline and participant base, a back-of-the-envelope calculation revealed an estimated aggregate of 30,000 samples. When Chuah consulted peers about managing this massive influx of biological material, the prevailing answer was disheartening: decentralized spreadsheets. While enterprise-grade laboratory information management systems (LIMS) existed, they were cost-prohibitive, designed primarily for high-throughput hospital operations rather than bespoke academic research, and frequently required months of cumbersome procurement and implementation.

Recognizing that off-the-shelf software would create a square-peg-round-hole scenario, Chuah opted to build a custom web application using Python and the Django framework. Armed with documentation, online video tutorials, and foundational programming texts like "Two Scoops of Django," "Test-Driven Development with Python" (popularly known as "Obey the Testing Goat!"), and Martin Kleppmann’s "Designing Data-Intensive Applications," Chuah began constructing a purpose-built digital infrastructure from the ground up.

Scaling Up: From Sample Tracking to Terabyte Management

What began as a simple mechanism to track QR-coded sample vials moved between hospital freezers and processing labs soon evolved into a comprehensive data repository. As experimental samples underwent laboratory assays—ranging from microbiome sequencing of stool specimens to cell-free DNA (cfDNA) and genotyping from blood draws—the volume of resulting data expanded exponentially.

A single genomic sequencing file for an individual participant can routinely span 5 to 10 gigabytes. Across thousands of samples, data management quickly outgrew local hard drives and university file shares, which traditionally enforced rigid storage quotas. To accommodate this computational weight, the infrastructure migrated entirely to Microsoft Azure Blob Storage, trading restrictive storage caps for scalable cloud architecture. Today, Foundry120 houses roughly 10 terabytes of clinical, radiological, endoscopic, and genomic data, functioning as a centralized platform for translational research teams.

The Integration of Agentic AI

As the repository expanded, data retrieval and cross-referencing emerged as new operational bottlenecks. Joining clinical metrics with complex genomic and microbiome data typically required manual database queries and custom data-wrangling scripts—a process that could consume days of valuable research time.

To resolve this, Chuah and his collaborators integrated an agentic AI system named Helix. Unlike traditional conversational chatbots that function primarily as a specialized search engine, an agentic AI operates within a goal-oriented execution loop. When a researcher poses a natural language query—such as requesting all plasma samples from patients treated with a specific therapeutic agent—Helix analyzes its available toolset, writes necessary Python code in a secure virtual machine sandbox, executes database joins, and returns the synthesized results or data visualizations.

This approach transforms the role of the researcher from a manual data-wrangler into a scientific supervisor. Rather than spending weeks writing exploratory scripts, researchers can direct the AI agent to execute routine analyses, provided the output passes rigorous scientific validation and institutional verification checks.

Governance, Security, and Compliance in Clinical AI

Deploying artificial intelligence within medical research requires strict adherence to data governance, patient privacy laws, and ethical frameworks such as institutional review board (IRB) approvals, HIPAA in the United States, and GDPR compliance in Europe and the United Kingdom.

Foundry120 addresses these requirements through a secure, multi-layered architecture. Rather than permitting AI models unrestricted access to raw data or external endpoints, the application acts as a secure intermediary. Role-based access controls (RBAC) are strictly enforced at the database and API levels, ensuring the AI can only interact with datasets authorized for a specific user. Furthermore, all data processing and model inference are executed within dedicated institutional cloud tenancies—predominantly utilizing regional Azure data centers in the UK and Sweden—ensuring compliance with local data residency mandates.

Implications for the Future of Translational Science

The evolution of Foundry120 from a solitary physician’s workaround into a sophisticated research operating system highlights a broader paradigm shift within academic medicine. As biological assays generate increasingly granular, high-dimensional data—with future technologies projected to produce up to a terabyte of data per single biological sample—traditional data management practices are rapidly becoming obsolete.

While the upfront computational and cloud storage costs associated with large-scale genomics and agentic AI remain substantial, the long-term efficiency gains offer a compelling economic and scientific justification. By democratizing access to complex data pipelines and automating routine exploratory workflows, platforms built on flexible, robust frameworks like Python and Django demonstrate how clinicians and researchers can harness modern software engineering to accelerate breakthroughs in chronic disease research.

Related Articles

Back to top button
Whatvis
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.