Genome Assembly — The Holy Grail of Genome Analysis | by Vijini Mallawaarachchi | Towards Data Science

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.
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.
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.
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.
A complete protocol for whole-genome sequencing of virus from clinical samples: Application to coronavirus OC43Specific Capture and Whole-Genome Sequencing of Viruses from Clinical Samples
A complete protocol for whole-genome sequencing of virus from clinical samples: Application to coronavirus OC43
Specific Capture and Whole-Genome Sequencing of Viruses from Clinical Samples
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).
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
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 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.
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.
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.
L50: 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
LG50: 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
LA50: number of contigs that are longer than NA50
Genome fraction (%): percentage of bases that align to the reference genome
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
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.
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.
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
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.
You can study the values of the different evaluation criteria such as genome fraction NG50, NA50, misassemblies and number of contigs. Moreover, you can view the contig alignment to the reference genome using the Icarus contig browser (click on “View in Icarus contig browser”) as shown in Figure 4.
From the Icarus contig browser, we can see that the contig named NODE_1 maps very closely to the reference genome of COVID-19. It has a genome fraction of 99.99% (as shown in Figure 3). Moreover, the total aligned length of 29,900 base pairs is very close to the length of the reference genome which is 29,903 base pairs.
There is a tool named Bandage which you can use to visualise the assembly graph. You can download the precompiled binaries from their homepage and run the tool. You can load the graph file assembly_graph_with_scaffolds.gfa which can be found in the SPAdes output folder (Go to File → Load graph → select the .gfa file in Output and open it) to Bandage and click on “Draw graph” to visualise as shown in Figure 5. Note that the long green coloured curved segment in the middle of the first row of segments in Figure 5 corresponds to NODE_1 of our SPAdes assembly.
Since the reference genome of COVID-19 is available now, we can evaluate our assembly. However, at first, there was no exact reference genome for COVID-19. So what did scientists do to figure it out? As explained in my previous article, analysing viral genomes comes under metagenomics and there are many techniques to do this. They had analysed the coverage of the contigs (the average number of reads covering each base position in a contig) and compared with the bat SARS-like coronavirus (CoV) isolate — bat SL-CoVZC45 (GenBank accession number MG772933) [3]. Results have shown that their longest assembled contig had high coverage (from our assembly you can see that NODE_1 has a high coverage value as well) and was very closely related to bat SL-CoVZC45. They have carried out more tests to confirm this, which I won’t go into detail.
Genome assembly has paved the way for us to study what is actually inside the genomes of organisms. Even during the outbreak of COVID-19, genome assembly has played a major role in identifying the actual genetic code of this deadly virus.
If you check the genome size of the COVID-19 genome, it is 29,903 base pairs (~30k base pairs). With the advancements of third-generation sequencing techniques, we may be able to directly sequence the entire length of small genomes such as viral genomes. As read lengths get longer, the need to assemble reads will reduce and eventually, there will be a time where we can directly obtain the genomes from sequencing machines (especially in Metagenomics where genomes range from a few kilobases to a few megabases)! Furthermore, revolutionary nanotechnology-based approaches such as quantum sequencing technologies [4] including graphene nanodevices [5] may become popular.
Thank you for reading everyone. If you found my article interesting, do share it within your networks. I would love to hear your thoughts as well.
Cheers!
[1] Mining coronavirus genomes for clues to the outbreak’s origins| Science | AAAS (https://www.sciencemag.org/news/2020/01/mining-coronavirus-genomes-clues-outbreak-s-origins)
[2] Zhenyu Li et al. Comparison of the two major classes of assembly algorithms: overlap–layout–consensus and de-bruijn-graph, Briefings in Functional Genomics, Volume 11, Issue 1, January 2012, Pages 25–37. https://doi.org/10.1093/bfgp/elr035
[3] F. Wu, S. Zhao, B. Yu et al. A new coronavirus associated with human respiratory disease in China. Nature (2020). https://doi.org/10.1038/s41586-020-2008-3
[4] Jang-il Sohn and Jin-Wu Nam. The present and future of de novo whole-genome assembly. Briefings in Bioinformatics, Volume 19, Issue 1, January 2018, Pages 23–40. https://doi.org/10.1093/bib/bbw096
[5] S. Heerema and C. Dekker. Graphene nanodevices for DNA sequencing. Nature Nanotech 11, 127–136 (2016). https://doi.org/10.1038/nnano.2015.307