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 6

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(20, 120)) +
  scale_y_log10(limits=c(20, 100))

#p
#sel <- mmplot_locator(p)

sel <- data.frame(HPD  =  c(83.2, 61.8, 55.5, 62.3, 80.7, 102, 104),
                  HPF1  =  c(60.2, 46.3, 37.7, 32.6, 33.7, 50.7, 64.5))

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         1326.00
## GC.mean               55.30
## N50                 6226.00
## Length.total     5771838.00
## Length.max         45137.00
## Length.mean         4352.80
## Coverage.HPD          70.44
## Coverage.HPF1         42.39
## Ess.total            157.00
## Ess.unique            91.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.0636, -0.0289, 0.0449, 0.106, 0.0812, 0.00744, -0.052),
                  PC2  =  c(-0.0562, -0.0228, -0.0356, -0.0895, -0.164, -0.191, -0.151))

mmplot_selection(p, sel)

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

dB <- mmextract(dA, sel)

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         1021.00
## GC.mean               57.70
## N50                 6382.00
## Length.total     4615352.00
## Length.max         45137.00
## Length.mean         4520.40
## Coverage.HPD          72.06
## Coverage.HPF1         42.46
## Ess.total            114.00
## Ess.unique            79.00

Export the scaffolds

Finally the binned scaffolds are exported.

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