Genome Assembly — The Holy Grail of Genome Analysis
By: Vijini Mallawaarachchi
Tags: Dna, Biology, Data Science, Science, Bioinformatics

Genome Assembly — The Holy Grail of Genome Analysis

Assembling the 2019 novel coronavirus genome

The 2019 novel coronavirus or coronavirus disease (COVID-19) outbreak has threatened the entire world at present. Scientists are working day and night to understand the origin of COVID-19. You may have heard the news recently that the complete genome of COVID-19 has been published. How did scientists figure out the complete genome of COVID-19? In this article, I will explain how we can do this.

Genome

A genome is considered as all the genetic material, including all the genes of an organism. The genome contains all the information of an organism that is required to build and maintain it.

Sequencing

How can we read the information present in the genome? This is where sequencing comes into action. Assuming you have read my previous article on DNA analysis, you know that sequencing is used to determine the sequence of individual genes, full chromosomes or entire genomes of an organism.

Fig 1. A PacBio sequencing machine. PacBio is a third-generation sequencing technology which produces long reads. Image by KENNETH RODRIGUES from Pixabay (CC0)

Special machines, known as sequencing machines are used to extract short random sequences from the genome we are interested in. Current sequencing technologies cannot read the whole genome at once. It reads small pieces of mean length between 50–300 bases (next-generation sequencing/short reads) or 10,000-20,000 bases (third-generation sequencing/ long reads), depending on the technology used. These short pieces are called reads.

If you want to know more details about how viral genomes are sequenced from clinical samples, you can read the following articles.

Genome Assembly

Once we have small pieces of the genome, we have to combine (assemble) them together based on their overlap information and build the complete genome. This process is called assembly. Assembly is like solving a jigsaw puzzle. Special software tools called assemblers are used to assemble these reads according to how they overlap, in order to generate continuous strings called contigs. These contigs can be the whole genome itself, or parts of the genome (as shown in Figure 2).

Fig 2. Sequencing and assembly

Assemblers are divided into two categories as,

De novo assemblers: assemble without the use of reference genomes (E.g.: SPAdes, SGA, MEGAHIT, Velvet, Canu and Flye). Reference guided assemblers: assemble by mapping sequences to reference genomes

Two Main Types of Assemblers

Two main types of assemblers can be found across bioinformatics literature. The first type is the overlap-layout-consenses (OLC) method. In OLC method, first, we determine all the overlaps between the reads. Then we layout all the reads and overlaps in the form of a graph. Finally, we identify the consensus sequence. SGA is a popular tool based on the OLC method.

The second type of assembler is the de Bruijn graph (DBG) method [2]. Rather than using the complete reads as they are, the DBG method breaks reads into shorter fragments called k-mers (with length k) and then build a de Bruijn graph using all the k-mers. Finally, the genome sequences are inferred based on the de Bruijn graph. SPAdes is a popular assembler which is based on the DBG method.

What can go wrong in Genome Assembly?

Genomes contain patterns of nucleic acids that occur many times across the genome. These structures are called repeats. These repeats can complicate the assembly process and result in ambiguities.

We cannot guarantee that the sequencing machine can produce reads covering the entire genome. The sequencing machine may miss some parts of the genome and there won’t be reads covering that region. This will affect the assembly process and those missed regions will not be present in the final assembly.

Genome assemblers should address these challenges and try to minimise the errors caused during assembly.

How to Evaluate Assemblies?

Evaluation of assemblies is very important as we have to decide whether the resulting assembly meets the standards. One of the well-known and most commonly used assembly evaluation tools is QUAST. Listed below are some criteria used to evaluate assemblies.

N50: minimum contig length that is required to cover 50% of the total length of the assembly.

minimum contig length that is required to cover 50% of the total length of the assembly. L50: number of contigs that are longer than N50

number of contigs that are longer than N50 NG50: minimum contig length that is required to cover 50% of the length of the reference genome

minimum contig length that is required to cover 50% of the length of the reference genome LG50: number of contigs that are longer than NG50

number of contigs that are longer than NG50 NA50: minimum length of aligned blocks that are required to cover 50% of the total length of the assembly

minimum length of aligned blocks that are required to cover 50% of the total length of the assembly LA50: number of contigs that are longer than NA50

number of contigs that are longer than NA50 Genome fraction (%): percentage of bases that align to the reference genome

Getting Hands Dirty

Let’s get started with the experiments. I will be using the assembler SPAdes to assemble reads obtained from sequencing patient samples. SPAdes makes use of next-generation sequencing reads. You can download QUAST freely as well. You can get the code and binaries from the relevant homepages (which I have provided as links) and run these tools.

Type in the following commands and verify whether the tools are working correctly.

<your_path_to>/SPAdes-3.13.1/bin/spades.py -h

<your_path_to>/quast-5.0.2/quast.py -h

Download the data

I assume you know how to download data from the National Center for Biotechnology Information (NBCI). If not, you can refer to this link.

The reads for our experiments can be downloaded from NCBI with NCBI accession number SRX7636886. You can download the run SRR10971381 which contains reads obtained from an Illumina MiniSeq run. Make sure to download the data in FASTQ format. The downloaded file can be found as sra_data.fastq.gz . You can extract the FASTQ file using gunzip.

After extracting, you can run the following bash command to count the number of reads in our dataset. You will see there are 56,565,928 reads.

grep '^@' sra_data.fastq | wc -l

You can download the publicly available COVID-19 complete genome[3] from NCBI with GenBank accession number MN908947. You will see a file in FASTA format. This will be our reference genome. Note that we have renamed it to MN908947.fasta .

Assemble

Let’s assemble the reads of COVID-19. Run the following command to assemble the reads using SPAdes. You can provide the compressed .gz file to SPAdes directly.

<your_path_to>/SPAdes-3.13.1/bin/spades.py --12 sra_data.fastq.gz -o Output -t 8

Here we have used the general SPAdes assembler as a demonstration to this article. However, since the reads dataset consists of RNA-Seq data (read more about RNA from my previous article), it is better to use the --rna option in SPAdes.

In the Output folder, you can see a file named contigs.fasta which contains our final assembled contigs.

Evaluating the Assembly Results

Run QUAST on the assemblies using the following command.

<your_path_to>/quast-5.0.2/quast.py Output/contigs.fasta-l SPAdes_assembly -r MN908947.fasta -o quastResult

Viewing the Evaluation Result

Once QUAST has finished, you can go into the quastResult folder and view the evaluation results. You can view the QUAST report by opening the file report.html in your web browser. You can see a report similar to the one shown in Figure 3. You can click on “Extended report” for more information such as NG50 and LG50.