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.13. Desktop beta builds are coming soon.
The mouse strain pangenome aligns eighteen inbred and wild-derived strain
assemblies from the Mouse Genomes Project onto the GRCm39 reference with
minigraph. GRCm39 is itself a strain, C57BL/6J, which inverts the sign of the
best-known variant in the panel. 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, read a C57BL/6J deletion as sequence the other strains have
- rank the bubbles in the graph and open the densest one that fits in a window, at Dock2
- look the Dock2 bubble up in the hosted index
Every step starts 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.
The mouse graph records no strain's path, so it lists the alleles that exist and leaves out which strains have them.
Prerequisites
- the GraphGenomeView plugin, for the
GraphTrackbelow. In your own JBrowse, install it from the plugin store; the portal page already loads it - htslib (
tabix), to query the hosted index minigraph, to build a graph like this one
Where the data comes from
The reference is UCSC's mm39 and the strains are the Mouse Genomes Project assemblies as UCSC GenArk rehosts them.
Nothing to download: the track configs below read the index files by URL.
The files
- mm39 (GRCm39): https://hgdownload.soe.ucsc.edu/goldenPath/mm39/bigZips/mm39.fa.gz
- the eighteen strains, one GenArk folder per GenBank accession: https://hgdownload.soe.ucsc.edu/hubs/GCA/
- segments, the graph's nodes at their reference coordinates: https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.segs.bed.gz
- links, the edges between segments: https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.links.bed.gz
- bubbles, where the strains' paths split and rejoin: https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.bubbles.bed.gz
- the allele inventory, one row per alternative sequence at a bubble: https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.alleles.bed.gz
- the whole-chromosome overview, with variants under 10 kb folded into the reference: https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.fold10000.segs.bed.gz and https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.fold10000.links.bed.gz
Hosting your own graph describes what each file holds.
Load the graph
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"
}
}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",
"coarse": {
"uri": "https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.fold10000",
"aboveBpPerPx": 1000
}
},
"displays": [
{ "type": "LinearGraphDisplay" },
{ "type": "LinearBasicDisplay" }
]
}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",
"coarse": {
"uri": "https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.fold10000",
"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",
"coarse": {
"uri": "https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.fold10000",
"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"
}
}jbrowse add-track https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.bubbles.bed.gz \
--trackId mouse_minigraph_bubbles \
--name "Mouse strain pangenome bubbles" \
--assemblyNames mm39 \
--adapterType MinigraphBubbleAdapterIn 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
Nnt: a C57BL/6J deletion that appears as an insertion
Click chr13 on the Whole chromosomes line of the
portal page, which opens the
whole chromosome with the graph drawn as one node per bubble. Type
chr13:119,440,000-119,600,000 to draw the segments there. Then:
- in the graph track's menu, tick Show... → Show bubble halos
- turn on the bubbles track in the track selector
C57BL/6J has a multi-exon deletion at Nnt (nicotinamide nucleotide transhydrogenase) that abolishes the protein and makes C57BL/6J mice glucose intolerant. GRCm39 is C57BL/6J, so the backbone of this graph, the reference path, is the strain with the deletion.
Ranking the graph's bubbles to find Dock2
The whole-chromosome overview records how many segments each bubble holds.
Ranking the bubbles that overlap a gene by that count recovers 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. To open it:
- 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.
minigraph writes no path lines, so the graph does not record which strains
have an allele. The allele inventory's firstSeenIn lists the first assembly to
contribute it.
The Dock2 bubble is one row of the hosted bubbles BED, with the same segment count and span the figure labels:
tabix https://jbrowse.org/demos/mouse_pangenome/mouse-mm39-minigraph.bubbles.bed.gz \
'mm39#0#chr11:34516044-34560497'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, and the alignment takes most of a day. 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
Either failure 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 H, Feng X, Chu C. The design and construction of reference pangenome graphs with minigraph. Genome Biology. 2020;21:265. https://doi.org/10.1186/s13059-020-02168-z
- Wick RR, Schultz MB, Zobel J, Holt KE. Bandage: interactive visualization of de novo genome assemblies. Bioinformatics. 2015;31(20):3350-3352. https://doi.org/10.1093/bioinformatics/btv383
Feedback on this tutorial is welcome: contact us.