12/12/22, 7:20 PM An Introduction to Genome Assembly
Galaxy Training!
An Introduction to Genome Assembly
Authors: Simon Gladman
Overview
Questions:
How do we perform a very basic genome assembly from short read data?
Objectives:
assemble some paired end reads using Velvet
examine the output of the assembly.
Requirements:
Introduction to Galaxy Analyses
Sequence analysis
Quality Control: slides - hands-on
Time estimation: 30 minutes
Level: Introductory
Supporting Materials:
Slides Datasets Workflows Tours FAQs Recordings
Available on these Galaxies
Last modification: Oct 18, 2022
License: Tutorial Content is licensed under Creative Commons Attribution 4.0 International License
The GTN Framework is licensed under MIT
Genome assembly with Velvet: Background
Get the data
Evaluate the input reads
Assemble reads with Velvet
Collect some statistics on the contigs
Discussion
Frequently Asked Questions
Feedback OPEN CHAT
[Link] 1/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
Citing this Tutorial
Genome assembly with Velvet:
Background
Velvet is one of a number of de novo assemblers that use short read sets as input (e.g. Illumina Reads).
The assembly method is based on the manipulation of de Bruijn graphs, via the removal of errors and
the simplification of repeated regions.
Comment
For information about Velvet, you can check its (nice) Wikipedia page.
For this tutorial, we have a set of reads from an imaginary Staphylococcus aureus bacterium with a
miniature genome (197,394 bp). Our mutant strain read set was sequenced with the whole genome
shotgun method, using an Illumina DNA sequencing instrument. From these reads, we would like to
rebuild our imaginary Staphylococcus aureus bacterium via a de novo assembly of a short read set
using the Velvet assembler.
We also have a sequence for a reference genome that we will use later in the tutorial.
Agenda
In this tutorial, we will deal with:
1. Genome assembly with Velvet: Background
2. Get the data
3. Evaluate the input reads
4. Assemble reads with Velvet
5. Collect some statistics on the contigs
6. Discussion
Get the data
OPEN CHAT
[Link] 2/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
1. Create and name a new history for this tutorial.
Tip: Creating a new history
2. Import from Zenodo or from the data library the files:
[Link]
[Link]
[Link]
Tip: Importing data via links
3. Change the name of the files to mutant_R1 , mutant_R2 and [Link] .
As a default, Galaxy uses the link as the name of the new dataset. It also does not link the
dataset to a database or a reference genome.
Tip: Renaming a dataset
4. Inspect the content of a file.
Tip: Inspecting the content of a dataset
Question
1. What are four key features of a FASTQ file?
2. What is the main difference between a FASTQ and a FASTA file?
Solution
Link to here | FAQs | Gitter Chat | Help Forum
OPEN CHAT
[Link] 3/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
The reads have been sequenced from an imaginary Staphylococcus aureus bacterium using an Illumina
DNA sequencing instrument. We obtained the 2 files we imported ( mutant_R1 and mutant_R2 )
Question
Why do we have 2 files here if we only sequenced the bacteria once?
Solution
Evaluate the input reads
Before doing any assembly, the first questions you should ask about your input reads include:
What is the coverage of my genome?
How good is my read set?
Do I need to ask for a new sequencing run?
Is it suitable for the analysis I need to do?
We will evaluate the input reads using the FastQC tool. This tool runs a standard series of tests on your
read set and returns a relatively easy-to-interpret report. We will use it to evaluate the quality of our
FASTQ files and combine the results with MultiQC.
Hands-on: FastQC on a fastq file
1. FastQC with the following parameters
“Raw read data from your current history”: mutant_R1.fastq and
mutant_R2.fastq
Tip: Select multiple datasets
2. MultiQC with the following parameters
“Software name”: FastQC
“Result file”: All raw data files generated by FastQC.
Link to here | FAQs | Gitter Chat | Help Forum
MultiQC generates a webpage combining reports for FastQC on both datasets. It includes these graphs
OPEN CHAT
and tables:
[Link] 4/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
General statistics
This is important in setting maximum k-mer size for an assembly.
Comment: Getting the length of sequences
Click on Configure Columns
Check Length
Close the window
Question
1. How long are the sequences?
2. What is the average coverage of the genome, given our imaginary Staphylococcus
aureus bacterium has a genome of 197,394 bp?
Solution
Sequence Quality Histograms
Dips in quality near the beginning, middle or end of the reads may determine the
trimming/cleanup methods and parameters to be used, or may indicate technical problems with
the sequencing process/machine run.
OPEN CHAT
[Link] 5/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
Figure 1: The mean quality value across each base position in the read
Question
1. What does the y-axis represent?
2. Why is the quality score decreasing across the length of the reads?
Solution
Per Sequence GC Content
High GC organisms tend not to assemble well and may have an uneven read coverage
distribution.
Per Base N Content
The presence of large numbers of Ns in reads may point to a poor quality sequencing run. You
will need to trim these reads to remove Ns.
k-mer content
The presence of highly recurring k-mers may point to contamination of reads with barcodes or
adapter sequences.
OPEN CHAT
[Link] 6/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
For a fuller discussion of FastQC outputs and warnings, see the FastQC website link, including the
section on each of the output reports, and examples of “good” and “bad” Illumina data.
We won’t be doing anything to these data to clean it up as there isn’t much need. Therefore we will
get on with the assembly!
Assemble reads with Velvet
Now, we want to assemble our reads to find the sequence of our imaginary Staphylococcus aureus
bacterium. We will perform a de novo assembly of the reads into long contiguous sequences using the
Velvet short read assembler.
The first step of the assembler is to build a de Bruijn graph. For that, it will break our reads into k-mers,
i.e. fragments of length k. Velvet requires the user to input a value of k (k-mer size) for the assembly
process. Small k-mers will give greater connectivity, but large k-mers will give better specificity.
OPEN CHAT
[Link] 7/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
1. FASTQ interlacer with the following parameters
“Type of paired-end datasets”: 2 separate datasets
“Left-hand mates”: mutant_R1.fastq
“Right-hand mates”: mutant_R2.fastq
Currently our paired-end reads are in 2 files (one with the forward reads and one with the
reverse reads), but Velvet requires only one file, where each read is next to its mate read. In
other words, if the reads are indexed from 0, then reads 0 and 1 are paired, 2 and 3, 4 and 5,
etc. Before doing the assembly per se, we need to prepare the files by combining them.
2. velveth with the following parameters
“Hash Length”: 29
“Input Files”
Click on “Input Files”
In “1: Input Files”
“file format”: fastq
“read type”: shortPaired reads
“Dataset”: outputs of FASTQ interlacer
The tool takes our reads and break them into k-mers.
3. velvetg with the following parameters
“Velvet Dataset”: outputs of velveth
“Using Paired Reads”: Yes
This last tool actually does the assembly.
Link to here | FAQs | Gitter Chat | Help Forum
Two files are generated:
A Contigs file
This file contains the sequences of the contigs longer than 2k. In the header of each contig, a bit
of information is added:
the k-mer length (called “length”): For the value of k chosen in the assembly, a measure of
how many k-mers overlap (by 1 bp each overlap) to give this length
the k-mer coverage (called “coverage”): For the value of k chosen in the assembly, a
measure of how many k-mers overlap each base position (in the assembly).
OPEN CHAT
[Link] 8/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
A Stats file
This is a tabular file giving for each contig the k-mer lengths, k-mer coverages and other
measures.
OPEN CHAT
[Link] 9/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
Collect some statistics on the contigs
Question
1. How many contigs have been built?
2. What is the mean, min and max length of the contigs?
Solution
This table is limitted, but we will now collect more basic statistics on our assembly.
OPEN CHAT
[Link] 10/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
1. Quast with
“Contigs/scaffolds output file”: outputs of velvetg
“Type of assembly”: Genome
“Use a reference genome?”: Yes
“Reference genome”: [Link]
“Type of organism”: Prokaryotes
“Lower Threshold”: 500
“Comma-separated list of contig length thresholds”: 0,1000
Link to here | FAQs | Gitter Chat | Help Forum
This tool generates 5 output files, but we will focus on the HTML report and the Icarus viewer.
Question
1. What is represented in the Icarus viewer?
Solution
The HTML report reports many statistics computed by QUAST to assess the quality of the assembly:
Statistics about the quality of the assembly when compared to the reference (fraction of the
genome, duplication ratio, etc)
Misassembly statistics, including the number of misassemblies
A misassembly is a position in the contigs (breakpoints) that satisfy one of the following criteria:
the left flanking sequence aligns over 1 kbp away from the right flanking sequence on the
reference;
flanking sequences overlap on more than 1 kbp
flanking sequences align to different strands or different chromosomes
Unaligned regions in the assembly
Mismatches compared to the reference genomes
Statistics about the assembly per se, such as the number of contigs and the length of the largest
contig
OPEN CHAT
[Link] 11/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
1. How many contigs have been constructed?
2. Which proportion of the reference genome do they represent?
3. How many misassemblies have been found?
4. Has the assembly introduced mismatches and indels?
5. What are N50 and L50?
6. Is there a bias in GC percentage induced by the assembly?
Solution
Discussion
Hands-on: (Optional) Rerun for values k ranging from 31 to 101
1. velveth with the same parameters as before except
“Hash Length”: a value between 31 and 101
2. velvetg with the same parameters as before
3. Quast with the same parameters as before
Link to here | FAQs | Gitter Chat | Help Forum
We have completed an assembly on this data set for a number of k values ranging from 29 to 101. A
few of the assembly metrics appear below.
OPEN CHAT
[Link] 12/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
Figure 2: Number of contigs in the assembly for various k-mer sizes
Figure 3: Largest contig in each of the assemblies by k-mer size
OPEN CHAT
[Link] 13/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
Figure 4: Total number of base pairs in all the contigs for each assembly by k-mer size
Figure 5: N50 metric for each of the assemblies by k-mer size
OPEN CHAT
[Link] 14/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
1. Are there any distinct features in the charts?
2. Does it look like one assembly might be better than some of the others?
The reasons for these patterns will be discussed in detail in the De Bruijn graph assembly slides and
tutorial.
Key points
We assembled some Illumina fastq reads into contigs using a short read assembler called
Velvet
We showed what effect one of the key assembly parameters, the k-mer size, has on the
assembly
It looks as though there are some exploitable patterns in the metric data vs the k-mer size.
Frequently Asked Questions
Have questions about this tutorial? Check out the tutorial FAQ page or the FAQ page for the Assembly
topic to see if your question is listed there. If not, please ask your question on the GTN Gitter Channel
or the Galaxy Help Forum
Feedback
Did you use this material as an instructor? Feel free to give us feedback on how it went.
Did you use this material as a learner or student? Click the form below to leave feedback.
OPEN CHAT
[Link] 15/16
12/12/22, 7:20 PM An Introduction to Genome Assembly
Citing this Tutorial
1. Simon Gladman, An Introduction to Genome Assembly (Galaxy Training Materials).
[Link]
introduction/[Link] Online; accessed Mon Dec 12 2022
2. Batut et al., 2018 Community-Driven Data Analysis Training for Biology Cell Systems
10.1016/[Link].2018.05.012
BibTeX
Congratulations on successfully completing this tutorial!
OPEN CHAT
[Link] 16/16