HomeBioinformaticsDNA Sequencing

🔬 DNA Sequencing

Simulate next-generation sequencing: short reads align to a reference genome using Smith-Waterman. Identify SNPs (single nucleotide polymorphisms), coverage depth, and assemble contigs with overlap-layout-consensus.

Bioinformatics3DModerate60 FPS💧 Water
dna-sequencing ↗ Open standalone

About DNA Sequencing Simulation

This simulation models the core stages of next-generation sequencing (NGS), in which many short DNA reads are sampled from a genome and aligned back to a reference sequence using the Smith-Waterman local alignment algorithm. You can observe how coverage depth, read length, and sequencing error rate interact to determine alignment quality, variant detection accuracy, and the completeness of assembled contigs. The simulation visualizes alignment pileups, SNP calling, and overlap-layout-consensus assembly in real time.

DNA sequencing underpins modern genomics, clinical diagnostics, and evolutionary biology. From the first Sanger sequencing of phage PhiX174 in 1977 to Illumina short-read platforms sequencing billions of bases per run today, the ability to read DNA cheaply and accurately has transformed medicine, agriculture, and our understanding of life.

Frequently Asked Questions

What is DNA sequencing?

DNA sequencing is the process of determining the precise order of nucleotide bases — adenine (A), thymine (T), guanine (G), and cytosine (C) — in a DNA molecule. Modern next-generation sequencing platforms fragment the genome into millions of short reads, sequence them in parallel, and then use computational alignment to reconstruct the original sequence. This enables scientists to identify genetic variants, study gene expression, and diagnose hereditary diseases.

How do I use this simulation?

Select a mode from the control panel: Alignment shows reads mapped against the reference, SNP Calling highlights positions where mismatches recur across multiple reads, and Assembly displays assembled contigs with overlap arrows. Adjust the Error Rate slider (0–10%) to introduce sequencing noise, Coverage Depth (5–50x) to control how many reads are sampled, and Read Length (50–300 bp) to change fragment size. Use the preset buttons for quick scenarios, then press Regenerate Reads to resample and observe how the statistics — N50, aligned reads, SNPs found, and assembly percentage — respond.

What does coverage depth mean and why does it matter?

Coverage depth (denoted c) is the average number of reads that overlap any given base in the reference, calculated as c = N x L / G, where N is the number of reads, L is read length, and G is genome length. At low coverage (below 5x) many positions are unread, leading to gaps in the assembly. At 20–30x the vast majority of positions are covered and SNP calls become reliable; beyond 50x the gain in accuracy diminishes but rare variant detection improves. The simulation lets you drag coverage from 5x to 50x and watch how assembly completeness and N50 change accordingly.

How does Smith-Waterman alignment work?

Smith-Waterman is a dynamic programming algorithm for local sequence alignment, introduced by Temple Smith and Michael Waterman in 1981. It fills a scoring matrix where each cell score(i,j) = max(score(i-1,j-1) + substitution(i,j), score(i-1,j) - gap_penalty, score(i,j-1) - gap_penalty, 0). The zero floor is the key difference from global alignment: it allows an alignment to start anywhere and terminate at any high-scoring cell, making it ideal for matching short reads against a longer reference even when the read is noisy or only partially overlapping.

What is a single nucleotide polymorphism (SNP) and how is one called?

A SNP is a position in the genome where a single base differs between individuals or between a sequenced sample and a reference. In sequencing data, a SNP appears as a consistent mismatch across many independent reads at the same position. Variant callers distinguish true SNPs from sequencing errors by requiring the alternative base to appear in a minimum fraction of reads (typically 20–30%) and at sufficient coverage (often at least 8x). Random errors are scattered across reads and positions, whereas a true SNP recurs at the same site in every read that covers it.

What is the N50 metric and how should I interpret it?

N50 is the length of the shortest contig in the set of longest contigs that together cover at least 50% of the total assembly length. It is a length-weighted median rather than a simple average: a handful of long contigs can push N50 high even if many short contigs exist. In this simulation, higher coverage and lower error rates produce fewer, longer contigs and therefore a higher N50. The metric is the standard benchmark for comparing genome-assembly contiguity; a human genome assembly with N50 above 10 Mb is considered chromosome-scale.

What were the key milestones in DNA sequencing history?

Frederick Sanger and Walter Gilbert independently developed the first practical sequencing methods in 1977, sharing the Nobel Prize in Chemistry in 1980. Sanger's chain-termination method became the workhorse of the Human Genome Project, completed in 2003 at a cost of roughly three billion dollars. The launch of Illumina's short-read platforms in the mid-2000s reduced the cost per genome to under a thousand dollars by 2014. Oxford Nanopore and Pacific Biosciences subsequently introduced long-read sequencing, enabling near-complete assembly of complex genomes including the first gapless human reference sequence published in 2022.

What are the main real-world applications of DNA sequencing today?

Clinical genomics uses sequencing to diagnose rare genetic disorders, guide cancer treatment through tumour mutation profiling, and screen newborns for hundreds of inherited conditions. Infectious disease genomics enabled rapid SARS-CoV-2 variant tracking during the COVID-19 pandemic. Agriculture applies sequencing to breed disease-resistant and high-yield crop varieties. Forensic science uses short tandem repeat (STR) profiling for identification, and environmental DNA (eDNA) sequencing lets ecologists survey biodiversity from water or soil samples without capturing organisms.

Is it true that more coverage always gives better results?

Not necessarily. Coverage follows a law of diminishing returns: going from 5x to 30x dramatically improves assembly completeness and SNP accuracy, but going from 100x to 500x adds little for a standard diploid genome. Extremely high coverage can even introduce noise because sequencing artefacts — such as optical duplicates on Illumina platforms — accumulate and must be removed. For most germline variant studies 30x is standard; for somatic mutation detection in cancer, where only a fraction of cells carry the mutation, 100–1000x targeted coverage may be required.

How does genome assembly differ from alignment?

Alignment maps reads to an existing reference sequence; assembly reconstructs a sequence from scratch without a reference using only the overlaps between reads. The overlap-layout-consensus (OLC) approach used in this simulation finds pairs of reads that share a suffix-prefix overlap, builds an overlap graph, finds a path through it (layout), and derives a consensus base at each position. De Bruijn graph assembly, used by tools such as SPAdes and Velvet, is an alternative that breaks reads into short k-mers and is better suited to short Illumina reads. Long-read assemblers such as Flye and Hifiasm can produce near-complete chromosomes in a single run.

What frontier challenges remain in DNA sequencing and assembly?

Highly repetitive regions — centromeres, telomeres, and segmental duplications — remain difficult to assemble because reads shorter than the repeat unit cannot span them unambiguously; only ultra-long reads (100 kb+) from Oxford Nanopore resolve them. Haplotype phasing, determining which variants occur on the same chromosome copy, is still computationally demanding for heterozygous diploid or polyploid genomes. Epigenomic sequencing that simultaneously reads base sequence and DNA methylation from the same molecule is an emerging capability. Spatial transcriptomics, which maps gene expression to physical locations within tissue slices, and single-cell sequencing that sequences individual cells rather than bulk populations are rapidly expanding the scope of what sequencing can reveal.

About this simulation

This interactive tool models the core stages of next-generation sequencing, where many short reads sampled from a genome are aligned back to a reference. Short fragments are matched using the Smith-Waterman local alignment recurrence, score(i,j) = max(diagonal + substitution, up − gap, left − gap, 0), then stacked to build a coverage profile. From the pileup you can spot single nucleotide polymorphisms, measure read depth, and reassemble contiguous segments to study how coverage governs assembly quality.

🔬 What it shows

A random 80 bp reference genome, short reads (12-18 bp) drawn from it with errors introduced at your chosen rate, and the resulting coverage histogram. SNP sites are seeded roughly every 20 bp. Smith-Waterman scoring underlies alignment, coverage follows c = N·L/G, and assembly reports contig spans plus the N50 length (the contig size at which half the assembly is covered).

🎮 How to use

Pick a Mode — Alignment, SNP Calling, or Assembly. Drag the sliders for Error Rate (0-10%), Coverage Depth (5-50×) and Read Length (50-300 bp), or tap presets such as Perfect reads, 5% error, High coverage and Low coverage. Press Regenerate Reads to resample. The side panel tracks N50, aligned reads, SNPs found, assembly percentage and coverage.

💡 Did you know?

The N50 metric is deliberately length-weighted rather than a simple average: it is the contig length such that contigs of that size or longer cover at least half the assembled bases, so a few large contigs raise it sharply. It remains the standard yardstick for comparing genome-assembly contiguity.

Frequently asked questions

What is DNA sequencing in this simulation?

It is a simplified model of next-generation sequencing, in which many short reads sampled from a genome are aligned back to a known reference. The simulation generates an 80 bp reference, produces short reads with realistic errors, and then aligns, calls variants and assembles them so you can see each stage visually.

How does the alignment actually work?

Reads are placed against the reference using local sequence alignment based on the Smith-Waterman recurrence, score(i,j) = max(diagonal + substitution, up − gap, left − gap, 0). The zero floor in that formula allows alignments to start anywhere, which is what makes it a local rather than global method and lets noisy reads still match their best region.

What do the Error Rate, Coverage and Read Length controls do?

Error Rate (0-10%) sets how often a read base is randomly substituted, simulating sequencing noise. Coverage Depth (5-50×) controls how many reads are sampled, following c = N·L/G. Read Length (50-300 bp) changes how long each fragment is; together these determine how reliably SNPs are called and how complete the assembly becomes.

What is a SNP and how is it distinguished from an error?

A single nucleotide polymorphism is a genuine single-base difference present at a consistent position, whereas a sequencing error is random and rarely recurs at the same spot. The simulation seeds SNP sites about every 20 bp and marks them in red; real callers rely on the same logic, requiring a mismatch to appear in many overlapping reads before accepting it as a true variant.

Is this an accurate representation of real sequencing?

It is a faithful conceptual model rather than a production pipeline. The alignment recurrence, coverage equation and N50 definition are genuine, but real sequencers handle millions of reads, paired ends, base-quality scores and far more sophisticated assembly graphs. The simulation deliberately scales everything down so the relationships between depth, error and assembly quality stay visible.

⚙ Under the hood

Smith-Waterman sequence alignment, SNP detection and bioinformatics algorithms for DNA sequencing.

DNA sequencingSmith-WatermanalignmentSNPbioinformatics

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)