The kmerverse is a set of R packages for microbiome science, molecular epidemiology and microbial genomics that work together, from LIMS sample reports and raw sequencing reads to figures. Like the tidyverse, the kmerverse package itself does very little: it installs the member packages together, at versions known to work together, loads them all with a single library(kmerverse), and reports any functions that mask one another.
Website: https://bjklab.github.io/kmerverse/.
Installation
# install.packages("remotes")
remotes::install_github("bjklab/kmerverse")This installs kmerverse and all seven member packages from GitHub. Each package can also be installed on its own, e.g. remotes::install_github("bjklab/sylph2lab").
Some kmerverse functions run command-line tools (SRA Toolkit, sourmash, sylph, fmh-funprofiler, RGI) in conda environments that sra2lab sets up; see the sra2lab website for the conda requirements.
Usage
library(kmerverse)
#> ── Attaching kmerverse packages ──────────────────────── kmerverse 0.1.1 ──
#> ✔ lims2sra 0.3.1
#> ✔ sra2lab 0.2.6
#> ✔ smash2lab 0.2.0
#> ✔ sylph2lab 0.3.2
#> ✔ funprofiler2lab 0.1.1
#> ✔ rgi2lab 0.1.1
#> ✔ gtdb3h 0.1.1The member packages export no functions in common, so attaching them masks nothing among themselves; any conflicts with other attached packages are listed under “Conflicts”.
| Function | What it does |
|---|---|
kmerverse_packages() |
The member packages, in the order they are attached. |
kmerverse_conflicts() |
Functions of attached kmerverse packages that mask, or are masked by, functions of other attached packages. Printed by library(kmerverse). |
kmerverse_sitrep() |
Installed version of each member package against the version kmerverse requires (and, with check_github = TRUE, the latest on GitHub), with the command to update any that are behind. |
Set options(kmerverse.quiet = TRUE) to attach without the messages.
The packages
| Package | What it does |
|---|---|
| lims2sra | Combines, summarizes and plots LIMS sample reports (one row per aliquot), masks human reads with NCBI’s Human Read Removal Tool, and prepares BioSample and SRA metadata for submission. |
| sra2lab | Sets up conda environments for SRA download and k-mer based profiling, retrieves SRA and BioSample metadata for a BioProject, and runs sourmash, sylph, fmh-funprofiler and RGI on SRA runs or local reads, one sample at a time or streamed. |
| smash2lab | Reads, compares and plots sourmash FracMinHash sketches of isolates and metagenomes: timelines, hash heatmaps, and similarity matrices, ordinations and networks for tracking strains and suspected transmission. |
| sylph2lab | Aggregates sylph taxonomic profiles with sample metadata and GTDB taxonomy, and plots timelines, abundance heatmaps and single-taxon trajectories (raw or CLR). |
| funprofiler2lab | Aggregates fmh-funprofiler KEGG Orthology profiles with sample metadata and KEGG pathways, and plots KO and pathway heatmaps and single-feature trajectories. |
| rgi2lab | Aggregates RGI bwt read-mapping results against CARD, filters and normalizes them, and plots heatmaps of resistance genes, families, drug classes and mechanisms. |
| gtdb3h | Downloads and prunes the GTDB reference trees to the genomes in a sylph-profiled cohort, builds the phylogenetic covariance matrix for models fitted elsewhere, and plots taxon-level estimates on the tree. |
A typical study runs from lims2sra (what was collected, and its SRA submission) to sra2lab (download and profiling), then to smash2lab, sylph2lab, funprofiler2lab and rgi2lab (strains, taxa, functions and resistance genes), and to gtdb3h (taxon-level results on the phylogeny).
Why k-mers?
All of the kmerverse packages support analysis without genomic or contig assembly. We in the motionlab don’t hate assembly. We use and love lots of tools that have been built to support reference-based and de-novo assemblies, as well as tools for MAG construction: all have produced valuable insights into the questions we care about and have illuminated the mechanisms of pathogen spread, persistence, and resistance. But we are wary of assembly: every assembly is a model, with its own causal assumptions. And we sometimes find it difficult to build our own causal generative models on top of assembled genomic data that embeds many assumptions. So we’ve kept things simple with the kmerverse and favored tools that perform labeling, clustering, and categorization close to the raw-read data – the kind of data our studies typically produce.
Getting help
Please report bugs in kmerverse itself, or in how the packages work together, at https://github.com/bjklab/kmerverse/issues, and bugs in a single package at that package’s GitHub issues page.