Interactive tools for metagenome visualization and binning in R
R Perl

gbtools: Interactive tools for metagenome visualization and binning in R

Refer to the gbtools manual for detailed instructions.

Read the paper published in Frontiers in Microbiology


  • You can now specify custom colors for taxonomic markers in plots with the markCustomPalette= parameter in the plot function (v. 2.5.8)
  • Bug in Fastg-fishing script caused by inconsistent SPAdes header names has been fixed (v. 2.5.7)

Quick start

Here are the bare basics that you can do in gbtools, using the Olavius example data (look in the example_data/Olavius_metagenome folder in this package).

The following commands are all in the R environment.

1. Install gbtools

The tar.gz archive can be found in the R_source_package folder.

 > install.packages("sp") # Dependency
 > install.packages("plyr") # Dependency
 > install.packages("gbtools_2.4.5.tar.gz",repos=NULL,type="source")

2. Import data and see summary statistics

 > d <- gbt (covstats=c("SampleA2.covstats","SampleG1.covstats"), # Coverage data
 +           ssu="", # SSU gene annotations
 +           mark=c("",""), # Marker genes
 +           marksource=c("amphora2","blob")) # Names for the marker gene sets

See summary stats by typing name of the gbt object

 > d
 > summary (d) # same thing

3. Plot coverage vs. GC

 > plot (d, # Plots the first set of coverage data by default
 +       ssu=TRUE, # Annotate SSU genes with crosshairs
 +       textlabels=TRUE, # Add labels for SSU genes
 +       legend=TRUE) # Add legend for marker genes

Coverage-GC plot

4. Plot differential coverage

 > plot (d, slice=c(1,2)) # Plot one set of coverage data vs. another

Differential coverage plot

5. Interactively select bins from plot

 > plot (d,slice=1,marker=FALSE) # Turn off color overlays
 > d.bin1 <- choosebin (d, slice=1) # Click on the plot to define the region you want
 > summary(d.bin1) # Summarize the newly-created bin
 > points(d.bin1, slice=1) # Overlay the new bin on your plot

6. Import bins from 3rd party tools and plot them

 > d.metabat_bins <- importBins (d, file="metabat_bins")
 > multiBinPlot (d, bins=d.metabat_bins)

Multiple bin plot overlay

Each bin gets plotted in a different color

Getting help

Documentation for each function can be accessed in R by typing ? followed by function name at the command line (the gbtools plot function is filed under plot.gbt to distinguish it from the generic plot function).

Problems with using gbtools? Create a new issue using the GitHub issue-tracker on the right. Or send me an email, with "gbtools help" in the subject line.

Problems with input file formats? Read the appendix and use the script to check your input files.

Paper(s) using gbtools

Petersen et al. 2016. Nature Microbiology 2: 16195.

Drop me a message if I've overlooked your publication(s)!


Citation: Seah BK and Gruber-Vodicka HR (2015). gbtools: Interactive visualization of metagenome bins in R. Front. Microbiol. 6:1451. doi: 10.3389/fmicb.2015.01451

Cite dependencies if you use them:

Contact: Brandon Seah ( Department of Symbiosis, Max Planck Institute for Marine Microbiology