← All case studies ◆ Clinical diagnostics · Bioinformatics

Pathogen detection pipeline for Lyme disease diagnostics

Umbizo rebuilt a clinical diagnostics team's pipeline for detecting Borrelia and 53 other Lyme-associated pathogens in blood, urine, and cerebrospinal fluid samples, targeting accuracy, contamination control, and co-infection detection.

Coloured electron micrograph of bacteria on a cell surface

The challenge

The team needed to fix limitations affecting diagnostic accuracy. The key issues were managing highly fragmented DNA in urine samples, separating true pathogen signals from contamination, and detecting co-infections without losing specificity. The clinical goal was to monitor responses to provocative therapy, which is intended to push latent Lyme infections into a detectable active state.

What we set out to do

  • Review the legacy pipeline architecture and identify limits on diagnostic performance
  • Improve detection sensitivity while keeping clinical specificity
  • Expand the reference database with post-2019 strain discoveries and international variants
  • Add comprehensive BLAST analysis for ambiguous sequence identifications
  • Add stronger low-complexity read filtering to reduce technical noise
  • Build automated workflow infrastructure with parallel processing
  • Design contamination detection protocols for sample quality assurance

Our approach

Data architecture analysis

Assessed the legacy pipeline, which processed 762 amplicon targets across 53 pathogenic species including Borrelia burgdorferi, Babesia, Bartonella, Ehrlichia, Anaplasma, and tick-borne viruses. Ran off-target binding analysis via BLAST, found low-complexity read contamination of long AG and CT tandem repeats, and evaluated concordance problems with Western Blot serology.

Technical implementation

Rewrote the full workflow in Python using the Pysam package for SAM/BAM processing, added stringent tandem-repeat filtering, applied stricter fastp quality parameters beyond the legacy Q20/Q30 thresholds, integrated the NCBI BLAST API for reads with alignment scores below 40, and configured SLURM for parallel sample processing and concurrent BLAST queries.

Alignment and confidence scoring

Developed R scripts for interpreting BLAST results and producing clinical reports, kept dual-threshold host depletion against hg38 (MAPQ ≥ 30 and alignment score < 30), and added multi-region alignment confidence scoring requiring concordant hits across multiple amplicon targets.

Solution delivery

Created a three-tier reporting system (confirmed matches, potential matches needing BLAST validation, and novel strain detection), built automated flagging for Enterococcus and other non-target species, configured Apache Airflow for hourly scheduled workflows, deployed provisional infrastructure on an AWS EC2 instance, and deposited the documented codebase in a GitHub repository.

Results and impact

After low-complexity filtering the mapping rate rose from 5-10% to 40%, a 400% improvement. Pathogen coverage was extended to international Borrelia species complex members, and temporal coverage was extended by six years to include post-2019 strains. Confidence tiers were defined: high confidence (alignment score ≥ 40, ~98% positive predictive value) and medium confidence (30 ≤ AS < 40, requiring ≥ 2 amplicons). BLAST integration widened detection beyond the local reference database, and contamination detection now flags sample integrity issues that need reprocessing.

“The updated PathoDNA pipeline is a significant step forward in addressing the complex diagnostic challenges of Lyme disease. The BLAST integration, quality filtering, longitudinal tracking, and contamination detection have all made a real difference.”

Client Clinical Diagnostics Team

Timeline

  • Legacy pipeline assessment and issue identification: 2 weeks
  • Off-target analysis and database updates: 1 week
  • Core Python rewrite with Pysam integration: 2 weeks
  • BLAST API integration and R script development: 1 week
  • Quality control enhancement and low-complexity filtering: 1 week
  • SLURM configuration and automation infrastructure: 1 week
  • Reporting system and visualisation: 1 week
  • Documentation and GitHub preparation: 1 week
  • Total: 10 weeks

Looking forward

Validating the pipeline for the Laboratory Developed Test regulatory pathway (analytical validation, precision and accuracy studies, clinical utility documentation), running longitudinal studies correlating molecular results with clinical outcomes, extending to additional tick-borne pathogens, and exploring machine learning for co-infection pattern recognition and treatment response prediction.