TITLE: Plant assemble - Plant de novo genome assembly: quality assessment
AUTHORS: Scott  Ferguson, Ashley  Jones, Justin  Borevitz

[DESCRIPTION]
With the advancement of long-read sequencing technologies and associated bioinformatics tools, it has now become possible to de novo assemble complex plant genomes with unrivalled contiguity, completeness and correctness. As read lengths can surpass repeat lengths, the ability to assemble genomes de novo has dramatically improved, whereby complex plant genomes of widely variable sizes and repeat content have highly benefited. Despite these improvements, challenges remain in performing de novo assembly, namely in developing a reliable workflow and in tool choice. Here we present a protocol collection of bioinformatic workflows detailing plant genome assembly using Oxford Nanopore Technologies long-reads with a de novo assembler (Canu), syntenic or Hi-C scaffolding, and RNA and/or gene homology-based annotation. We have developed and tested these protocols on multiple plant genomes. Using these protocols with sufficient coverage of long-reads, a highly contiguous, complete, and correct plant genome can be assembled. These genomes can further genomic research into structural variation among groups, and SNP genotyping and association studies among populations.

[STEPS]
SECTION: Genome quality assessment
1. Having assembled a genome we want to assess how good it is. The three major considerations here are contiguity, accuracy and completeness.

Contiguity we can assess with numerical statistics: 
N50.
E-size.
number of sequences.
N50 and E-size are both ways of trying to express genome contiguity in a single easy to read number. E-size is a better metric but N50 is much more used. A much better way of showing your genome contiguity is with a histogram of sequence sizes, but this is harder to read and communicate.

For more infomation on E-Size see:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3290791/
http://lh3.github.io/2020/04/08/a-new-metric-on-assembly-contiguity

Accuracy and completeness we measure with:
BUSCO.
LAI.
BUSCO checks your genome for highly conserved single copy lineage specific genes. Having discovered all BUSCO genes within your genome, this static reports on what percent of these genes have been: found, not-found, duplicated, and fragmented within your assembly. Better genomes have a high percent of single copy genes. LAI scores the proportion of LTR sequences in the genome that are intact, higher is better. To get a feel for this value you will need to read papers that cite this tool and report the genome LAI.

SECTION: N50
2. Save these commands to N50.sh, make executable, and add to path or place in a directory included in your path. This script works with the .genome file type, see "Long read  genome assembly - Step 2".

To calculate the N50 of a fasta/q file:
gne-file.sh XXX.fasta
N50.sh XXX.genome
 

SECTION: E-size
3. Save these commands to ESize.sh, make executable, and add to path or place in a directory included in your path. To calculate E-size call E-size.sh genome.fasta

Save these commands to E-size.sh, make executable, and add to path or place in a directory included in your path. This script works with the .genome file type, see "Long read  genome assembly - Step 2".

To calculate the E-size of a fasta/q file:
gne-file.sh XXX.fasta
E-size.sh XXX.genome
 


SECTION: BUSCO
4. To run BUSCO you will need to first download the lineage specific BUSCO set for your species from https://busco-data.ezlab.org/v4/data/lineages/.

Note: newer versions of BUSO will auto download gene sets, but we manually download ours so that we can save them to appropriate disk space. If you use the auto download within BUSCO your commands will be different, see https://busco.ezlab.org/.
 


SECTION: LAI
5. 
 

SECTION: Validation reads
6. An additional quality check we like to perform is to align our unused long reads to our finalised genome and look at the mapping percent and quality. A very high proportion of reads will align with good quality scores to a high quality genome.

The validation read set is made from all reads not used in assembly with an average quality score of 7 or greater. We don’t wish to align low quality reads as these will not align well due to sequencing errors and be a poor indicator of genome quality.
 

SECTION: Validation reads
7. Align validation reads to genome and validate alignment quality with Qualimap.
 
Qualimap will produce a pdf formatted report. Use this to get statistics on
number of reads
mapped reads
unmapped reads
average coverage
standard deviation of coverage
mean mapping quality

These statistics can be used to assess genome quality. Average coverage should ~= read coverage (to calculate see below), and the proportion and quality of mapping should be high.