From Custom Pipeline to Scalable Software: Assembling Complete Bacterial Genomes From Long and Hybrid Reads with Hybracter

Posted on May 13, 2024   by George Bouras

George Bouras takes us behind the scenes of their latest publication 'Hybracter: enabling scalable, automated, complete and accurate bacterial genome assemblies' published in Microbial Genomics.

hybracter_image_blog main image.png
Generated by Vijini Mallawaarachchi using the Dall-E 2 text-to-image AI model.

I am George Bouras, a bioinformatician and PhD Student in the ENT surgery group at University of Adelaide and the Basil Hetzel Institute for Translational Health Research in Adelaide, Australia. I also work closely with the Flinders Accelerator for Microbiome Research at Flinders University, also in Adelaide. I work on bioinformatics tool development for phage and bacterial genome assembly, polishing and gene annotation. I also apply the tools to analyse wet-lab data generated by my colleagues in areas such as phage therapy, the microbiomes of chronic rhinosinusitis and head and neck cancer and viral metagenomics.

Hybracter started because I had to assemble a few hundred hybrid Nanopore long- and Illumina short-read sequenced Staphylococcus aureus genomes generated by my co-author Ghais Houtak from chronic rhinosinusitis patients (some now published as part of our study in Microbial Genomics). To do this, like everyone conducting bacterial genome assembly should do, I read the entire back catalogue publication list, blog and tutorial of my co-author Ryan Wick, who is without doubt the world’s utmost expert in the field of bacterial genome assembly. Ryan was then recommending switching to a long-read first assembly with short-read polishing approach for hybrid assemblies. This is in contrast to the prevailing gold standard, his tool Unicycler, which conducts a short-read assembly and then uses long-reads to resolve repeats.

However, no one had made an automated long-read assembly tool or pipeline to do this that considered plasmids. The problem, I quickly found out, was that, as summarised by this paper published last year in Microbial Genomics by Johnson et al.: ‘Long-read assemblers struggle to assemble small plasmids’. So, you had to do a short-read first assembly with Unicycler anyway, which was slow and unnecessarily assembled the chromosome too. And Staphylococcus aureus has a lot of small plasmids!

Accordingly, I developed Hybracter as a pipeline that would separate the assembly of plasmids and chromosome – the plasmids would be assembled using Plassembler, a tool I developed for fast targeted plasmid assembly, while the chromosome would be assembled with Flye, a fast and accurate long-read assembler. Crucially, I managed to figure out, with Ryan’s help, that one could accurately recover small plasmids even from long-reads alone if you tricked Plassembler (which uses Unicycler under the hood) to pretend the long-reads were both short- and long-reads – this “solved” the small plasmid issue. This was a very happy day in the lab! I also built a few other tools and modules, such as Dnaapler (for reorienting the chromosome and plasmids) and Pypolca, a modern and improved re-implementation of the short-read polisher POLCA, which was recommended by Ryan in his masterful tutorial. 

Hybracter first began as a local Snakemake pipeline for my own use (this earlier iteration is described in the supplements and methods of our CRS paper), but it was clear (with some encouragement from Ghais) that if I put some more time and effort into software development, maintenance and robustness, it could be widely useful for the microbial genomics community. A real crucial moment here was when my co-author Vijini Mallawaarchchi gave me a two-hour master-class on software development and testing – I quickly adopted many of the best practices she taught me into Hybracter and my other software tools. Hybracter therefore quickly graduated from a local pipeline into a fully-fledged software package, with support for long-read only assemblies.

Going forward, I hope Hybracter becomes a useful tool for the community, particularly as we enter an age of near-perfect and cheap long-reads. Under the hood, Hybracter leverages the scalability benefits of the Snakemake workflow manager to efficiently scale to massive datasets that are increasingly being generated with long-read isolate data, while wrapping it in a simple command-line interface that most users of bioinformatics software are used to. We have also made it easy to use for bioinformatics beginners with options like no-code Google Colab notebooks.

I particularly think Hybracter will be most useful for anti-microbial resistance gene and plasmid research, as it will enable a large expansion of the amount of accurate and complete plasmid sequences. I really think this area will continue to explode as long-read sequencing improves and becomes cheaper. Inferring plasmid transmission and epidemiology is much easier (though still not easy!) if you can just get the whole plasmid sequence, rather than making inferences from short reads alone.

Eventually, I actually hope Hybracter becomes redundant — this probably will be when long-reads are essentially perfect and nearly costless to generate (at least at the bacterial genome scale). We will then be able to apply much simpler algorithms to automatically generate perfect assemblies at scale. The problem will then move onto consistently generating complete genome assemblies from metagenomic data — but one step at a time!