How domain expertise and agentic collaboration streamlined exploratory metagenomics while maintaining scientific rigor
Wastewater and Community Health Monitoring
What we flush down the toilet tells an extraordinary story, not merely about individual biology, but about the collective health of our communities. A sewer network functions as a continuously updated biological sensor across an entire population catchment. As early as 1887, researchers at the Lawrence Experiment Station north of Boston systematically analyzed wastewater to evaluate bacterial water quality. Over the ensuing century, environmental water sampling became a cornerstone of public health surveillance, monitoring bacterial diseases such as typhoid and viral pathogens such as poliovirus. More recently, wastewater surveillance provided critical early warnings during the COVID-19 pandemic and is providing signals on the re-emergence of measles in the United States.
Throughout my career as an evolutionary biologist and epidemiologist, I have seen how conventional public health reporting remains constrained by healthcare-seeking behavior and clinical diagnostic access. Wastewater surveillance offers an elegant, non-invasive alternative: it captures transmission signals from symptomatic and asymptomatic individuals alike across potentially millions of residents. Historically, this surveillance required culturing specific organisms in the laboratory or deploying targeted assays designed for known targets. Today, high-throughput metagenomic sequencing captures fragments from all genetic material present in an environmental sample, enabling the detection of unexpected and emerging pathogens. For instance, wastewater metagenomics recently succeeded in identifying a single case of measles in Cook County, Illinois, across a catchment area of over one million residents. Laboratory kits can enrich samples for broad categories of organisms of interest, allowing even viruses at a low frequency in the sample to be detected.
Yet data abundance does not automatically translate into public health understanding. Metagenomic sequencing produces vast, fragmented, and noisy datasets. Sifting through billions of short genomic reads from an environmental sample and comparing them against sprawling reference databases presents formidable computational hurdles and substantial analytical friction. When interpreting signals present at a low frequency in a sample, the context has to be taken into account, as there is a risk that the sample has been contaminated during laboratory processing.
This blog describes how I used the Microsoft Discovery app to accelerate public health and environmental insights from a large metagenomic study, while remaining grounded in the scientific literature and being methodical in the choice of tools and how they are coordinated to provide auditable, interpretable results.
The Era of Big Data and Metagenomics
To address the initial computational bottleneck of metagenomics, our team, Microsoft Premonition, has developed a metagenomic processing service, Premonition Insights. Insights leverages massively parallel workflows on Microsoft Azure to compare raw environmental sequences against comprehensive databases of all known organisms. It uses advanced statistical models to resolve ambiguous sequence alignments and filter taxonomic noise. In partnership with academic collaborators, Insights has been applied across diverse biological samples, including human blood, mosquitoes, rodents, and bats.
However, even after cloud services process terabytes of FASTQ files into structured taxonomic tables, the human expert faces a secondary, laborious bottleneck: exploratory scientific interpretation. In the case study discussed below, Premonition Insights distilled raw environmental sequencing data into a 6 GB table containing approximately 7.5 million candidate matches across hundreds of samples, each annotated with taxonomic lineages, probabilistic match scores, coverage statistics, sample dates, and collection locations.
As any computational biologist knows, turning a 7.5-million-row table into defensible epidemiological insights normally requires substantial manual effort. A researcher must write custom data-wrangling scripts, resolve Python and R environment dependencies, query external environmental and meteorological APIs, configure specialized command-line phylogenetic software, filter false positives, and construct visualizations to inspect patterns. This friction often fragments an expert's focus across software engineering and data plumbing rather than epidemiological reasoning.
Accelerating Insights with Domain Expertise and AI Agents
To streamline this exploratory phase, I utilized the Microsoft Discovery app, a localized experience of the Microsoft Discovery platform that enables domain experts to configure and orchestrate collaborating AI agents across complex scientific workflows. Crucially, the Discovery app, as well as the cloud-based platform, is not designed to replace human judgment or automate epidemiological conclusions. Environmental metagenomics is too nuanced and sensitive for autonomous “black box” automation; it demands subject-matter expertise to help distinguish authentic biological signal from sequence artifacts, sample contamination, and environmental background noise, and to suggest further confirmatory laboratory and epidemiological analyses.
Working with Discovery requires meaningful scientific steering. The platform has real but useful friction: curating the Scientific Bookshelf, looking over agent tasks, getting the evaluation rubrics right, and knowing what assumptions and trade-offs were made at critical analytical junctures. As a domain expert, my role was to formulate the epidemiological hypotheses, curate relevant wastewater virology literature, establish quality rubrics, and critically evaluate intermediate outputs. Meanwhile, Discovery's collaborating agents assisted with data preparation, environment configuration, code synthesis, API integration, and interactive visualization. As a consequence of working with Discovery, you can generate documentation of how you work, interpret data, use your favorite tools, and more. Capturing this know-how is especially important when working in large collaborative teams, for reproducibility, as well as for training and educational purposes.
Using the Discovery app, I completed an exploratory analysis workflow. Agents assisted with data preparation, software setup, visualization, and hypothesis generation, while I remained responsible for scientific interpretation and conclusions. After familiarizing myself with the platform, I estimate that it took me less than half a day, most of which was spent setting up the workflow and reviewing the outputs. This substantial reduction in manual analysis effort demonstrated how agentic assistance can amplify domain expertise across multidisciplinary tasks, as well as turn interactive scientific inquiry into a structured set of tasks leading to outcomes.
Scenario Deep Dive: Environmental Viromes in Gujarat, India
To evaluate this collaborative workflow on a real-world dataset, I examined publicly available environmental surveillance sequencing data from Gujarat, India (BioProject PRJEB102331), originally collected and published by regional researchers. This is a large, high-quality metagenomic dataset, with over 500 wastewater samples gathered from four cities over the course of a year, with separate processing of RNA and DNA to generate over 1,000 sequencing libraries, with enrichment for viruses. My analytical objective was to characterize the prevalence and seasonal dynamics of waterborne enteric viruses that cause gastrointestinal illness.
Within the Discovery app, the exploratory investigation unfolded across five interconnected analytical stages:
- Literature Context & Bookshelf Setup: I seeded Discovery's Scientific Bookshelf with peer-reviewed publications on wastewater epidemiology, enterovirus taxonomy, and local hydrological surveillance. This gave the agents grounding in the domain to help the subsequent code generation and anchor the terminology used. To blind the analysis to the conclusions of the original study, the scientific manuscript describing the study was omitted from the Bookshelf, helping to ensure that the AI agents operating within Discovery were not simply taking a shortcut and copying and pasting results.
- Data Preparation & Taxonomic Filtering: I directed the agents to parse the 7.5-million-row Premonition Insights summary table. Guided by explicit rubrics and domain filtering criteria, the agents wrote Python routines to isolate matches corresponding to recognized genera of gastrointestinal and waterborne viruses.
- Meteorological Data Integration: To investigate climatic drivers of viral presence, the agents connected to the external Open-Meteo API, programmatically retrieving historical daily rainfall and temperature records corresponding to the geographic coordinates and sampling dates in Gujarat.
- Comparative Environmental Dynamics: The agents synthesized the genomic and meteorological datasets, generating comparative statistical summaries.
- Bioinformatics, Phylogenetics & Dynamic Visualization: To evaluate whether detected enterovirus sequences represented circulating field strains or taxonomic ambiguities, the agents configured local bioinformatics tools, aligned sample consensus sequences against reference enterovirus genomes, and built phylogenetic trees. Like most scientists working with bioinformatics pipelines, I have my own favorite tools to use, such as MAFFT for sequence alignment and IQ-TREE for reconstructing trees (although other great tools are available). I asked the agents to build pipelines around those tools. In addition to static charts, the agents generated dynamic HTML dashboards incorporating interactive visual components using Jowna, Plotly.js, and phylotree.js, enabling immediate visual inspection of temporal trends and evolutionary branching.
Through an interactive chat with the app, I created a list of tasks, each leading to a separate outcome. For each of these outcomes, the app helped to create a rubric to identify specific criteria for accuracy and robustness, as well as graders to assess whether the generated outcomes met those criteria.
Figure 1. Widgets illustrating the tasks involved in the wastewater analysis and the generated outcomes. These can be directly input into the widget or may emerge during unstructured, interactive chats.Collaborative Breakdown of the Exploratory Workflow
| Workflow Phase | Domain Expert Role | Discovery Agent Role | Tools & Artifacts |
|---|---|---|---|
| Literature & Context Setup | Curated wastewater virology papers, established the analysis scope, and set quality rubrics. | Indexed papers in the Scientific Bookshelf and extracted relevant domain parameters and terminology. | Scientific Bookshelf Markdown rubrics |
| Data Extraction & Filtering | Specified virus families of interest and defined filtering thresholds. | Wrote and executed data-wrangling scripts to reduce the 7.5-million-row table to target viral genera. | Python Pandas Polars |
| Meteorological Integration | Hypothesized seasonal and monsoon drivers and identified the required weather metrics. | Constructed an API client, retrieved historical rainfall and temperature data for Gujarat, and merged the environmental and genomic datasets. | Open-Meteo API Geo-merging |
| Bioinformatics & Phylogenetics | Formulated an enterovirus verification plan and inspected tree topologies for biological plausibility. | Installed local sequence-alignment and tree-building tools and constructed phylogenetic trees against GenBank references. | MAFFT IQ-TREE GenBank |
| Dashboard & Visualization | Evaluated visual outputs, checked outlier points, and verified spatial patterns between drain and river samples. | Created a responsive web dashboard with synchronized time-series charts and an interactive phylogenetic tree viewer. | Jowna Plotly.js phylotree.js HTML5 |
Defensible Scientific Findings and Responsible Interpretation
The exploratory analysis revealed compelling biological patterns across the environmental dataset. Across the waterborne viral genera identified, rotavirus and adenovirus exhibited the highest relative abundance and widespread persistence across sampling sites (Figure 1). Both pathogens represent major contributors to pediatric gastrointestinal illness globally and regionally. When temporal signals were correlated with meteorological data, multiple enteric viruses, such as norovirus, displayed pronounced abundance peaks in September, aligning with the late portion of the regional monsoon season, which runs from June through September (Figure 2).
Figure 2. Counts of contiguous sequences (“contigs”) generated by assembling short reads that matched common gastrointestinal viruses.Figure 3. Dynamics over time of common gastrointestinal viruses.
A critical test of the workflow arose regarding enteroviruses and poliovirus. The automated taxonomic scan detected low background levels of non-polio enteroviruses, which were subsequently verified through agent-generated phylogenetic trees comparing sample sequences against reference viral genomes (Figure 4). Of particular interest are the closely related clusters of sequences, which may represent a local outbreak and suggest the need for further epidemiological investigation. However, no poliovirus was detected in these samples. This finding is consistent with successful regional control efforts, although additional epidemiological evidence would be required to assess specific drivers.
Figure 4. Phylogeny of sequences corresponding to enteroviruses identified in the samples.
One of the stated advantages of metagenomics is the ability to detect unexpected signals that may be overlooked by targeted approaches. For example, two separate samples from two cities in July 2024 were positive for Chandipura virus, a rare but virulent vector-borne virus thought to be mainly spread by sandflies. This raises the question of whether this is a real signal. The fact that two samples were positive from different cities makes it less likely that this was due to contamination. That the samples were taken in July 2024, when sandflies are active, and that a large outbreak of Chandipura virus was reported in Gujarat at the time lends further support to this being a real signal.
The enterovirus and Chandipura virus examples highlight the importance of humans in evidence synthesis in AI-assisted workflows. The Discovery platform makes it easier to integrate multiple datasets and helps to contextualize the results, but, as is typical with scientific workflows, more questions are raised than answered. For example, how much poliovirus transmission could be occurring without it being observed in wastewater? Mathematical models can help us think about this more deeply. Are the matches to Chandipura virus real? While the circumstantial evidence surrounding the epidemiological context may be convincing, an independent laboratory analysis of the positive samples to generate full genomes of these viruses would lend further biological evidence. The “lab-in-the-loop” is becoming an important paradigm for scientific discovery, integrating human domain expertise, AI automation, and wet-lab biology.
Horizontal Capability: Empowering the Scientist at the Frontier
What makes this investigation compelling is not solely the specific viral dynamics observed in Gujarat, but what it reveals about a horizontal capability for scientific discovery. In conventional workflows, the sheer friction of software engineering creates substantial drag on exploratory research.
The Microsoft Discovery app addressed this friction by serving as a multidisciplinary accelerator. Importantly, this success rests on a clear separation of concerns:
- Platform Capabilities: Discovery managed multi-agent coordination, contextual retrieval from the Scientific Bookshelf, safe local code generation, and visualization assembly.
- Custom Workflow Engineering: Modular scripts and API integrations were synthesized specifically for the dataset's unique schema, metadata, and bioinformatics requirements.
- Human Domain Judgment: As the scientist, I formulated the questions, curated the literature, defined analytical constraints, reviewed assumptions, and interpreted the results within established epidemiological principles.
To ensure full scientific transparency and reproducibility, the software versions, analytical prompts, rubrics, and workflow scripts utilized throughout this exploration are stored within a structured workspace generated by the Discovery app. This ensures that peer researchers can inspect, evaluate, and reproduce the agent-assisted workflow on comparable metagenomic datasets.
At a moment when public health challenges demand rapid responsiveness while preserving accountability, and biological datasets grow exponentially, agent-assisted exploratory platforms offer a transformative path forward. By handling mechanical data wrangling while keeping domain experts firmly in command, Discovery enables scientists to spend more time doing what matters most: generating defensible insights that protect human communities.
About the Author
Simon Frost
Simon Frost is a Principal Scientist at Microsoft Discovery & Quantum and Microsoft Premonition, and Professor of Pathogen Dynamics at the London School of Hygiene & Tropical Medicine. He holds an Sc.D. from the University of Cambridge and a D.Phil. in Mathematical Biology from the University of Oxford. With over 25 years of research in infectious disease dynamics, viral genomics, and molecular epidemiology, his work focuses on integrating real-time biological data with computational and AI models to enhance our understanding of the emergence and spread of global pathogens.