Introduction

This report documents the binning of a Nitrospira genome from the GWW sample. See Daims et al., 2015: Complete Nitrification by Nitrospira Bacteria for further details.

Load the mmgenome package

The metagenome data is analysed using the mmgenome package.

library("mmgenome")

Import data

The Rmarkdown file Load_data.Rmd describes the loading of the data and can be imported using the mmimport function. However, the preprocessed data can also be downloaded directly from figshare: Daims_GWW. Hence, here we import the prepocessed data from figshare instead.

load("Daims_GWW.RData")

Extract Nitrospira 5

As seen from the overview plots, there are numerous Nitrospira species. This one is located between multiple other species.

p <- mmplot(data = d,
            x = "HPD", 
            y = "HPF1", 
            color = "essential", 
            minlength = 1000,
            factor.shape = "solid") +
  scale_x_log10(limits=c(5, 50)) +
  scale_y_log10(limits=c(50, 200))

#p
#sel <- mmplot_locator(p)

sel <- data.frame(HPD  =  c(6.99, 6.89, 12.7, 21.3, 29.3, 22.1, 11.3),
                  HPF1  =  c(123, 91.8, 78.4, 80.7, 110, 153, 151))

mmplot_selection(p, sel)

The scaffolds included in the defined subspace are extracted using the mmextract function.

dA <- mmextract(d, sel)

The mmstats function applies to any extracted object. Hence, it can be used directly on the subset.

mmstats(dA, ncov = 2)
##               General Stats
## n.scaffolds         1215.00
## GC.mean               54.60
## N50                 6720.00
## Length.total     5568348.00
## Length.max         42005.00
## Length.mean         4583.00
## Coverage.HPD          16.71
## Coverage.HPF1        105.41
## Ess.total            188.00
## Ess.unique           100.00
mmplot_pairs(data = dA, 
             variables = c("HPD", "HPF1","gc", "PC1", "PC2", "PC3"), 
             minlength = 5000, 
             color = "essential")

Clean-up other species (Subset B)

We do a another selection to remove other Nitrospira scaffolds that were included.

p <- mmplot(data = dA,
            x = "PC1", 
            y = "PC2", 
            color = "essential", 
            minlength = 1000)
#p
#sel <- mmplot_locator(p)

sel <- data.frame(PC1  =  c(-0.0593, -0.00267, 0.0788, 0.123, 0.0856, -0.0366),
                  PC2  =  c(-0.0948, -0.0467, -0.0439, -0.108, -0.216, -0.216))

mmplot_selection(p, sel)

The scaffolds included in the defined subspace are extracted using the mmextract function. A few scaffolds are excluded based on network plots.

dB <- mmextract(dA, sel, exclude = c("9076", "19430"))

The mmstats function applies to any extracted object. Hence, it can be used directly on the subset.

mmstats(dB, ncov = 2)
##               General Stats
## n.scaffolds          900.00
## GC.mean               55.50
## N50                 7151.00
## Length.total     4435667.00
## Length.max         42005.00
## Length.mean         4928.50
## Coverage.HPD          14.77
## Coverage.HPF1        104.31
## Ess.total            151.00
## Ess.unique            97.00

Export the scaffolds

Finally the binned scaffolds are exported.

mmexport(data = dB, assembly = assembly, file = "GWW_Nitrospira5.fa")