- N50, L50, and related assembly metrics are widely used in bioinformatics to describe the continuity, size distribution, and overall characteristics of genome assemblies. Genome assembly reconstructs genomic sequences from sequencing reads, producing contigs, scaffolds, or chromosome-scale sequences. Because assembly algorithms can generate sequences of different lengths and levels of continuity, statistical measures are needed to summarize and compare their results. N50 and L50 are among the most commonly reported metrics, but they should be interpreted alongside other measurements of assembly size, completeness, accuracy, and structural correctness.
- N50 is a length-based statistic that describes the continuity of an assembly. It is defined as the length of the sequence at which 50% of the total assembly length is contained in sequences of that length or longer. To calculate N50, all contigs or scaffolds are arranged from longest to shortest. Their lengths are then added cumulatively until the cumulative length reaches or exceeds 50% of the total assembly length. The length of the sequence that crosses this threshold is the N50 value. A higher N50 generally indicates that a larger proportion of the assembly is contained in long sequences.
- For example, consider an assembly containing five contigs with lengths of 500,000, 300,000, 150,000, 100,000, and 50,000 base pairs. The total assembly length is 1,100,000 base pairs, and half of this total is 550,000 base pairs. The largest contig contributes 500,000 base pairs, which is below the halfway threshold. Adding the second contig brings the cumulative length to 800,000 base pairs. Therefore, the N50 is 300,000 base pairs because the second contig is the sequence that takes the cumulative length above 50% of the assembly.
- L50 is the number of sequences required to cover at least 50% of the total assembly length when sequences are arranged in descending order of length. In the previous example, the two largest contigs together contain 800,000 base pairs, which exceeds half of the total assembly length. Therefore, the L50 is two. A lower L50 generally indicates that fewer sequences are needed to account for half of the assembly. N50 and L50 provide complementary information: N50 describes the length of the sequence at the halfway point, whereas L50 describes how many sequences are needed to reach that point.
- N50 and L50 can be calculated separately for contigs and scaffolds. A contig is a continuous assembled DNA sequence without internal gaps, whereas a scaffold consists of ordered and oriented contigs that may be separated by gaps represented by ambiguous nucleotides such as N. Scaffold N50 is often higher than contig N50 because scaffolding joins multiple contigs into larger structures. However, a higher scaffold N50 does not mean that the intervening DNA has been reconstructed or that the scaffold structure is necessarily correct. Reports should clearly identify whether each statistic refers to contigs, scaffolds, or chromosome-scale sequences.
- NG50 and LG50 are related metrics that use an estimated or independently established genome size rather than the total length of the assembly. NG50 is the length of the sequence at which the cumulative length of the longest sequences reaches at least 50% of the expected genome size. LG50 is the number of sequences needed to reach that same threshold. These metrics are particularly useful when comparing assemblies with different levels of completeness because the denominator is based on the expected genome size rather than the amount of sequence actually assembled.
- For example, suppose the expected genome size is 1,200,000 base pairs. The 50% threshold is therefore 600,000 base pairs. If the two longest contigs are 500,000 and 300,000 base pairs, their cumulative length is 800,000 base pairs. The NG50 is 300,000 base pairs, and the LG50 is two. In this example, N50 and NG50 happen to be the same because the assembly’s total length is 1,100,000 base pairs and the relevant sequence lengths cross both thresholds at the same contig. In other assemblies, the values may differ substantially. The expected genome size should be estimated carefully because an inaccurate genome-size estimate can distort NG50 and LG50.
- The N90 statistic is another length-based measure. It identifies the sequence length at which the longest sequences collectively account for at least 90% of the total assembly length. L90 is the number of sequences required to reach this 90% threshold. Similarly, NG90 and LG90 use 90% of the expected genome size as the threshold. These metrics provide information about the distribution of sequence lengths beyond the halfway point. Reporting N50 and N90 together can help show whether an assembly contains a few very long sequences followed by many short ones or has a more uniform distribution of sequence lengths.
- Other related statistics include N10, N25, N75, and N95, which represent the sequence lengths at which the cumulative assembly length reaches the corresponding percentages. Their count-based counterparts are L10, L25, L75, and L95. Although these statistics are less frequently reported than N50 and L50, they can provide a more detailed picture of assembly continuity. A complete N-statistic profile can be useful when comparing assemblies with different sequence-length distributions.
- The total assembly length is one of the most fundamental assembly metrics. It represents the sum of the lengths of all sequences in an assembly. This value is commonly compared with an independently estimated genome size or a suitable reference genome. A substantially shorter assembly may indicate missing genomic regions, while an unexpectedly large assembly may result from duplicated haplotypes, uncollapsed allelic regions, contamination, redundant sequences, or differences in ploidy and genome representation. Total assembly length alone cannot establish whether the assembly is complete or accurate.
- The number of contigs and scaffolds provides another simple measure of assembly structure. A lower contig count may indicate improved continuity, especially when comparing assemblies of similar genome size and biological representation. However, contig count is influenced by genome complexity, sequencing depth, repeat content, heterozygosity, and assembly strategy. A low contig count does not guarantee that the sequences have been joined correctly. Similarly, a high contig count may reflect genuine difficulty in assembling a complex genome rather than poor performance by the assembler.
- The largest contig and largest scaffold are also useful metrics. The largest contig represents the longest uninterrupted assembled sequence, while the largest scaffold represents the longest scaffold, which may contain gaps between its component contigs. These values help describe the longest continuous or scaffolded regions in an assembly. They are particularly relevant when assessing whether important genomic regions, such as large genes, repetitive regions, or chromosome segments, have been reconstructed in long sequences.
- Mean and median sequence lengths provide additional information about the distribution of contig or scaffold sizes. The mean is calculated by dividing the total assembly length by the number of sequences. The median is the middle sequence length after arranging all sequences from shortest to longest, or the average of the two middle values when the number of sequences is even. The mean can be strongly influenced by a small number of very long sequences, whereas the median describes the central sequence length more directly. Reporting both can help reveal whether an assembly contains many short sequences alongside a few exceptionally long ones.
- The contig length distribution is often summarized using length thresholds. For example, researchers may report the number of contigs longer than 1 kilobase, 10 kilobases, 100 kilobases, or 1 megabase. Such thresholds depend on the organism and the purpose of the analysis. For a small bacterial genome, a contig length of several hundred kilobases may represent a substantial portion of the genome. For a large plant or animal genome, the same length may be relatively small. Length thresholds should therefore be selected with consideration of genome size and biological context.
- GC content is another commonly reported assembly characteristic. It represents the proportion of guanine and cytosine nucleotides in the assembled sequences. GC content can be calculated for the entire assembly or separately for individual contigs. Unusual GC content in particular sequences may indicate contamination, unusual genomic regions, sequencing bias, or genuine biological variation. However, GC content alone cannot reliably identify contamination because some organisms naturally contain regions with unusual nucleotide composition. It is most informative when combined with coverage, sequence similarity, taxonomic classification, and other evidence.
- Assembly completeness metrics provide information that continuity statistics cannot. BUSCO estimates the recovery of expected conserved single-copy orthologs from a selected taxonomic lineage. It reports complete single-copy, complete duplicated, fragmented, and missing BUSCO genes. A high proportion of complete BUSCO genes generally indicates good recovery of conserved gene content. However, BUSCO does not measure the recovery of every nucleotide or every repetitive and noncoding region. Its results also depend on the suitability of the selected lineage dataset and the biological characteristics of the organism.
- K-mer-based metrics offer another approach to evaluating genome assemblies. A k-mer is a short sequence of k consecutive nucleotides. K-mers observed in sequencing reads can be compared with those present in the assembled genome to identify missing or incorrectly represented sequence information. Merqury uses k-mer comparisons to assess assembly quality, including consensus accuracy and completeness-related properties. K-mer analysis is especially useful when high-quality sequencing reads are available and can provide information that is independent of conventional reference-based comparisons. Its interpretation depends on read quality, coverage, genome complexity, and the selected k-mer parameters.
- Reference-based metrics can be calculated by aligning an assembly to a suitable reference genome. These comparisons can estimate how much of the reference is represented, identify large missing regions, and reveal structural differences such as inversions, translocations, duplications, and rearrangements. Tools such as QUAST, MUMmer, and minimap2 can support reference-based assembly evaluation. However, a reference genome may differ biologically from the sample being assembled, and it may itself contain errors or missing regions. Reference alignment should therefore be interpreted as a comparison with a particular reference, not as an absolute measure of assembly correctness.
- Assembly accuracy is a separate property from continuity. N50, L50, NG50, and related metrics describe sequence-length organization, but they do not measure whether every nucleotide has been reconstructed correctly. Consensus accuracy can be assessed using read mapping, k-mer-based approaches, and comparisons with high-quality reference sequences. Merqury can provide k-mer-based quality estimates, while read-mapping approaches can help identify mismatches, insertions, deletions, and regions with insufficient support. The quality of these assessments depends on the accuracy and independence of the evidence used.
- Structural correctness is also important. An assembly may have a high N50 but contain incorrectly joined contigs, misoriented sequences, collapsed repeats, or misplaced scaffolds. Long-read alignments, Hi-C contact maps, optical maps, genetic maps, and other long-range evidence can help evaluate the structural organization of assembled sequences. Tools such as QUAST, YaHS-related evaluation workflows, and specialized Hi-C visualization and analysis software may contribute to this assessment. Structural validation is particularly important for chromosome-scale assemblies and complex eukaryotic genomes.
- The interpretation of assembly metrics becomes more complicated in diploid and polyploid organisms. A diploid genome contains two homologous chromosome sets, which may differ in sequence. Some assemblers collapse similar haplotypes into a single representation, while others produce separate haplotype-resolved sequences. A haplotype-resolved assembly may contain more total sequence than a collapsed representation because both chromosome copies are represented. This does not necessarily indicate redundant assembly. Similarly, duplicated BUSCO genes may result from genuine gene duplication, polyploidy, or separate haplotypes rather than technical errors. Assembly metrics should therefore be interpreted in relation to the intended genome representation.
- N50 and related metrics are also influenced by genome complexity. Repetitive sequences can prevent assemblers from determining the correct order and copy number of DNA segments. Low sequencing coverage may leave gaps or produce short contigs, while high heterozygosity can create alternative paths in assembly graphs. Large genomes, segmental duplications, transposable elements, and structural variation can further complicate reconstruction. Consequently, two assemblies with different N50 values should not automatically be ranked without considering their sequencing data, genome characteristics, and assembly strategies.
- Several bioinformatics tools are commonly used to calculate and report assembly metrics. QUAST (Quality Assessment Tool for Genome Assemblies) provides statistics such as total assembly length, contig count, largest contig, N50, and other continuity measures. It can also perform reference-based comparisons when a suitable reference genome is supplied. BUSCO assesses conserved gene completeness, Merqury provides k-mer-based evaluation, and CheckM2 is useful for estimating completeness and contamination in microbial genomes. BlobToolKit can help investigate taxonomic composition and possible contamination by combining sequence coverage, GC content, and other information.
- A basic assembly statistics report can be generated using QUAST. The following command illustrates how to evaluate an assembly in FASTA format:
quast.py assembly.fasta -o quast_results
- If a suitable reference genome is available, it can be included in the analysis:
quast.py assembly.fasta -r reference.fasta -o quast_reference_results
- The resulting reports include assembly size, contig statistics, N50, and other quality-related measurements. Reference-based results can help identify missing or rearranged regions, but differences between the assembly and reference may reflect genuine biological variation.
- The following Python example uses Biopython to calculate total assembly length, contig count, largest contig, mean and median contig length, N50, L50, N90, and L90:
from Bio import SeqIO
from statistics import mean, median
assembly_file = “assembly.fasta”
lengths = [
len(record.seq)
for record in SeqIO.parse(assembly_file, “fasta”)
]
if not lengths:
raise ValueError(“No sequences found in the assembly file.”)
total_length = sum(lengths)
sorted_lengths = sorted(lengths, reverse=True)
def calculate_n_l(lengths, percentage):
threshold = total_length * percentage / 100
cumulative_length = 0
for count, length in enumerate(lengths, start=1):
cumulative_length += length
if cumulative_length >= threshold:
return length, count
return 0, 0
n50, l50 = calculate_n_l(sorted_lengths, 50)
n90, l90 = calculate_n_l(sorted_lengths, 90)
print(“Number of contigs:”, len(lengths))
print(“Total assembly length:”, total_length)
print(“Largest contig:”, max(lengths))
print(“Mean contig length:”, mean(lengths))
print(“Median contig length:”, median(lengths))
print(“N50:”, n50)
print(“L50:”, l50)
print(“N90:”, n90)
print(“L90:”, l90)
- This script calculates N50, L50, N90, and L90 using the total assembled sequence length as the reference. It does not calculate NG50 or LG50, which require an independently supplied expected genome size. It also does not evaluate completeness, nucleotide accuracy, contamination, or structural correctness. It is intended as a simple statistical analysis of contig lengths.
- To calculate NG50 and LG50, the expected genome size must be supplied. The following example extends the calculation to include these metrics:
from Bio import SeqIO
assembly_file = “assembly.fasta”
expected_genome_size = 1_200_000
lengths = sorted(
[len(record.seq) for record in SeqIO.parse(assembly_file, “fasta”)],
reverse=True
)
if not lengths:
raise ValueError(“No sequences found in the assembly file.”)
def calculate_ng_lg(lengths, genome_size, percentage):
threshold = genome_size * percentage / 100
cumulative_length = 0
for count, length in enumerate(lengths, start=1):
cumulative_length += length
if cumulative_length >= threshold:
return length, count
return None, None
ng50, lg50 = calculate_ng_lg(
lengths,
expected_genome_size,
50
)
print(“Expected genome size:”, expected_genome_size)
print(“NG50:”, ng50)
print(“LG50:”, lg50)
- If the assembly does not contain enough sequence to reach the selected percentage of the expected genome size, the function returns None for both values. This is useful because it prevents an incomplete assembly from being assigned an artificial NG50 or LG50 value when the required threshold has not been reached. The expected genome size should be based on an appropriate independent estimate rather than simply using the assembly length.
- When comparing genome assemblies, researchers should consider the complete set of relevant metrics rather than selecting the assembly with the highest N50. An assembly with a higher N50 may have lower completeness, more contamination, or greater structural errors than an assembly with a lower N50. Comparisons are most meaningful when the assemblies represent the same organism or genome, use comparable definitions of contigs and scaffolds, and are evaluated with consistent tools and parameters. The sequencing technologies, coverage, genome size, ploidy, and assembly strategies should also be considered.
- In microbial genomics, N50 and L50 can help describe the continuity of bacterial and archaeal assemblies, while completeness and contamination estimates are important for determining whether reconstructed genomes are suitable for downstream analyses. In metagenomics, these metrics can be used to characterize metagenome-assembled genomes, but they should be interpreted alongside bin completeness, contamination, strain heterogeneity, and taxonomic evidence. In plant and animal genomics, NG50, chromosome-scale continuity, gene completeness, and structural validation are particularly important because genome size and repeat content can be substantial. In comparative genomics, consistent assembly metrics help researchers select suitable genome resources for gene-family analysis, genome evolution studies, and comparative annotation.
- For reproducible assembly assessment, researchers should report the software name and version, command-line parameters, input assembly file, sequencing technology, and reference genome or expected genome size used for evaluation. They should clearly distinguish contig statistics from scaffold statistics and identify whether N50 or NG50 was calculated. The selected BUSCO lineage, k-mer size, and other important evaluation parameters should also be documented. Reporting a table containing total assembly length, contig and scaffold counts, N50, L50, NG50, LG50, BUSCO completeness, and relevant accuracy or contamination measures provides a more informative description than reporting N50 alone.
- N50, L50, and related assembly metrics are essential tools for summarizing genome assembly continuity and sequence-length distribution. N50 and L50 describe how the assembled sequence is distributed among contigs or scaffolds, while NG50 and LG50 allow continuity to be evaluated against an expected genome size. Additional measures such as N90, L90, total assembly length, contig count, GC content, and completeness and accuracy assessments provide a broader understanding of assembly quality. These metrics are most useful when interpreted together with biological context, sequencing evidence, and structural validation. A high-quality genome assembly should not simply have long sequences; it should also recover the expected genomic content and represent that content accurately.