Learning center

N50 statistics: contig boundaries, numeric precision and complete exports

Use four tiny synthetic FASTA assemblies to read N50/L50 and auN, preserve complete saved tables and distinguish the reviewed source from the older package.

Written guide to N50 Statistics in Bioinformatics Sequence Statistics. Four tiny synthetic FASTA assemblies demonstrate the length summary, input checks and complete saved exports. The saved examples retain their recorded source version. A later focused intake repair is included in the current local package; the examples remain bounded workflow evidence, not a real-genome benchmark.

1. Keep one record per contig

Use the Sequence Statistics app, identified as bioinformatics/Sequence statistics. Supply a nucleotide FASTA with one nonempty record per contig and retain the original file. The first saved fixture has three records of lengths 7, 5 and 3:

>contig_0
ACGTACG
>contig_1
ACGTA
>contig_2
ACG

This is a teaching fixture, not an assembled organism or published genome. The app checks all records used for N50, removes whitespace and normalizes letter case. Supported nucleotide ambiguity symbols count toward length; alignment gaps, empty records and records declared as protein are refused. RNA U is supported. The figure and table use the label bp for these nucleotide lengths; this is a count of sequence positions, not a measurement of paired strands.

For N50 Statistics selected on its own, the current input check accepts supported nucleotide ambiguity symbols, including an all-N first record. GC content is undefined when no unambiguous bases are present; it is not reported as a measured zero. Other selected analysis routes retain their own input requirements. Keep a refusal and its reason; do not silently change or discard a contig to obtain a result. The saved input checks cover seven small fixtures, including a protein or gap in the second record. They do not establish every loader format or every multi-record analysis.

2. Select N50 Statistics explicitly

The current interface initially selects twenty analysis tracks. Clear the other selections and retain N50 Statistics (n50_statistics) for this example. Confirm the loaded records, then run the selected route. The reviewed workflow used the production FASTA loader, this app’s Run action and the native result viewer. It did not test the full launcher journey or a hosted server.

Check the input-QC result before reading the figure. For the 7, 5, 3 fixture, the generic QC CSV reports Sequence length = 7, because that field describes the first record. The N50 table reports Number of contigs = 3 and Total assembly (bp) = 15, covering all three records. Those fields have different scopes. A QC warning about trailing bases ignored by frame-translation summaries does not mean that N50 trimmed the contigs.

3. Read N50 and L50 together

Order the contig lengths from longest to shortest and accumulate them until their total reaches at least half the assembly length. N50 is the length of the contig at that boundary; L50 is the minimum number of contigs needed to reach it. Reaching exactly half is sufficient. N50 has length units; L50 is a contig count. The QUAST manual defines these assembly-length summaries and distinguishes NG50, which instead uses a reference-genome denominator.

Saved contig lengthsSaved N50 / L50What the example shows
7, 5, 35 bp / 2 contigsThe first contig alone is below half of 15; the first two reach 12.
10, 5, 510 bp / 1 contigThe first contig reaches exactly half of 20.
6, 6, 66 bp / 2 contigsTwo tied contigs suffice. L50 is not the count of every contig tied at N50.
1313 bp / 1 contigA single record has N50 equal to its own length.

The same threshold convention gives N75 and N90. The saved 7, 5, 3 result has N75 = 5 bp, N90 = 3 bp and L90 = 3 contigs. The exported table includes no L75 field. N50 is neither the ordinary mean nor the ordinary median contig length, even when their values happen to coincide.

4. Preserve numeric precision and the plot’s meaning

The app computes auN as the sum of squared contig lengths divided by the total length, a length-weighted mean with the same length unit. Heng Li’s primary explanation gives this formula. For 7, 5, 3, the saved CSV retains 5.533333333333333. For 10, 5, 5, the ordinary mean retains 6.666666666666667 and auN is 7.5. These are serialized floating-point values, not arbitrary-precision arithmetic.

The Nx Curve plots percentage on its horizontal axis and contig length on its vertical axis, with N50 and N90 markers. The implementation samples integer percentages from 1 through 100 and joins the points. Use the saved table’s formula-based auN; do not treat a trapezoidal area measured from this sampled, percentage-scaled picture as the exported value. The curve does not show genomic positions, read depth, a confidence interval or sequence alignments.

5. Keep all six files and the original input

Use the native viewer’s Export All action for the selected results. Each reviewed fixture has five listed export artifacts plus a separate artifact manifest, for six files altogether:

Saved fileContents and boundary
N50_Statistics.csvFourteen parameter rows: contig count, total length, largest, smallest, mean, median, N50, L50, N75, N90, L90, auN, Formula and Ref.
Sequence_Statistics_Contract_QC.csvTen QC fields. First-record length and rounded QC fractions retain their own meaning.
Nx_Curve.pngThe figure; it does not replace the numerical CSV.
Summary.txtText summary of the selected run.
analysis_report.jsonAn inventory of four displayed results: one plot, two tables and one text. It does not embed the table values or input sequences.
artifact_manifest.jsonHashes and sizes of the five listed artifacts. Keep the manifest itself too.

The guide reopens all 24 saved files across four fixtures and matches all 56 N50 CSV fields to their saved native tables. Thirty-two numeric fields also match the existing independent reference values. This reuses the earlier comparisons; it is not a new assembly analysis. QC fractions are formatted to four decimal places, unlike the numeric mean, median and auN values retained in the N50 CSV.

The QC CSV points to a separately saved QC JSON through a local machine path. That JSON is outside the six-file viewer set; a copied path does not carry its contents. Preserve the original FASTA and any needed QC JSON separately, with their identities. The report’s provenance object is empty in these examples, and this export set is not a reloadable session. Inspect identifying paths before sharing it.

6. Keep comparisons within their scope

This route summarizes the lengths of all accepted records; it has no minimum-contig filter in the reviewed implementation. QUAST’s documented default minimum is 500 bp, so these tiny fixtures are not a default QUAST comparison. Record any filtering performed before upload. Changing which contigs are included can change the denominator and the result.

A larger N50 or auN alone does not establish assembly correctness, completeness, freedom from contamination or absence of misassemblies. This route supplies no reference-genome comparison, alignment-based assessment or NG50 result. The four synthetic fixtures do not establish behavior on large assemblies, cancellation, the other nineteen analysis tracks or a real biological dataset.

Worked examples describe particular inputs, methods and recorded results. Check current availability and input requirements before planning an evaluation.

← Back to the learning center