Pangenome (mouse)
The tutorials target the JBrowse v5 beta, and the v4.3.0 release
on the download page lacks some of what they show. To install the
beta of JBrowse Web, run npm install -g @jbrowse/cli@next, then
jbrowse create jbrowse2 --branch v5.0.0-beta.21. Desktop beta builds for Linux and
macOS are on the releases page;
the Windows build waits on code signing.
The mouse strain pangenome aligns eighteen assemblies of seventeen inbred and
wild-derived strains onto the GRCm39 reference with minigraph. GRCm39 is
itself a strain, C57BL/6J, so the panel's best-known variant, a C57BL/6J
deletion, appears as an insertion. No locus list has been published for these
strains, so we rank the graph's bubbles, the regions where the strains' paths
split and rejoin, by how many segments each holds, and open the densest. We:
- at Nnt, open the graph track with bubble halos, then the liftOver lanes that name the strains
- rank the bubbles file by segment count and open the densest that fits a window, at Dock2
- load the graph and its bubbles as tracks on mm39 in your own JBrowse
- build a minigraph graph from strain assemblies of your own
The first two start from the mouse graph page on genomes.jbrowse.org, which launches the JBrowse 5 development build until JBrowse 5 ships.
The graph view is a beta plugin. We welcome your feedback.
Prerequisites
- the GraphGenomeView plugin, for the
GraphTrackbelow. In your own JBrowse, install it from the plugin store; the portal page already loads it minigraph, to build a graph like this one
# conda
conda install -c bioconda -c conda-forge minigraphThe data
The reference is UCSC's mm39 and the strains are the Mouse Genomes Project assemblies plus T2T builds of C57BL/6J and CAST/EiJ, as UCSC GenArk rehosts them.
Nothing to download: the track configs below read the index files by URL, and the ranking step streams the bubbles file. Building a minigraph graph builds the files for strains of your own.
The files
| What it is | File |
|---|---|
| Mm39 (GRCm39) | mm39.fa.gz |
| The eighteen assemblies, one GenArk folder per GenBank accession | GCA/ |
| Segments and links, the graph's nodes and edges at their reference coordinates | mouse-mm39-minigraph.graph.bed.gz |
| Bubbles, where the strains' paths split and rejoin | mouse-mm39-minigraph.bubbles.bed.gz |
| The whole-chromosome overview, with variants under 10 kb folded into the reference | mouse-mm39-minigraph.fold10000.graph.bed.gz |
Nnt: a C57BL/6J deletion that appears as an insertion
C57BL/6J has a multi-exon deletion at Nnt (nicotinamide nucleotide transhydrogenase) that abolishes the protein and makes C57BL/6J mice glucose intolerant (Toye et al. 2005). GRCm39 is C57BL/6J, so the backbone of this graph, the reference path, is the strain with the deletion, and the other strains' intact gene is an insertion. To see it:
- Open chr13 on the portal page and press Open in JBrowse, which opens the whole chromosome with the graph's variants under 10 kb folded into the reference.
- Type
chr13:119,440,000-119,600,000to draw the segments there. - In the graph track's menu, tick Show → Show bubble halos.
- Turn on the bubbles track in the track selector.
The portal's Nnt example names the deletion above its map, calls the other strains' insertion "intact Nnt", and opens a Known alleles row over the site in each launch.
The graph holds no path per strain, so which strains have the exons comes from mm39's liftOver chains, one lane per strain assembly. We'll open them at the same gene:
- Open mm39 on staging.genomes.jbrowse.org and turn on mm39 vs 76 genomes (liftOver, multi-way) under Pairwise alignments.
- Type
Nntinto the location box. - In the track menu, pick Lanes → Choose lanes..., type
house mouseinto the filter and tick the strains, the C57BL/6J T2T assembly among them.
Ranking the graph's bubbles to find Dock2
The bubbles file's fourth column records how many segments each bubble holds.
Ranked by that count, the bubbles that overlap a gene include the vomeronasal
receptor and Speer families and the immunoglobulin heavy chain locus, each too
wide for one window. Dock2 is the densest bubble that fits in one, inside one
intron at chr11:34,516,045-34,560,497. Rank the bubbles that fit in a 100 kb
window, streaming the hosted file, or swap in the .bubbles.bed.gz your own
build wrote:
# column 4: the bubble's segment count; the densest come first
curl -s https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.bubbles.bed.gz \
| gzip -dc \
| awk -v OFS='\t' '$3 - $2 < 100000 { print $1, $2, $3, $4 }' \
| sort -t "$(printf '\t')" -k4,4nr | head -20To open the Dock2 bubble:
- Paste that region into the portal page's Gene or region box and click Graph.
- In the graph track's menu, tick Show → Show bubble halos.
Loading the graph in your own JBrowse
The portal's launches load these tracks for you. In your own JBrowse, we'll load
the reference, then the graph and its bubbles. The graph track names the file
prefix gfa-to-tabix build writes, and the uris below are our hosted copy, so
swap the prefix for your own build.
Goes in the assemblies array of config.json. See Assemblies.
{
"name": "mm39",
"aliases": ["GRCm39"],
"uri": "https://hgdownload.soe.ucsc.edu/goldenPath/mm39/bigZips/mm39.2bit",
"refNameAliases": {
"uri": "https://jbrowse.org/ucsc/mm39/mm39.chromAlias.txt"
}
}Edits config.json in the current folder, creating it if there is none. See JBrowse CLI with Desktop.
jbrowse add-assembly https://hgdownload.soe.ucsc.edu/goldenPath/mm39/bigZips/mm39.2bit \
--name mm39 \
--alias GRCm39 \
--refNameAliases https://jbrowse.org/ucsc/mm39/mm39.chromAlias.txtGoes in the tracks array of config.json. See Tracks.
{
"type": "GraphTrack",
"trackId": "mouse_minigraph_segments",
"name": "Mouse strain pangenome (rGFA segments)",
"assemblyNames": ["mm39"],
"adapter": {
"type": "RgfaTabixAdapter",
"uri": "https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph",
"format": 2,
"coarse": {
"uri": "https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.fold10000",
"format": 2,
"aboveBpPerPx": 1000
}
},
"displays": [
{ "type": "LinearGraphDisplay" },
{ "type": "LinearBasicDisplay" }
]
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "GraphTrack",
"trackId": "mouse_minigraph_segments",
"name": "Mouse strain pangenome (rGFA segments)",
"assemblyNames": ["mm39"],
"adapter": {
"type": "RgfaTabixAdapter",
"uri": "https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph",
"format": 2,
"coarse": {
"uri": "https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.fold10000",
"format": 2,
"aboveBpPerPx": 1000
}
},
"displays": [
{ "type": "LinearGraphDisplay" },
{ "type": "LinearBasicDisplay" }
]
}'In JBrowse Desktop, or in any running JBrowse Web session, open a view on this track’s assembly, then File → Open track..., choose Add track from pasted JSON, and paste:
{
"type": "GraphTrack",
"trackId": "mouse_minigraph_segments",
"name": "Mouse strain pangenome (rGFA segments)",
"assemblyNames": ["mm39"],
"adapter": {
"type": "RgfaTabixAdapter",
"uri": "https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph",
"format": 2,
"coarse": {
"uri": "https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.fold10000",
"format": 2,
"aboveBpPerPx": 1000
}
},
"displays": [
{ "type": "LinearGraphDisplay" },
{ "type": "LinearBasicDisplay" }
]
}The bubbles track reads the same build's bubble index:
Goes in the tracks array of config.json. See Tracks.
{
"type": "FeatureTrack",
"trackId": "mouse_minigraph_bubbles",
"name": "Mouse strain pangenome bubbles",
"assemblyNames": ["mm39"],
"adapter": {
"type": "MinigraphBubbleAdapter",
"uri": "https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.bubbles.bed.gz",
"csi": true
}
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "FeatureTrack",
"trackId": "mouse_minigraph_bubbles",
"name": "Mouse strain pangenome bubbles",
"assemblyNames": ["mm39"],
"adapter": {
"type": "MinigraphBubbleAdapter",
"uri": "https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.bubbles.bed.gz",
"csi": true
}
}'In JBrowse Desktop, or in any running JBrowse Web session, open a view on this track’s assembly, then File → Open track..., choose Add pangenome graph track, and fill in:
- File type:
Minigraph bubbles (tabix BED) - Path:
https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.bubbles.bed.gz - Track name:
Mouse strain pangenome bubbles - Assembly:
mm39
Building a minigraph graph from the strain assemblies
To build a graph like this one, run minigraph once per chromosome over the
sequence for that chromosome from each assembly, reference first so that its
segments take rank 0, the earliest build order:
# -xggs: incremental graph construction, adding each genome in turn
# -c: base-level alignment, which minigraph recommends for graph generation
minigraph -cxggs -t 8 mm39.chr13.fa strain1.chr13.fa strain2.chr13.fa > chr13.gfaPangenome (hosting your own graph) then turns the graph into the files
above with one command, gfa-to-tabix build.
build_mouse_pangenome.sh
runs the whole build on Linux, since it needs GNU tools. It downloads about 30
GB, writes about 50 GB of per-chromosome FASTA, holds 30 GB of memory free for
each minigraph job, and takes about 27 hours of minigraph time at two
chromosomes at once on 8 threads each. It:
- downloads the assemblies
- extracts each chromosome, renamed to PanSN (
sample#haplotype#contig) - runs
minigraphper chromosome - joins the chromosomes with segment ids renumbered
The script runs two audits on the joined graph and stops if:
- a segment has an
SNtag that is neithermm39#0#chr*nor<strain>#1#chr* - renumbering leaves a duplicate segment id
A segment with a bad SN tag or a duplicate id produces a graph with wrong
coordinates that every later check accepts, so copy these audits into your own
build.
See also
- Tutorial: Pangenome (cattle)
- Tutorial: Pangenome (hosting your own graph)
Citations
- Li et al. (2020). The design and construction of reference pangenome graphs with minigraph
Feedback on this tutorial is welcome: contact us.