See a whole genome at once
MeanderViz folds chromosomes, assemblies and alignments onto space-filling curves, so millions of positions fit one square and neighbours stay neighbours.
Everything runs in your browser. Your files are never uploaded.
What do you want to explore?
How it works
- Choose and load. Pick the kind of data, then open your files or an example. Nothing leaves your computer.
- Explore. The square shows a whole chromosome, assembly or alignment; the linear tracks below show the same region in order. Zoom, pan, select, compare samples, switch to 3D.
- Review and export. The table lists what MeanderViz found. Click a row to go there; save the table, a BED file or an image.
Examples
Every example opens as live output with a three-step guide above the panel, and can be downloaded as the original files to see the formats. Real marks real data.
See a whole chromosome at once
MeanderViz folds a chromosome onto a Hilbert curve so 262,144 positions fit in one square, about 250 times the detail of a linear track. Use it for structural variants or any genome-wide signal: read depth, ChIP-seq, methylation, conservation.
Reading files
Candidate variants
| Load data to list candidate variants or regions that differ. |
Data sources
Open your own files from the Explore page (Data tab), add public annotations to the data you are exploring, fetch files from the web, or start from an example. Queries to public databases send only a genome name and coordinates; your own files never leave this browser.
Public databases
Load data first (your files or an example), so MeanderViz knows which chromosomes to fetch.
From a web address
Paste links to bedGraph, WIG, BED, GTF, BEDPE or VCF files, plain or gzip, one per line. The server must allow cross-site downloads (CORS), as GitHub, Zenodo, ENCODE and UCSC download servers do.
Imported tracks
Nothing imported yet.
Examples
The ten example datasets, with guides and downloads, are on the Examples page.
API
MeanderViz can be driven by scripts on the page, by links, from a page that embeds it, over a REST API, and from the command line. The web app itself sends nothing anywhere; the REST API is a separate service at meanderviz.org that deletes what it receives after an hour. The same text is in API.md in the downloadable package.
JavaScript: window.MeanderViz
Available on any page that includes MeanderViz, for example in the browser console (F12). Methods that load or navigate return a promise of the current state (see state()).
| Method | What it does |
|---|---|
load(items, {kind, roles}) | Load File objects, or URLs (strings, fetched with CORS). kind: sv, signal, asm or msa. roles: { "tumour.bam": "s1", "normal.bam": "ref" }. |
example(id) | Open an example: sv, signal, dna, asm, mito, variants, vspike, msa, spike, pan. examples() lists them. |
goto("chr1:14,200,000-14,650,000") | Go to a region, a chromosome or contig, or a feature name. |
zoom(level, centre) | Zoom level 0 (whole) to 6, centred on a position. |
select([[start, end], …]), clearSelection() | Select genomic intervals, or alignment columns. |
view({mode, focus, curve, dim, res, palette, cmap, bg, large, baseline, sequence, reference, kind}) | Change what is shown. mode: cmp, val, dna, syn. focus: ref, s1…s4. curve: hilbert, moore, morton, gray, snake. dim: 2 or 3. res: 1, 2 or 4. sequence and reference: a name or index (alignments). |
settings({support, rd, minSites, minAln, …}) | Read or change the analysis thresholds; returns the current settings. |
findings(), csv() | The table as an array of objects, or as CSV text. |
selectFinding(id) | Go to a row of the table. |
bookmark(), bookmarks() | Keep the region in view; list the bookmarks. |
export(format, opts) | format: csv, bed, png, jpeg, svg or pdf. For images, opts: content (panel, figure, 3d, aln, dot), width in pixels (default 2400), bg (panel, white, transparent), title (true or false), name. |
link() | A URL that reopens the current example, region and view. |
session(), loadSession(obj) | The session as an object (files list, settings, view, selection, bookmarks), and restoring one. |
chromosomes(), state() | Names and lengths; the kind of data, chromosome, region in view, view settings, selection and tracks. |
core | The engine (see below) for direct use. |
await MeanderViz.example("sv");
await MeanderViz.goto("chr1:14,200,000-14,650,000");
await MeanderViz.view({ curve: "moore", dim: 3 });
console.table(MeanderViz.findings());
await MeanderViz.export("svg", { content: "figure", width: 3000 });
Events
MeanderViz.on(type, callback) and off. The callback receives a CustomEvent whose detail is the state (or the finding).
load | data are ready (a chromosome, assembly or alignment has been read) |
view | the region in view or the display changed |
selection | a selection was made |
finding | a row of the table was chosen; detail has id, type, chrom, start, end, label |
Links (URL parameters)
Query parameters open the app in a given state, for example index.html?example=asm&locus=ctg2:20000-24000&mode=syn. MeanderViz.link() builds such a link for the current view.
example | an example id |
url | comma-separated URLs of files to load (the server must allow cross-site downloads); kind sets the kind of data |
locus | chr1:14200000-14650000, ctg2, or a feature name |
mode, curve, dim, focus, res, palette, cmap, sequence | as in MeanderViz.view |
Embedding with postMessage
Put MeanderViz in an <iframe> and send commands. Every cmd is a method of MeanderViz; the reply is { meanderviz: { id, result } } or { meanderviz: { id, error } }. MeanderViz also posts the load, selection and finding events to its parent as { meanderviz: { event, detail } }.
const frame = document.querySelector("iframe");
frame.contentWindow.postMessage({ meanderviz: { id: 1, cmd: "example", args: ["variants"] } }, "*");
frame.contentWindow.postMessage({ meanderviz: { id: 2, cmd: "goto", args: ["sars-cov-2_variants:23000-24000"] } }, "*");
window.addEventListener("message", (e) => { if (e.data.meanderviz) console.log(e.data.meanderviz); });
REST API
The same analyses as a web service, at https://meanderviz.org/api/v1 (self-hosted: node server/server.js). No login. Files are uploaded, referenced by URL, or taken from the packaged examples; analyses run as jobs; uploaded files and results are deleted after one hour. The full description is at /api/v1/openapi.yaml (OpenAPI 3).
| Endpoint | What it does |
|---|---|
GET /api/v1 | Lists the endpoints. GET /health: status. |
GET /curve?order=9&d=12345&curve=hilbert | Curve index to pixel, or x=&y= to index. GET /curve3d?bits=6&d=… for 3D. |
GET /examples, GET /examples/{id} | The example datasets and their files, usable as examples/<name> references. |
PUT /files (raw body, header X-Filename)POST /files (multipart form) | Upload; returns file ids (f_…). DELETE /files/{id} removes a file early. |
POST /findings | Structural-variant candidates. Body: {sample, reference?, pairs?, chrom?, support, rd, mapq, wait?}. |
POST /sites | Variable sites of an alignment, or accessory genes of a presence/absence matrix. Body: {alignment, reference?, min?, wait?}. |
POST /assembly | Assembly statistics, gaps and read-depth problems. Body: {fasta, depth?, rd?, wait?}. |
POST /bins | Mean value of a track over n bins of a region (read depth, or GC/skew/CpG of a FASTA). Body: {file, chrom, start?, end?, n?, metric?, wait?}. |
POST /chromosomes | Chromosomes or contigs and their lengths in a file. Body: {file, wait?}. |
GET /jobs/{id}, GET /jobs/{id}/result?format=json|csv | Job status and result. Analyses answer 202 with the job; pass "wait": true to get the result in one call. |
# upload, then analyse (JSON in, JSON or CSV out)
FID=$(curl -s -X PUT -H "X-Filename: tumour.bedgraph" --data-binary @tumour.bedgraph https://meanderviz.org/api/v1/files | jq -r .id)
curl -s -X POST -H "Content-Type: application/json" \
-d "{\"sample\":\"$FID\",\"reference\":\"examples/reference.bedgraph\",\"chrom\":\"chr1\",\"wait\":true}" \
https://meanderviz.org/api/v1/findings | jq .result
# a job, polled, result as CSV
JOB=$(curl -s -X POST -H "Content-Type: application/json" -d '{"alignment":"examples/sars-cov-2_spike.fasta","reference":"Wuhan-Hu-1/2019","min":3}' https://meanderviz.org/api/v1/sites | jq -r .id)
curl -s https://meanderviz.org/api/v1/jobs/$JOB
curl -s "https://meanderviz.org/api/v1/jobs/$JOB/result?format=csv"
Limits: 120 requests per minute per address, two analyses at a time, uploads up to 2 GB, jobs stopped after 30 minutes. URLs given to the API must point to public hosts. Python: requests.put(url + "/files", data=open(f, "rb"), headers={"X-Filename": f}), then requests.post(url + "/findings", json={...}).
Node.js and the command line
src/core.js is the engine, with no dependence on the page: space-filling curves in 2D and 3D, readers for BAM/BAI, bedGraph, WIG, FASTA, BEDPE, VCF, BED, GTF, PAF, alignments and gene matrices, and the analyses. In Node.js:
global.pako = require("./vendor/pako.min.js");
const MC = require("./src/core.js");
MC.d2xy(9, 12345); // [x, y] on the 512 x 512 Hilbert curve
MC.CURVES.moore.xy2d(9, 100, 200); // curve index of a pixel
MC.hilbertNd(500, 6, 3); // 3D Hilbert curve, 64^3 voxels
Files are given to the readers as objects with name, size and slice(a, b), like the browser File; bin/meanderviz-cli.js wraps a path that way. The command line tool prints CSV and uses the same thresholds and rules as the web app:
node bin/meanderviz-cli.js findings --sample tumour.bedgraph --reference normal.bedgraph --pairs tumour.bedpe --chrom chr1
node bin/meanderviz-cli.js sites --alignment genomes.fasta --reference Wuhan-Hu-1 --min 10
node bin/meanderviz-cli.js assembly --fasta draft.fa --depth reads.bam
node bin/meanderviz-cli.js hilbert --order 9 --d 12345
Both are in the downloadable package (About).
Try it
Run a command against the data that are loaded now. Arguments are a JSON array.
–
Help
MeanderViz folds a whole chromosome, genome or alignment onto a Hilbert curve so that it can be seen at once, at about 250 times the resolution of a linear track. It has four modes. Structural variants combines read depth and paired-end evidence. Genomic signal works with any per-position measurement, such as ChIP-seq or ATAC-seq coverage, DNA methylation, replication timing, GC content or conservation scores, together with feature annotations such as genes. Assembly checks a genome assembly against its reads and compares it with another assembly. Alignment shows multiple sequence alignments of DNA, RNA or protein, and gene presence/absence matrices of pangenomes and metagenomes. This page explains how to load data, how to read the pictures and how far to trust them.
Quick start
- On the Home page, choose what you want to explore: structural variants, genomic signals and DNA, genome assemblies, or alignments and pangenomes. Each card says which files it needs.
- Press Try an example to see live output with a short guide above the panel, or Open your files. You can also drop files onto the Data tab of Explore at any time. MeanderViz recognises the file types and suggests a role for each; change a role with the menu next to the file name, then press Analyse.
- Explore. Hover over the square to read positions and values. Scroll or use + and − to zoom, drag to pan. The linear tracks below show the whole sequence and the region in view, in order. The table below lists what MeanderViz found; click a row to go there.
- Undo and redo any step with the arrow buttons in the toolbar, or Ctrl+Z and Ctrl+Shift+Z (⌘Z and ⌘⇧Z on a Mac).
The workspace
| Where | What you find there |
|---|---|
| Data tab | What you are exploring (variants, signal, assembly, alignment), the file drop zone, the loaded files with their roles, and Analyse. |
| Samples, Assembly, Alignment or Genomes tab | Options for the kind of data: which samples to include and what to compare them with; assembly statistics, contig order and the comparison with another assembly; the reference sequence, sequence order, residue colours and gene order. |
| View tab | Chromosome, what the colours show, which track is in the main panel, the space-filling curve, guides, features, colour limits, label size and resolution. |
| Colours tab | Colour schemes for comparisons, values, variant types, features and bases, and the panel background. |
| Settings tab | Thresholds that decide what goes into the table, and the genome browser for links. |
| Toolbar | Undo and redo, previous and next region, the locus box, zoom, large view, bookmark; below: the pointer tool, previous and next finding, 2D or 3D, and saving an image. |
| Overview tab | A small whole-chromosome view of every sample (click the one shown to jump there), the similarity of samples, the small curve of every sequence or genome, and the dot plot of two assemblies. |
| Details tab | Values at the pixel you clicked, a summary of your selection, or the finding you chose. Opens by itself when you click or select. |
| Bookmarks tab | Regions you kept with the bookmark button or B. |
Examples
The ten example datasets live on the Examples page, grouped by kind of data. Each opens as live output with a three-step guide above the panel and can be downloaded as the original files, to see the formats. Elsewhere, "Examples" always links to that page.
Reading the Hilbert view
The main panel is 512 by 512 pixels, so a chromosome is split into 262,144 equal bins, one per pixel. For human chromosome 1 that is about 950 base pairs per pixel, compared with about 200,000 per pixel for a 1,200-pixel linear track. A 40 kb deletion covers a single column of a linear track but about 40 pixels here, forming a visible patch.
The curve starts in the top-left corner and ends in the top-right. The genome frame around the panel shows every chromosome in order, clockwise from the top-left, with the current one highlighted.
Colour by log2 ratio. Blue pixels have more reads than the reference and orange pixels fewer. The stronger the colour, the larger the change. A heterozygous deletion gives a log2 ratio near −1, a single-copy gain on a diploid background near +0.58, a homozygous deletion a strongly negative value. White means no reads in either sample, typically a centromere or assembly gap.
Colour by read depth. Darker pixels have deeper coverage, up to the depth colour limit.
One caution: two pixels that touch are not always close on the chromosome. Where the curve turns between large quadrants, positions millions of bases apart can sit side by side. Hover to check coordinates before concluding that two patches belong to one event. The linear view below the panel shows the true order.
Structural variants
For structural variants, MeanderViz combines two independent signals: read depth, which falls in deletions and rises in duplications, and read pairs that map too far apart or in the wrong orientation. Load up to four samples and a reference (for example tumour subclones and the matched normal); MeanderViz compares each sample with the reference, draws the pairs, and lists candidates in the table.
Paired-end signatures
For a standard forward-reverse library, pairs whose mapping disagrees with the expected distance or orientation point to rearrangements. MeanderViz estimates the expected insert size from properly paired reads (median plus five times the robust spread) and classifies the rest:
| Pattern of the two reads | Suggests | Drawn as |
|---|---|---|
| Forward then reverse, too far apart | Deletion | Orange line |
| Reverse then forward | Tandem duplication | Blue line |
| Same strand (forward-forward or reverse-reverse) | Inversion | Purple line |
| Mates on different chromosomes | Translocation | Green line to the genome frame |
Pairs are grouped into clusters when both ends fall within the clustering window (1 kb by default). Only clusters with at least the minimum number of pairs (3 by default) are drawn, which removes most chimeric and mis-mapped pairs.
Candidate variants and regions that differ
In structural variant mode, the table lists candidates for the current chromosome, built from two independent signals:
- Pairs: a cluster of discordant pairs.
- Depth: a run of windows whose mean log2 ratio stays beyond the read-depth threshold (0.4 by default). MeanderViz chooses the smallest window, a power of two in pixels, at which the noise (robust standard deviation) is below a quarter of the threshold, so a change at the threshold stands about four standard deviations above noise. A run needs at least two windows. Regions where the reference has less than 20% of its median depth are ignored.
A deletion or duplication cluster whose span also shows lower or higher depth is marked Pairs and depth and drawn as a filled diamond. This double evidence is the most reliable class. Inversions and balanced translocations do not change depth, so they are always Pairs only.
| Column | Meaning |
|---|---|
| Location | 1-based coordinates. The link opens the region in the genome browser chosen in the Settings tab. |
| Pairs | Number of discordant pairs in the cluster. |
| log2 ratio | Mean ratio over the whole span, after normalising for sequencing depth. |
| Also in | Other samples with the same kind of event at the same place (at least 50% reciprocal overlap). Unique marks events seen in one sample only, such as de novo changes in a single subclone. |
| Features | Names of annotation features that overlap, when feature files are loaded. |
| External call | The ID of a matching call from an uploaded VCF or BED file. |
Save the table as CSV, or as BED to load it into IGV or the UCSC browser. The download button saves images in PNG, JPEG, SVG or PDF (see SessionsSaving images).
Genomic signals
Choose Genomic signal in the Data tab for any measurement along the genome. MeanderViz then treats values differently from read depth:
- Missing data stays blank. A bin is averaged only over the bases that have a value, so sparse data such as CpG methylation or unmappable regions appear as gaps, not as zero.
- Values are coloured with the viridis scale by default, from dark purple (low) to yellow (high), up to the value colour limit (the 98th percentile at the default setting). Signals with negative values, such as conservation scores, are shown with the blue and orange scale around zero.
- Comparison of a sample with the reference uses the log2 ratio for positive signals such as coverage, or the difference in units of its typical spread for signals that can be zero or negative. Without a reference, each sample is compared with its own median, which highlights domains of enrichment or depletion.
- Regions that differ are found with the same noise-adaptive method as read-depth changes (see below). The table lists the features they overlap, which answers questions such as which genes lie in a domain that gained signal after treatment.
Features from BED or GTF files are drawn as outlines in the main panel and as bars in the linear tracks. Switch each file on or off under Features in the View tab. Type a feature name, such as a gene symbol, into Go to region to jump to it.
DNA sequence and other linear data
Open a FASTA file (.fa, .fasta, .fna, plain or gzip) to see a genome's sequence itself. MeanderViz derives four tracks from it:
- GC content, with a Bases colouring: each pixel mixes the colours of the bases it covers (A green, C blue, G orange, T red). Where a pixel covers one base or less, you see the sequence letter by letter; further out, the mixture shows AT- and GC-rich stretches.
- GC skew, (G − C)/(G + C), which changes sign at replication origins and termini in bacteria and organelles.
- CpG observed/expected, high in CpG islands and in genomes without CpG methylation.
- Cumulative GC skew along the chromosome, whose minimum and maximum mark the origin and terminus of replication in many bacteria.
The derived tracks use a sliding window (DNA composition window in the Settings tab; 0 chooses about eight whole-chromosome pixels, at least 100 bp). Plain FASTA is read by position, like samtools faidx, so large genomes work; lines within a sequence must have equal length. Gzip FASTA is held in memory, so use it for small genomes.
The Arabidopsis chloroplast example is a real genome: 154,478 bp (NC_000932.1) with its genes and its four structural regions, which MeanderViz's comparison finds from the sequence alone. The two inverted repeats come out GC-rich (42% against 34% in the large and 29% in the small single-copy region).
Any other one-dimensional measurement works the same way when written as bedGraph or WIG: conservation, recombination rate, mappability, replication timing, or values along a protein or any sequence with positions.
The 3D view folds the chromosome onto a Hilbert curve for display. A Hilbert-like fractal globule has been proposed as an idealised model of how chromatin folds, but the 3D view is a layout, not the physical structure of the DNA in the nucleus.
Genome assemblies
Choose Assembly in the Data tab, or open a PAF file and MeanderViz switches to it. Give it the assembly's FASTA, and optionally reads mapped to it (BAM with BAI, or bedGraph) and its alignment to another assembly or a reference (PAF). The contigs are joined end to end, longest first by default, so the whole assembly fits one square; the frame around the panel shows the contigs, and positions everywhere are given as contig:position. Type a contig name in the locus box to go to it.
Checking an assembly with its reads
- Collapsed repeats: stretches with 1.6 times the median read depth or more, where copies of a repeat were assembled into one. The table estimates how many copies.
- No read coverage and low coverage: stretches the reads do not support.
- Possible misjoins: read pairs from inside a contig whose mates continue in another contig; the join inside the contig is suspect.
- Contig links: pairs joining the ends of two contigs, which show how contigs could be ordered into scaffolds.
- Scaffold gaps: runs of N in the FASTA. The Assembly tab also lists the number of contigs, N50, L50, the largest contig and GC.
Comparing with another assembly
- Synteny colours (Show: Synteny): each pixel is coloured by where it lies in the other assembly, along a rainbow from its start to its end. Where the order is kept the colours change smoothly; a sudden change of colour is a break; stripes mark the reverse strand; paler colours, lower identity; blank, no alignment. Dashed lines join places that are next to each other in the other assembly but not here.
- Identity: a track of the identity of the alignment at every position.
- Dot plot, in the Overview tab on the right: this assembly along the bottom, the other up the side. Diagonals going up are the same strand, going down the reverse strand. Click a segment to go to it.
- The table adds the breakpoints: joins different sequences (a contig containing parts of two chromosomes, often a misjoin), out of order, orientation changes, aligns twice (a repeat present once here and twice there, typical of collapsed repeats), not in the other assembly and low identity.
The same view shows synteny between species: align one genome to the other with minimap2 (-x asm20 for closely related species) or another whole-genome aligner that writes PAF.
Multiple sequence alignments
Open an alignment (Clustal, Stockholm or aligned FASTA; nucleotide or protein, detected automatically) and MeanderViz switches to Alignment mode. The alignment's columns take the place of positions along a chromosome, so everything on this page, from zooming and selections to the 3D view, works on alignments too. A 30,000-column virus alignment fits the panel at about nine pixels per column; zoom in until a column fills 16 by 16 pixels.
What you see
- Main panel. Colour by Residues to see one sequence on the curve, in base colours (A, C, G, T) or protein colours (Clustal, Zappo or hydrophobicity). With Show only differences from the reference, residues that match are faded, so a sequence that differs in a few places shows a few bright points. Colour by Value to see one of four tracks computed from the alignment: Conservation (the fraction of sequences with the most common residue), Diversity (Shannon entropy in bits), Gaps and missing, and the Differences of the shown sequence from the reference.
- Alignment of the region in view, under the panel: the classic view, one row per sequence, with the consensus and the reference at the top. Columns follow the main panel. Letters appear when a column is wide enough; matching residues show as dots when only differences are shown. Hover for the residue and the sequence's details, click a row to show that sequence, drag to select columns.
- Sequences, in the Overview tab on the right: every sequence as its own small 64 by 64 curve, coloured where it differs from the reference and grey where data are missing. Because all squares use the same curve, a change shared by many sequences appears at the same spot in each. Filter by name, country or date; click a square to show that sequence.
- Variable sites, the table: every column where at least the chosen number of sequences differ from the reference, most frequent first, with the change in reference coordinates (such as
A23403GorD614G), the alternative residues and their counts, missing data and overlapping features. Click a site to zoom to it and show the first sequence that carries it.
Choices
- Compare sequences with: a reference sequence, or the consensus of all sequences. Changing it recomputes differences, sites and the small curves.
- Order sequences by: file order (for example tree order), similarity to the reference, or any metadata field in the headers, such as date, clade, lineage or country. Colour marks by colours the mark beside each name and under each small curve by a metadata field, such as WHO variant name or clade, with a legend.
- Features from a BED file, such as genes or protein domains, must be in alignment columns; any sequence name in the file is accepted.
3D
- Stack of sequences: each sequence is one layer of the same 2D curve, ordered as in the list, top to bottom. Differences from the reference are points in residue colours. A change carried by many sequences forms a vertical pillar through the stack, and when the stack is ordered by date you can see when a change appeared and how it spread. Show values beyond becomes the minimum share of sequences that carry a change; lower it to see rare changes. Hover a point for the sequence and the change; click to show it in 2D.
- Columns on a 3D curve: the alignment's columns folded onto the 3D Hilbert curve, coloured by the track shown, as for genomes.
Alignments are held in memory: a few hundred sequences of 30,000 columns take about 13 MB. MeanderViz does not align sequences; use MAFFT, MUSCLE, Clustal Omega or Nextclade first.
Pangenomes and metagenomes
Open a gene presence/absence table (the gene_presence_absence.Rtab or .csv of Roary, Panaroo or PIRATE) and MeanderViz treats it like an alignment whose rows are genomes and whose columns are genes. Everything in the alignment section applies.
- Genomes, in the Overview tab on the right: one small square per genome, coloured where the genome differs from the majority. Genes gained are blue, genes lost orange. Because genes that occur together are placed next to each other, a genomic island shared by a group of genomes appears as the same patch in each of their squares.
- Order genes by: presence pattern (the default; genes with the same pattern of presence side by side, core genes first), frequency, file order, or genome order when a Roary table gives the genome fragment and order of each gene.
- Accessory genes, the table: every gene not in all genomes, classed as soft core (95–99% of genomes), shell (15–95%) or cloud (under 15%), with its annotation. The heading counts core, soft-core, shell and cloud genes.
- Add the genomes' tree (Newick) to order them by Tree order; the 3D stack then shows which clades gained or lost which genes.
Metagenomes: any table with features in rows (species, genes, bins or contigs) and samples in columns works the same way. Numbers such as read counts or relative abundances are shown on a nine-step log scale, with blanks where a feature is absent, so the squares compare the make-up of the samples.
Navigating like a genome browser
The toolbar above the main panel works like the one in a genome browser.
- Locus box. It always shows the region in view. Type a region (
chr1:14,200,000-14,650,000,chr1:14200000or justchr2) or a feature name such as a gene symbol, and press Enter. Press / to jump to the box. - Previous and next region (the arrows, or [ and ]) move along the chromosome by the amount of genome in view. Zoomed out, they switch to the previous or next chromosome.
- Previous and next candidate (P and N) step through the table in genomic order.
- Genome frame. The line around the panel shows every chromosome in proportion. Click it anywhere to open that chromosome at that position, as you would click an ideogram.
- Sample views in the Overview tab double as overview maps: the box shows where you are, and clicking the sample that is shown jumps there.
- Bookmarks (B) keep the selected candidate, selection or region in view. Click one to return; save them all as a BED file.
- Large view (F, the corners button) fills the window with the panel and places the linear tracks beside it. Label size in the View tab scales every label in the panel and the linear tracks, for reading on a large screen or for figures. The large view shows the same 512 by 512 grid bigger; zoom in for finer detail.
- Guides. The coordinate grid divides the panel into squares that are each a continuous stretch of the chromosome and labels where each one starts. Curve direction draws arrows through the squares in reading order. Feature labels name the genes or other features large enough to label.
| Key | Action |
|---|---|
| + − 0 | Zoom in, zoom out, whole chromosome |
| Arrow keys | Pan (when the panel has focus) |
| [ ] | Previous and next region, or chromosome when zoomed out |
| P N | Previous and next candidate |
| B | Bookmark |
| / | Go to the locus box |
| M S W | Move, select, magic wand |
| F | Large view on and off |
| Esc | Leave the large view, or clear the selection |
| Ctrl+Z, Ctrl+Shift+Z | Undo, redo (⌘ on a Mac) |
Selecting in the Hilbert panel
Choose a pointer tool above the panel:
- Move (M): drag to pan, click for the values at a pixel.
- Select (S): drag a rectangle. Shift+drag selects with any tool.
- Wand (W): click a coloured patch to select all touching pixels of the same colour, at least a third of the colour limit strong. This picks out an event exactly as you see it.
Hold Ctrl (⌘ on a Mac) to add to the current selection. Dragging in a linear track also selects. Because a rectangle on a space-filling curve covers several stretches of the chromosome, a selection is a list of stretches; the Details tab on the right shows how many, their total length, the candidates and features inside, and the mean value of every sample in the selection with its change against the baseline. From there you can zoom to the selection, bookmark it or save the stretches as a BED file. Esc clears the selection. Selections are part of the undo history.
Comparing samples
The Samples tab on the left lists every loaded sample.
- Untick a sample to leave it out of the main panel, the small views and the table.
- Click a name to rename it; the new name is used everywhere, including exported files.
- Compare each sample with sets the baseline: the reference, any other sample, or each sample's own median. Comparing two subclones directly, for example, shows only the changes that differ between them: events they share disappear, and events unique to one remain.
In the Overview tab, below the small views, a matrix shows how similar the samples are. The upper right gives the correlation of their comparison profiles along the chromosome; the lower left counts the candidates they share. Click a cell to compare that pair directly: the row sample is shown and the column sample becomes the baseline.
Space-filling curves
How a chromosome is folded into the square decides which positions end up side by side. Choose the curve under View. The numbers below were measured on the 512 by 512 panel: how often one step along the chromosome moves to a touching pixel, and how far apart on the chromosome touching pixels are (in pixels; multiply by the bases per pixel).
| Curve | Steps to a touching pixel | Touching pixels: median apart | 90% within | Notes |
|---|---|---|---|---|
| Hilbert | 100% | 1 | 45 | The default. Every stretch of the chromosome forms one compact patch. |
| Moore | 100% | 1 | 45 | A Hilbert variant that closes into a loop: the end of the chromosome returns next to its start. |
| Z-order (Morton) | 50% | 2 | 43 | Simple to compute and widely used in databases, but it jumps, so one event can be split into separate patches. |
| Gray code | 75% | 3 | 60 | Fewer jumps than Z-order, patches less compact than Hilbert. |
| Serpentine | 100% | 1 | 819 | Reads row by row like a page. Events become thin stripes, much as in a linear track; zoom is limited to 4×. |
Switching curves keeps your position. Comparing the same event under different curves is a quick way to see why Hilbert curves are used: a deletion that is one compact patch under Hilbert may split in two under Z-order and become a thin line under serpentine. The Peano curve, used in some earlier work, divides the square into 3 by 3 blocks and so does not fit the 512-pixel grid; it is not offered.
3D view
Choose 3D in the toolbar (View) to fold the chromosome onto a three-dimensional Hilbert curve (or Z-order curve) of 64 × 64 × 64 voxels. That is 262,144 voxels, exactly one for each pixel of the whole-chromosome 2D view, so the resolution is the same.
- Show values beyond hides voxels whose colour would be weaker than the chosen fraction of the colour limit. Raise it to see only the strongest changes inside the cube.
- Drag to rotate, scroll to zoom, Rotate to spin slowly. Curve draws the coarse 8 × 8 × 8 path from teal (start) to pink (end).
- The region in view in 2D, or your selection, is shown in pink. Hover a voxel to see its position and value in the linear tracks; click it to open that position in 2D.
Three dimensions keep more positions close together than two, but hide the interior, so the 3D view is best for seeing how many separate events a sample has and how they cluster. Use 2D for reading positions.
Microbiome maps
Open a taxonomic abundance table (species in rows with their lineage, as MetaPhlAn writes it: k__Bacteria|p__Firmicutes|…|s__Species, samples in columns) and, optionally, a sample metadata table (a file whose name contains metadata: samples in rows or in columns, with fields such as diagnosis, site or time point). MeanderViz then draws microbiome maps in the sense of Valdes et al. (2023): each pixel is one taxon, coloured by its abundance in the sample shown, on a nine-step log scale.
- Taxonomy order (the default when lineages are present) places related taxa next to each other along the curve, so that phyla, classes, orders, families and genera form nested neighbourhoods. Each rank is a feature track: switch outlines and labels on or off under Features in the View tab.
- Condition order (Genomes tab › Order genes by) assigns each taxon to the condition where its mean abundance is highest, in the field chosen under Colour marks by, and orders the taxa by condition, then taxonomy. A sample from one condition then lights up mostly one neighbourhood. The "Condition" track outlines them.
- The Overview tab shows every sample as its own small map, with the metadata colour marks; Play steps through the samples in the current order (by time point, for a longitudinal study), and Save all maps writes one PNG per sample into a zip, ready for a movie.
- Click a pixel for the taxon's lineage, its abundance in the sample and across samples, and links to NCBI Taxonomy and genomes.
- The 3D stack shows all samples at once: a taxon abundant in a group of samples is a vertical pillar.
The HMP2 example holds 124 real gut microbiome samples of an inflammatory bowel disease study.
Colours, resolution and layout
- Colours (Colours tab): the comparison scale (blue and orange by default; red and blue; green and purple; blue and yellow; green and red, which many colour-blind readers cannot tell apart), the value scale (single colour, viridis, magma, inferno, plasma), colours for variant types, features and bases (including the colour-blind safe Okabe–Ito set), and a white or black panel background. The choice applies to the main panel, the sample views, the linear tracks, the 3D view, the legend and the table.
- Panel resolution: 512, 1024 or 2048 pixels per side. Higher resolutions show four or sixteen times more detail in the same square and take longer to draw; while you drag, the panel is drawn at 512 and refined when you let go. The finest level still reaches about one base per pixel.
- 3D resolution: 64³ voxels (the same number as the 512 panel) or 128³, eight times as many. Region in view fills the cube with just the region shown in 2D or your selection; when the data in memory are too coarse, MeanderViz reads that region from the file at full resolution. In value colouring the 3D view shows the voxels that depart most from the median; in comparison colouring, the largest changes.
- Tabs and collapsing: the left and right columns are organised in tabs, and every section in a tab can be folded with its chevron. The two toolbar buttons at the ends hide the left or right column; with both hidden, the main panel grows and the linear tracks move beside it. In 3D, Hide controls clears the control bar from the view.
Mouse and keyboard
| Scroll, + and − | Zoom in and out around the pointer. Each step doubles the magnification, down to about 1 bp per pixel. |
| Drag | Pan when zoomed in. Arrow keys work too when the panel has focus. |
| Click | Show values and a genome browser link for that pixel. |
| Linear tracks | Directly under the main panel. The upper track shows the whole chromosome with a box around the region in view; the lower track shows that region in detail. Hover to see the same position circled in the Hilbert panel, click to centre the panel there, drag to select and zoom to a region. The teal strip above each axis marks the positions the main panel shows. |
| Undo, redo | Arrow buttons above the panel, or Ctrl+Z and Ctrl+Shift+Z (Ctrl+Y also redoes). Every zoom, pan, selection, chromosome change and display setting is a step; a drag or a slider move counts as one. |
| Overview tab | Small whole-chromosome views of every sample. Choose one to show it in the main panel. |
Input files
MeanderViz accepts files straight from common pipelines. No conversion or pre-processing step is needed. Every text format may be plain or compressed with gzip or bgzip.
| File | Used for | Notes |
|---|---|---|
BAM (.bam) with optional BAI (.bam.bai) | Read depth and discordant read pairs | Coordinate-sorted BAM. With an index, MeanderViz reads only the chromosome you view. Without one it reads the file from the start. Duplicates, secondary, supplementary and QC-failed reads are skipped. |
bedGraph (.bedgraph, .bg) | Read depth | Output of bedtools genomecov -bg, mosdepth or deeptools bamCoverage. Zero-based, half-open intervals. |
samtools depth (.depth, .txt) | Read depth | Three columns: chromosome, 1-based position, depth. |
FASTA (.fa, .fasta, .fna) | DNA sequence, or an alignment | One or more sequences. When all sequences have the same length, the file is read as an alignment. |
Alignment (.aln, .clustal, .sto, .afa) | Multiple sequence alignment | Clustal, Stockholm or aligned FASTA; gaps as - or .. In aligned FASTA, words such as date=2020-03-01 country=Italy region=Europe after the name are read as metadata. |
PAF (.paf) | Alignment of this assembly to another assembly or a reference | From minimap2 (-x asm5, asm10 or asm20), wfmash or similar. With the CIGAR tag (minimap2 -c), alignments are split at gaps of 1 kb or more, so a misjoin shows as a break. |
Gene presence/absence (.Rtab, gene_presence_absence.csv) | Pangenome | Roary, Panaroo, PIRATE and similar. Any table with features in rows and samples in columns also works: 0/1 for presence, or numbers such as read counts or relative abundance for metagenomes. |
Newick (.nwk, .newick, .tree) | Order of genomes or sequences | Adds Tree order to the sequence order. |
WIG (.wig) | Any signal | fixedStep or variableStep, as used for conservation (phyloP, phastCons) and GC content tracks. |
BED (.bed), GTF or GFF3 | Features to overlay | Genes, peaks, CpG islands, enhancers. The name column is shown on hover, in the table and can be typed into Go to. From GTF and GFF3, gene records are used. |
BEDPE (.bedpe) | Discordant read pairs | One pair per line. Column 7 may give the type (DEL, DUP, INV, TRA or BND). Otherwise the type is taken from the strands in columns 9 and 10. |
VCF (.vcf) | SV calls from another tool | Shown as grey bars in the linear views and matched to candidates. VCF uses SVTYPE, END, CHR2 or breakend ALT notation. A BED file whose names are SV types (DEL, DUP, INV) is read as calls too. |
Examples
# bedGraph: chrom start end depth
chr1 14200000 14200500 61.4
chr1 14200500 14201000 58.9
# samtools depth: chrom position depth
chr1 14200001 61
chr1 14200002 61
# BEDPE: chrom1 start1 end1 chrom2 start2 end2 name score strand1 strand2
chr1 14199700 14199800 chr1 14500200 14500300 DUP 60 - +
chr1 18299700 18299800 chr3 2100200 2100300 TRA 60 + -
# WIG
fixedStep chrom=chr1 start=1000001 step=100 span=100
0.62
0.71
# BED features: chrom start end name score strand
chr1 5999100 6012400 Gn0051 0 +
# VCF (columns 1 to 8)
chr1 14200001 call2 N <DUP> 55 PASS SVTYPE=DUP;END=14500000
A reference is optional. With a reference, samples are compared with it. Without one, each sample is compared with its own median depth, which works for copy-number changes against a mostly diploid background.
Public databases and web addresses
The Import data tab adds public annotations to the data you are exploring, fetches files from web addresses, and holds the examples.
- Public databases. Genes (NCBI RefSeq through the UCSC Genome Browser, or Ensembl for any species it covers), CpG islands, ENCODE candidate regulatory elements, known structural variants from the Database of Genomic Variants, or any other UCSC track by name. Choose the assembly that matches your data and import for the current chromosome, the region in view or all chromosomes. Imported tracks behave like BED files: outlines, labels, the Features column and search by name. Known structural variants in the Features column show at a glance whether a candidate is a common population variant.
- Web addresses. Any supported file on a server that allows cross-site downloads.
Only the assembly name and coordinates are sent to the databases, never your data. The online preview on claude.ai cannot reach other sites, so imports work in the hosted MeanderViz site and in the self-hosted package.
Checks and messages
Every file is checked as soon as it is added: that it is not empty, that a file named .gz is really compressed, that a BAM is a BAM (not a SAM), that an index is an index, and that the first lines look like the format the name suggests. A file that fails is marked in the Data tab and skipped; the others still load. Warnings appear in the Data tab and briefly at the bottom right of the window, for example:
- a BAM without an index, or not sorted by coordinate (slower reading);
- chromosome names that differ between files, such as
chr1in one and1in another, with the fix; - chromosomes present in some samples only, or a sample with no data on the chromosome shown;
- no reference sample (samples are compared with their own median), no matching contigs in a PAF, alignments with many missing residues, a PAF without CIGAR tags.
While files are read, a progress bar runs under each file in the Data tab and in the panel. Reading can be cancelled from the panel.
Sessions
Save session in the Data tab writes a small JSON file with the list of files, every setting, the view, the selection, the bookmarks, the sample names and any features imported from public databases. The data files themselves are not included, so nothing private leaves your computer. Load session reads it back: for an example, the session opens at once; for your own files, MeanderViz lists the files it needs, applies the session once you have added them and pressed Analyse. Scripts can do the same with MeanderViz.session() and MeanderViz.loadSession().
Saving images
The download button in the toolbar opens the export dialog. Choose the format, the area (the main panel with its overlays; a figure with the title line, the panel, the linear tracks and the legend; the 3D view; the alignment viewer; the dot plot), the resolution (1× at 96 dpi for screens up to 6× at 576 dpi, or a custom width up to 16,000 pixels), the background, and whether to leave out the selection and highlighting:
- PNG: lossless; keeps the pixel grid crisp at any width; can have a transparent background.
- SVG: the data as a crisp image and everything else, lines, markers, labels and the genome frame, as vectors, so it can be edited in Inkscape or Illustrator. Available for the panel and the figure.
- JPEG, WebP and PDF: flattened images, handy for slides, the web and manuscripts; the PDF is one page at the image size.
Two zoom sliders help: the Zoom slider in the toolbar zooms the curve view, and the Linear zoom slider above the lower track zooms the linear view on its own, so the panel can show the whole chromosome while the track shows a few kilobases. The width can be up to 16,000 pixels. The panel is drawn from its current data resolution (512, 1024 or 2048 pixels, set in the View tab), so for the finest data raise that first. Scripts can save the same images with MeanderViz.export("svg", { content: "figure", width: 3000 }).
Scripts, links and the command line
MeanderViz can be driven without the mouse. The full reference, with a console to try commands, is on the API page; in short:
- Links. Add parameters to the address to open a view directly:
?example=asm&locus=ctg2:20000-24000&mode=syn, or?url=https://…/a.bedgraph,https://…/a.bedpe&kind=svfor files on a server that allows cross-site downloads. In the browser console,MeanderViz.link()gives the link for the current view. - Scripts.
window.MeanderVizoffersload,example,goto,select,view,settings,findings,csv,export,stateand events (load,view,selection,finding). - Embedding. In an
<iframe>, the same commands can be sent withpostMessage; MeanderViz replies and reports events to the embedding page. - Command line.
node bin/meanderviz-cli.jsruns the engine without a browser:findingsfor structural variants,sitesfor alignments,assemblyfor assembly checks andhilbertfor curve coordinates, all printing CSV. The engine itself,src/core.js, can be required from Node.js.
Interpreting results
MeanderViz is a visual exploration tool. The candidate list is a guide to where to look, not a validated call set. Things worth keeping in mind:
- Depth alone is noisy. GC content, mappability and repeat regions change coverage without any real variant. Depth-only candidates next to gaps or centromeres deserve extra caution. Differences between two samples sequenced the same way are more robust than a single sample compared with its median.
- Pairs alone can mislead. Mis-mapped reads in segmental duplications produce clusters. Raise the minimum pairs per cluster or the mapping quality if many small clusters appear.
- Check the example. In the example data, subclone 2 has a tandem duplication at chr1:14.20–14.50 Mb with a flanking deletion. Both appear with pairs and depth and are marked unique. The 40 kb deletion in subclone 4 on chr2 is nearly invisible in the linear view but forms a clear patch in the Hilbert view.
- Confirm important findings by inspecting reads in a genome browser, with an orthogonal method, or with a dedicated SV caller.
Privacy and limits
Everything runs in your browser. Files are read from your disk and are never sent to a server, so MeanderViz can be used with sensitive human data. The site sets no cookies and uses no tracking. Closing the tab discards all data.
MeanderViz keeps one chromosome in memory at a time, about 17 MB per sample. Reading a whole-genome BAM without an index can take several minutes, so provide the .bai file where possible. Tested in current versions of Chrome, Firefox, Safari and Edge on Windows, macOS and Linux.
Questions
Can I use bigWig files?
Not yet. Convert them with bigWigToBedGraph from the UCSC tools, or use bedGraph or WIG directly.
Do I need a reference sample?
No. Without one, each sample is compared with its own median depth. A matched normal or parental sample gives cleaner ratios.
Why is my chromosome mostly white?
Probably low coverage or the wrong chromosome names. MeanderViz treats chr1 and 1 as different chromosomes, so files from different pipelines must use the same naming.
About MeanderViz
MeanderViz is a free web application for exploring genomes, assemblies, alignments and microbiome profiles on space-filling Hilbert curves, so that small features remain visible at whole-genome scale. It runs at meanderviz.org and entirely in your browser: files are never uploaded, and there is no login, no cookie and no tracking.
What it does
- Structural variants from read depth and read pairs, in up to four samples against a reference, with a candidate table, double evidence and sharing between samples.
- Genomic signals and DNA: any track along a genome, and genome sequences with their bases, GC content, GC skew and CpG.
- Genome assemblies: checks from reads (collapsed repeats, gaps, misjoins, contig links) and comparison with another assembly (synteny, dot plot, breakpoints).
- Alignments, pangenomes and microbiome maps: variable sites, every sequence side by side, gene presence and absence, taxa ordered by taxonomy into neighbourhoods, and 3D stacks of sequences.
- Five space-filling curves in 2D, Hilbert and Z-order curves in 3D, high-resolution export, a scripting API, a REST API and a command line.
How to cite
If you use MeanderViz, please cite the original publication of the method:
Pavlopoulos GA, Kumar P, Sifrim A, Sakai R, Lin ML, Voet T, Moreau Y, Aerts J. Meander: visually exploring the structural variome using space-filling curves. Nucleic Acids Res. 2013;41(11):e118. doi:10.1093/nar/gkt254, PMID 23605045.
Related work: the Hilbert curve layout of genomic data was introduced by Anders S. Visualization of genomic data with the Hilbert curve. Bioinformatics 2009;25:1231–1235 (doi:10.1093/bioinformatics/btp152). Microbiome maps follow Valdes C, Stebliankin V, Ruiz-Perez D, Park JI, Lee H, Narasimhan G. Microbiome maps: Hilbert curve visualizations of metagenomic profiles. Front Bioinform. 2023;3:1154588 (doi:10.3389/fbinf.2023.1154588). The 3D Hilbert curve follows Skilling J. Programming the Hilbert curve. AIP Conf. Proc. 2004;707:381–387.
Licence
MeanderViz is open source software under the MIT licence and is free for everyone, including commercial use. The help pages and example data are available under Creative Commons Attribution 4.0 (CC BY 4.0).
Source code and contact
Source code, issue tracker and release notes: github.com/PavlopoulosLab/MeanderViz.
Questions and bug reports: [email protected].
Example data
The Arabidopsis thaliana chloroplast genome is NCBI RefSeq NC_000932.1. The SARS-CoV-2 variants are representative genomes of the Nextclade reference tree (Aksamentov I et al. J Open Source Softw 2021;6:3773; github.com/nextstrain/nextclade_data), reconstructed from the Wuhan-Hu-1 reference and their mutations. The early 2020 SARS-CoV-2 genomes are the example dataset of the Nextstrain ncov workflow (public GenBank records), aligned to the Wuhan-Hu-1 reference (NC_045512.2) with minimap2 (Li H. Bioinformatics 2018;34:3094–3100). The tumour copy-number profiles are test data of CNVkit (Talevich E et al. PLoS Comput Biol 2016;12:e1004873). The microbiome profiles are HMP2 / iHMP IBD samples (Lloyd-Price J et al. Nature 2019;569:655) from the bioBakery workflows tutorial. The draft assembly example is simulated from the chloroplast genome, with reads mapped by minimap2. The human and orangutan mitochondrial genomes are from the minimap2 test data. The pangenome example is the simulated example data of the panstripe package (Tonkin-Hill G et al.). The remaining examples are synthetic.
Privacy
MeanderViz runs entirely in your browser. No data are uploaded, no account is needed, and the site sets no cookies and loads no tracking or analytics scripts. The optional REST API at meanderviz.org/api/v1 deletes uploaded files and results automatically.
Acknowledgements
Built with three.js for the 3D view, pako for decompression and JSZip for archives. Typeset in Public Sans.