# Unicycler Assembly

### Overview

question Questions
• I have short reads and long reads. How do I assemble a genome?

objectives Objectives

• Perform a Small genome Assembly with Unicycler

• Evaluate the Quality of the Assembly with Quast

• Annotate the assembly with Prokka

requirements Requirements
time Time estimation: 4 hours
level Level: Introductory level level level
Supporting Materials
last_modification Last modification: Mar 12, 2021

# The goal: E. coli C-1 assembly

In this tutorial we assemble and annotate the genome of E. coli strain C-1. This strain is routinely used in experimental evolution studies involving bacteriophages. For instance, now classic works by Holly Wichman and Jim Bull (Bull 1997, Bull 1998, Wichman 1999) have been performed using this strain and bacteriophage phiX174.

To sequence the genome we have obtained the strain from the Yale E. coli Stock Center. The stock center sent us a filter paper disk infused with cells. The disk was placed in the center of an LB-agar plate. A single colony was picked and resuspended in a liquid LB medium, grown overnight, and genomic DNA was isolated. The DNA was then sequenced using two methods. To obtain high coverage, high accuracy data we used Illumina miSEQ to generated 250-bp paired end reads. To generate high length reads we used the Oxford Nanopore MinION machine.

Our goal is to reconstruct and annotate the full genome of E. coli C-1. As you will see in this tutorial a combination of many short, high accuracy reads with long, error-prone reads helps us produce an almost perfect assembly.

### Outline step-by-step

In this tutorial, we will deal with:

1. The goal: E. coli C-1 assembly
2. Background on data and tools
3. Let’s try it

# Background on data and tools

## The data

In this tutorial we will assemble a genome using two types of input data: (1) Illumina 250 bp paired-end reads and (2) Oxford Nanopore reads.

### Illumina data

We generated 9,345,897 250 bp read pairs (library preparation performed on genomic DNA fragmented to mean size of 600 bp). However, to make sure that you can complete this tutorial in a finite amount of time we have downsampled (reduced in size) to 1,000,000 paired end reads - just enough to produce an accurate assembly.

### Oxford Nanopore Data

There are 12,738 2d-reads. Maximum read length is 27,518 bp. The distribution of reads lengths looks like this:

You can see that there many reads under the second peak with median of approximately 7.5 kb.

### warning Oxford Nanopore Data Format

Oxford Nanopore machines output data in fast5 format that contains additional information besides sequence data. In this tutorial we assume that this data is already converted into fastq. An additional tutorial dedicated to handling fast5 datasets will be developed shortly.

## The tools

In this analysis we will perform two tasks: (1) assembly and (2) annotation. Below we will briefly outline the main ideas behind these two procedures and will describe the tools we will be using.

### Assembly

Here we assume that you know a thing or two about assembly process. If you don’t: look at the slides accompanying this tutorial as well as other tutorials is this section.

For assembly we will be using Unicycler (also see publication Wick et al. 2017). Unicycler is designed specifically for hybrid assembly (that is, using both short- and long-read sequencing data) of small (e.g., bacterial, viral, organellar) genomes. In our hands it has produced complete high quality assemblies. Unicycler employs a multi-step process that utilizes a number of software tools:

As you can see Unicycler relies heavily on SPAdes (Bankevich et al. 2012) and Pilon. We will briefly describe these two tools.

##### Multisized deBruijn graph

Assemblers usually construct graphs for k-mers of a fixed size. We have noted that when k is small it is difficult to resolve the repeats. If k is too large a corresponding graph may be fragmented (especially if read coverage is low). SPAdes uses several values for k (that are either manually set or inferred automatically) to create a multisized graph that minimized tangledness and fragmentation by combining various k-mers (Bankevich et al. 2012)):

While the use of paired reads and mate pairs is key to genome assembly, and not new, SPAdes utilizes so called paired DeBruin graphs to take the advantage of the paired end data. One of the key issues with paired DeBruin graphs is that the resulting genome assemblies do not tolerate variability in insert sizes: The initial formulation of paired DeBruijn graphs assumed constant distance between pairs of reads. In practice this distance is always variable. SPAdes performs k-bimer (these are k-mers derived from paired reads) adjustment to identify exact or nearly-exact distances for each k-bimer pair.

##### Error correction

Sequencing data contains a substantial number of sequencing errors that manifest themselves as deviations (bulges and non-connected components) within the assembly graph. One way to improve the graph before assembly it is to minimize the number of sequencing errors by performing error correction. SPAdes uses BayesHammer (Nikolenko et al. 2013) to correct the reads. Here is a brief summary of what it does:

1. SPAdes (or rather BayesHammer) counts k-mers in reads and computes k-mer statistics that take into account base quality values.
2. A Hamming graph is constructed in which k-mers are nodes. In this graph edges connect nodes (k-mers) if they differ from each other by a number of nucleotides up to a certain threshold (the Hamming distance). The graph is central to the error correction algorithm.
3. Then Bayesian subclustering is done on the graph from the previous step. For each k-mer we now know the center of its subcluster.
4. Solid k-mers are derived from cluster centers and are assumed to be error free.
5. Solid k-mers are mapped back to the reads.
6. Reads are corrected using solid k-mers:

In the case of the full dataset, SPAdes error correction changed 14,013,757 bases in 3,382,337 reads - a substantial fraction of the full ~18 million read dataset.

#### Pilon

Pilon improves draft assemblies by using the information from the original reads aligned to the draft assembly. The following image from a publication by Walker et al. 2014 highlights the steps of this process:

### Annotation

For annotation we are using Prokka (also see Seemann 2014). It scans the assembly generated with Unicycler with a set of feature prediction tools and compiles a list of genome annotation. It predicts the following features (Table from Seemann 2014):

Feature Tool used by Prokka
Protein-coding sequences (CDS) Prodigal
Ribosomal RNA genes RNAmmer
Transfer RNA genes Aragorn
Non-coding RNA genes Infernal

Prokka predicts protein-coding regions using a two step process. It first identifies coordinates of putative genes using Prodigal and then compares the gene sequence against databases of known sequences at protein level using Blast+ and HMMer.

# Let’s try it

## Load data and assess quality

In this example we will use a downsampled version of E. coli C-1 Illumina and ONT sequencing data. These include 3 files: forward and reverse reads for Illumina, and Long read file produced by ONT. All data are in fastq format.

### hands_on Hands-on: Obtaining our data

1. Make sure you have an empty analysis history. Give it a name.

### Tip: Creating a new history

Click the new-history icon at the top of the history panel.If the new-history is missing:

1. Click on the galaxy-gear icon (History options) on the top of the history panel
2. Select the option Create New from the menu
2. Import the following file from Zenodo

https://zenodo.org/record/940733/files/illumina_f.fq
https://zenodo.org/record/940733/files/illumina_r.fq
https://zenodo.org/record/940733/files/minion_2d.fq

• Open the Galaxy Upload Manager (galaxy-upload on the top-right of the tool panel)
• Select Paste/Fetch Data
• Paste the link into the text field
• Press Start
• Close the windowBy default, Galaxy uses the URL as the name, so rename the files with a more useful name.

### Tip: Importing data from a data library

As an alternative to uploading the data from a URL or your computer, the files may also have been made available from a shared data library:

• Go into Shared data (top panel) then Data libraries
• Select the desired files
• Click on the To History button near the top and select as Datasets from the dropdown menu
• In the pop-up window, select the history you want to import the files to (or create a new one)
• Click on Import

If all goes well you will see datasets uploading and changing states from gray to green as shown below. The figure below also shows how datasets can be tagged.

To assess quality we will use two tools: FastQC (Andrews) to generate quality statistics and multiQC (Ewels et al. 2016) to summarize these statistics.

### hands_on Hands-on: Quality Control

1. FastQC tool:

• param-files “Short read data from your current history”: Select all three FastQ datasets simultaneously
2. MultiQC tool: to generate a summary of the FastQC reports with

• “Which tool was used generate logs?”: FastQC
• “Type of FastQC output”: Raw data
• param-files “FastQC Output”: RawData outputs of FastQC

A quick look at quality score distribution will show a confusing picture:

So let’s zoom in into Illumina data:

## Assembly with Unicycler

Now it is time to perform assembly.

### hands_on Hands-on: Unicycler Assembly

1. Unicycler tool with the following parameters :
• “Paired or Single end data?” to Paired
• “First Set of reads” to the forward reads file f
• “Second Set of reads” to the reverse reads file r
• “Long reads” to the MinION file
• Use default parameters

### Assembly takes time!

There is no such thing as Assembly in real time. It takes time so it is a good time to have lunch or at least coffee. This Unicycler run will take anywhere between 90 minutes and two hours.

## Assess Assembly quality with Quast

Quast (Gurevich et al. 2013) is a tool providing quality metrics for assemblies, and can also be used to compare multiple assemblies. The tool can also take an optional reference file as input, and will provide complementary metrics.

### hands_on Hands-on: Assembly Quality

1. Quast tool: with the following parameters
• “Contigs/scaffolds output file”: Select the fasta file resulting from the Unicycler assembly.

The Quast tool outputs assembly metrics as an html file with metrics and graphs. The image below looks exceptionally boring. This is a good thing:

One can see that there are two (!) contigs. The largest contig is 4,576,290 bp (for comparison E. coli K12 MG1655 strain genome length is 4,656,144 bp) and the smallest is 4,581,676 (total length) - 4,576,290 (length of the largest) = 5,386 bp. When we analyzed this dataset for the first time we were initially puzzled by this second contig. But we quickly realized that this is simply the genome of bacteriophage phiX174 which is routinely used as a spike-in in Illumina sequencing. Thus we have two genomes: the one of E.coli C-1 and phiX174! We can now use Prokka to annotate our two genomes.

## Annotation with Prokka

### hands_on Hands-on: Annotation

1. Prokka tool:
• “Contigs to annotate”: Select the assembly ouput of Unicycler
• “Genus name”: Escherichia
• “Species name”: coli
• “Strain name”: C-1
• “Use genus-specific BLAST database”: yes

Prokka outputs 10 datasets (including two log files). These are in various formats:

• txt : Provides Statistics on the annotation : number of CDS predicted, number of rRNA etc.
• tbl : Provides a tabulated list of annotated features.
• fsa : Nucleotide fasta file of the input contig sequence.
• sqn : ASN.1 format file for submission to GenBank.
• ffn : Nucleotide FASTA file of all the prediction transcripts.
• faa : Protein FASTA file of the translated CDS sequences.
• fna : Nucleotide fasta file of the input contig sequence.
• gbk : GenBank file.
• gff : gff3 file.

## Visualize the results in IGV

Let’s look at the entire assembly and its annotation in the genome browser. We can do this using Integrated Genome Browser (IGV).

Visualization requires a local installation of IGV. If you have IGV installed - just start it. If you don’t - read on.

#### Starting IGV

Go to IGV download page and select one of the options. The one I would try first would be Java Web Start. Simply click the Launch button for 10 GB distribution.

### hands_on Hands-on: Visualization in IGV

1. Start IGV. It will look something like this:

2. Locate the output of Unicycler and expand it :

3. Click on the local link highlighted with orange outline. The browser will change:

4. Let’s add Prokka annotations to the browser image. For this simply expand Prokka’s GFF3 dataset and click on the local link:

You will now see the annotations within the browser window:

### keypoints Key points

• We learned about the strategies used by assemblers for hybrid assemblies

• We performed an hybrid assembly of a bacterial genome and its annotation

• Unicycler is a pipeline bases on Spades and Pilon dedicated to hybrid assembly of Small genomes

• Combination of short and long reads helped us produce an almost perfect assembly

# References

1. Andrews, S. FastQC A Quality Control tool for High Throughput Sequence Data. http://www.bioinformatics.babraham.ac.uk/projects/fastqc/
2. Bull, J., 1997 Different Trajectories of Parallel Evolution During Viral Adaptation. Genetics. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1208326/
3. Bull, J., 1998 A Revolution in Evolution. Science 281: 1959–1959. 10.1126/science.281.5385.1959
4. Wichman, H. A., 1999 Different Trajectories of Parallel Evolution During Viral Adaptation. Science 285: 422–424. 10.1126/science.285.5426.422
5. Bankevich, A., S. Nurk, D. Antipov, A. A. Gurevich, M. Dvorkin et al., 2012 SPAdes: A New Genome Assembly Algorithm and Its Applications to Single-Cell Sequencing. Journal of Computational Biology 19: 455–477. 10.1089/cmb.2012.0021
6. Nikolenko, S. I., A. I. Korobeynikov, and M. A. Alekseyev, 2013 BayesHammer: Bayesian clustering for error correction in single-cell sequencing. BMC Genomics 14: S7. 10.1186/1471-2164-14-s1-s7
7. Gurevich, A., V. Saveliev, N. Vyahhi, and G. Tesler, 2013 QUAST: quality assessment tool for genome assemblies. Bioinformatics 29: 1072–1075. 10.1093/bioinformatics/btt086
8. Seemann, T., 2014 Prokka: rapid prokaryotic genome annotation. Bioinformatics 30: 2068–2069. 10.1093/bioinformatics/btu153
9. Walker, B. J., T. Abeel, T. Shea, M. Priest, A. Abouelliel et al., 2014 Pilon: An Integrated Tool for Comprehensive Microbial Variant Detection and Genome Assembly Improvement (J. Wang, Ed.). PLoS ONE 9: e112963. 10.1371/journal.pone.0112963
10. Ewels, P., M. Magnusson, M. Käller, and S. Lundin, 2016 MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics 32: 3047–3048. 10.1093/bioinformatics/btw354
11. Wick, R. R., L. M. Judd, C. L. Gorrie, and K. E. Holt, 2017 Unicycler: Resolving bacterial genome assemblies from short and long sequencing reads. PLOS Computational Biology 13: 1–22. 10.1371/journal.pcbi.1005595

# Feedback

Did you use this material as an instructor? Feel free to give us feedback on how it went.

# Citing this Tutorial

1. Anton Nekrutenko, Delphine Lariviere, Simon Gladman, 2021 Unicycler Assembly (Galaxy Training Materials). https://training.galaxyproject.org/training-material/topics/assembly/tutorials/unicycler-assembly/tutorial.html Online; accessed TODAY
2. Batut et al., 2018 Community-Driven Data Analysis Training for Biology Cell Systems 10.1016/j.cels.2018.05.012

### details BibTeX

@misc{assembly-unicycler-assembly,
author = "Anton Nekrutenko and Delphine Lariviere and Simon Gladman",
title = "Unicycler Assembly (Galaxy Training Materials)",
year = "2021",
month = "03",
day = "12"
url = "\url{https://training.galaxyproject.org/training-material/topics/assembly/tutorials/unicycler-assembly/tutorial.html}",
note = "[Online; accessed TODAY]"
}
@article{Batut_2018,
doi = {10.1016/j.cels.2018.05.012},
url = {https://doi.org/10.1016%2Fj.cels.2018.05.012},
year = 2018,
month = {jun},
publisher = {Elsevier {BV}},
volume = {6},
number = {6},
pages = {752--758.e1},
author = {B{\'{e}}r{\'{e}}nice Batut and Saskia Hiltemann and Andrea Bagnacani and Dannon Baker and Vivek Bhardwaj and Clemens Blank and Anthony Bretaudeau and Loraine Brillet-Gu{\'{e}}guen and Martin {\v{C}}ech and John Chilton and Dave Clements and Olivia Doppelt-Azeroual and Anika Erxleben and Mallory Ann Freeberg and Simon Gladman and Youri Hoogstrate and Hans-Rudolf Hotz and Torsten Houwaart and Pratik Jagtap and Delphine Larivi{\{e}}re and Gildas Le Corguill{\'{e}} and Thomas Manke and Fabien Mareuil and Fidel Ram{\'{\i}}rez and Devon Ryan and Florian Christoph Sigloch and Nicola Soranzo and Joachim Wolff and Pavankumar Videm and Markus Wolfien and Aisanjiang Wubuli and Dilmurat Yusuf and James Taylor and Rolf Backofen and Anton Nekrutenko and Björn Grüning},
title = {Community-Driven Data Analysis Training for Biology},
journal = {Cell Systems}
}
`