Introduction

This report documents the initial genome extraction of Candidatus Propionivibrio aalborgensis in Albertsen et al., 2016: “Candidatus Propionivibrio aalborgensis”: a novel glycogen accumulating organism abundant in full-scale enhanced biological phosphorus removal plants.

Load the mmgenome package

In case you haven’t installed the mmgenome package, see the Load data example.

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: Holmes. Hence, here we import the prepocessed data from figshare instead.

load("Holmes.RData")

Data overview

The object d contains information on scaffolds and essential genes within the scaffolds. For each scaffold the dataset contains the following information: The columns H09.06, H11.05, H11.25, H12.13 and H12.09 contain the coverage information from 5 different samples; PC1, PC2 and PC3 contain coordinates of the three first principal components from a PCA analysis on tetranucleotide frequencies; essential contain information taxonomic information for each scaffold based on classification on essential genes; rRNA contain taxonomic information on scaffolds that have an associated 16S rRNA gene; pps_xxx contain taxonomic information obtained using PhyloPythiaS+.

colnames(d$scaffolds)
##  [1] "scaffold"   "length"     "gc"         "H09.06"     "H11.05"    
##  [6] "H11.25"     "H12.13"     "H12.19"     "PC1"        "PC2"       
## [11] "PC3"        "essential"  "rRNA16S"    "pps_phylum" "pps_class" 
## [16] "pps_order"  "pps_family" "pps_genus"

The basic statistics of the full dataset can be summarised using the mmstats function.

mmstats(d, ncov = 5)
##                 General Stats
## n.scaffolds          30725.00
## GC.mean                 48.20
## N50                   2951.00
## Length.total      50450465.00
## Length.max          230584.00
## Length.mean           1642.00
## Coverage.H09.06          0.31
## Coverage.H11.05          1.92
## Coverage.H11.25        253.90
## Coverage.H12.13         48.17
## Coverage.H12.19         28.32
## Ess.total              794.00
## Ess.unique             108.00

Propionivibrio

The combination of the coverage of sample H11.25 and H11.05 provides the cleanest separation of the two genomes and are used for binning.

p <- mmplot(data = d, x = "H11.25", y = "H11.05", log.x = T, log.y = T, color = "essential", minlength = 3000)

#p
#sel <- mmplot_locator(p)

sel <- data.frame(H11.25  =  c(847, 2350, 7530, 8550, 2450, 974),
                  H11.05  =  c(12.1, 46.2, 94.9, 64.7, 11.2, 6.7))

mmplot_selection(p, sel) +
  theme(axis.line.x = element_line(), 
        axis.line.y = element_line())

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 = 5)
##                 General Stats
## n.scaffolds            349.00
## GC.mean                 57.20
## N50                  22721.00
## Length.total       3686938.00
## Length.max           87050.00
## Length.mean          10564.30
## Coverage.H09.06          0.42
## Coverage.H11.05         19.57
## Coverage.H11.25       1710.22
## Coverage.H12.13        318.12
## Coverage.H12.19         85.82
## Ess.total               97.00
## Ess.unique              92.00

Using paried-end connections

Until now we have just used coverage profiles to extract scaffolds related to our genome of interest. However, some scaffolds might be present in many copies (repeats) and hence have a much higher coverage than the rest of the genome. In addition, some scaffolds will by chance have a slightly different coverage profile than the rest of the genome and thereby also be missed.

The function mmplot_network can be used to generate a network plot of scaffolds connected by paired-end reads. We start by plotting the scaffolds we have in our current subset.

mmplot_network(data = dA, network = pe, color = "H11.25", nconnections = 10, log.color = T)

To include repeats and other missed scaffolds we simply extract all scaffolds that are directly connected by paired-end reads to our current subset dB using mmextract_network. Only scaffolds directly connected to the subset is extracted.

dB <- mmextract_network(subset = dA, original = d, network = pe, nconnections = 10, type = "direct")

Subspace extraction 2

We finally remove the low abundant scaffolds that were included using the paired-end data.

p <- mmplot(data = dB, x = "H11.25", y = "H11.05", log.x = T, log.y = T, color = "essential")

#p
#sel <- mmplot_locator(p)

sel <- data.frame(H11.25  =  c(787, 1430, 16600, 20300, 2320, 1020),
                  H11.05  =  c(12.6, 76.5, 289, 140, 8.38, 8.08))

mmplot_selection(p, sel) +
  theme(axis.line.x = element_line(), 
        axis.line.y = element_line())

Extract the scaffolds in the selection.

dC <- mmextract(dB, sel)

Look at the basic stats.

mmstats(dC, ncov = 5)
##                 General Stats
## n.scaffolds            346.00
## GC.mean                 57.20
## N50                  22721.00
## Length.total       3687511.00
## Length.max           87050.00
## Length.mean          10657.50
## Coverage.H09.06          0.43
## Coverage.H11.05         19.97
## Coverage.H11.25       1734.26
## Coverage.H12.13        324.06
## Coverage.H12.19         87.20
## Ess.total               97.00
## Ess.unique              92.00

Export the scaffolds

Now that we are happy with the genome bin, the scaffolds can be exported to a separate fasta file using mmexport.

mmexport(data = dC, assembly = assembly, file = "propionivibrio.fa")