Pangenome (HPRC) part 1: the graph's alleles and the haplotypes that have them
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.22. Desktop beta builds for Linux and
macOS are on the releases page;
the Windows build waits on code signing.
The Human Pangenome Reference Consortium's release 2 is a pangenome graph of 464 human haplotypes; the phased VCF used here lists 462 of them. Where the haplotypes differ, the graph forms a bubble, and each route through a bubble is an allele. HPRC writes each haplotype's route through every bubble as a phased VCF, so a record lists which haplotypes have which allele. We open the graph and the VCF from the HPRC page on genomes.jbrowse.org as tracks of a linear view of GRCh38, at the CFH gene cluster, the complement genes C4 and beside HLA-DRB5 in MHC class II. We:
- launch tracks from the HPRC page, and at CFH find a published deletion in the launch's tracks
- open a whole chromosome as a graph track with variants under 10 kb folded into the reference, and C4 as a force-directed graph track
- open the assembly an allele beside HLA-DRB5 came from with Open in
- load the phased VCF as a variant track with one row per haplotype, and cluster the rows
- load HPRC's multiple alignment as a MAF track at C4, and highlight three haplotypes' routes through C4 as colored threads on a graph track
The graph view is a beta plugin, and the HPRC page launches it on the JBrowse 5 development build until JBrowse 5 ships. We welcome your feedback.
The graph and the page also leave real variation out, at some of the best-known loci in the genome. Read what they do not show before trusting an empty or simple picture.
Prerequisites
- the GraphGenomeView plugin. In your own JBrowse, install it from the plugin store; every launch from the HPRC page already loads it
- for the alignment on your own data: taffy
The data
Nothing to download: the HPRC page's launches read the files of HPRC release 2, and our tabix index of its graph, by URL. Hosting your own graph builds the same files for a graph of your own.
Read by URL (no download needed)
| What it is | File |
|---|---|
The structural-variant graph (sv.gfa) the index files are cut from |
hprc-v2.1-mc-grch38.sv.gfa.gz |
| The phased VCF, one record per allele, 462 haplotypes | hprc-v2.1-mc-grch38.pgbi.vcf.gz |
| The multiple alignment of every haplotype against GRCh38 | hprc-v2.1-mc-grch38.full.maf.gz |
Launch tracks from the HPRC page
Open the HPRC page, which opens
on its first example, CFH / CFHR. Pick another Examples entry, or type a
gene symbol or a region such as chr6:32,510,001-32,600,000 into the Gene or
region box and press Show. The page draws a map of the window: GRCh38's
genes, a row for GRCh38's own structure, then one row per structural form the
haplotypes fall into, commonest first, each with its share of the haplotypes
aligned there. Forms that differ only by small changes share a row.
Open in JBrowse opens the window in a JBrowse tab: the region drawn as a graph, with the structural variants each haplotype has under it. Under the map the page draws one row's largest change as a graph, cut from the graph's haplotype walks, where that cut is small. Clicking a row draws that row's instead, and the button then opens its haplotype as a lane. The links beside the button open the window other ways:
- Variants: the structural variants each haplotype has, over the genes
- Haplotypes: a lane for each structural form, commonest first, and more lanes for the forms more haplotypes have
- BandageJS: the same haplotypes' walks in BandageJS
Every launch for a window up to 150 kb wide adds two rows under the genes: the
known alleles in it, and the
GWAS Catalog's hits. For a window over 150 kb,
the page offers the graph alone. The page keeps the window in its address, so a
link such as
?region=chr6:32,510,001-32,600,000
opens the same map.
Find a published deletion at CFHR3–CFHR1
Some windows hold an allele described in a publication, as the page's opening example does: pick CFH / CFHR in Examples to return to it. Above the map, the page names the CFHR3–CFHR1 deletion, says what it does, counts the haplotypes with it in the panel and cites Hughes et al. 2006, who tied it to a lower risk of age-related macular degeneration. The map calls the change by the same name.
Press Open in JBrowse. Under NCBI RefSeq genes (hg38):
- Known alleles spans the deletion and names it
- GWAS Catalog (NHGRI-EBI) marks the trait associations in the window. Click a hit for its trait, paper and p-value; the two advanced age-related macular degeneration hits sit one on either side of the deletion
- the matrix under HPRC v2.1 graph (rGFA segments) marks the deletion in the row of each haplotype with it
Open chr1 with small variants folded
Open
chr1 on the HPRC page
and press Open in JBrowse. Zoomed out past the graph adapter's coarse
level, JBrowse draws the coarse tier, the graph with every variant under 10 kb
folded into the reference, so the whole chromosome fits. A curve of segments per
bubble (how many pieces of sequence each bubble holds) shows how much the
haplotypes disagree at each locus.
Hosting your own graph builds this
overview and writes the coarse slot.
Open C4 as a force-directed graph
Click the HLA / MHC example on the HPRC page, then Open in JBrowse. The Graph launch opens genes, the GWAS Catalog's hits, the graph in the force-directed layout, and under it a matrix of the structural variants each haplotype has, one row per haplotype. Then:
- Hide the GWAS Catalog and the variant matrix in the track selector, leaving the genes over the graph.
- Type
C4Ain the location box, pick the chr6 hit, and zoom out twice to take in C4B.
The graph has four kinds of object:
- the backbone is GRCh38's path, colored red to magenta by reference position
- a bubble is a place where haplotypes disagree
- an allele is a haplotype's sequence in place of the reference, drawn in charcoal because it is off the reference path
- an edge that skips sequence is a deletion, drawn as a dashed arc
Open the haplotype the HLA-DRB5 allele came from
Type chr6:32,500,000-32,560,000, a window in MHC class II, a cluster of
immune-system HLA genes. Beside HLA-DRB5, a charcoal node is an allele much
shorter than the backbone stretch it hangs across. Left-click it. Its details
list contributingHaplotype, NA20809#2, from the graph's SN tag, which
holds the assembly minigraph first took the allele from.
Open in appears when the session has an assembly named or aliased
sample#haplotype, the graph's name for it. The launch's config declares every
release 2 haplotype that way. To declare one, load its contig sizes (or FASTA)
under a display name, with the graph's name as an alias:
Goes in the assemblies array of config.json. See Assemblies.
{
"name": "NA20809.2",
"aliases": ["NA20809#2"],
"uri": "https://jbrowse.org/pangenome/hprc-grch38/NA20809.2.chrom.sizes"
}Edits config.json in the current folder, creating it if there is none. See JBrowse CLI with Desktop.
jbrowse add-assembly https://jbrowse.org/pangenome/hprc-grch38/NA20809.2.chrom.sizes \
--name NA20809.2 \
--alias "NA20809#2"Right-click the allele and take Open in NA20809.2. A second linear view opens below the first, on that haplotype's chromosome 6, framed on the allele with its CAT (Comparative Annotation Toolkit) gene annotation, which part 2 describes. Zoom out a few steps.
The haplotype's CAT annotation has HLA-DRB9 and HLA-DRB6 either side of the allele and no HLA-DRB5, the gene it spans on hg38.
List every haplotype with the HLA-DRB5 allele
The graph has one source assembly per allele. HPRC's phased VCF lists every haplotype's allele at every bubble: a record is one allele written against GRCh38, and each sample's genotype holds a 1 for each of its haplotypes with that allele. The variant matrix the launch opened reads the same callset realigned with vcfwave, which splits each allele into the deletions and insertions it makes against GRCh38. The phased VCF has each graph allele whole as one record, so a record matches a node of the graph track. We'll add it to the graph launch's session:
Goes in the tracks array of config.json. See Tracks.
{
"type": "VariantTrack",
"trackId": "hprc2_pgbi_grch38",
"name": "HPRC release 2 phased VCF, one record per allele (462 haplotypes)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "VcfTabixAdapter",
"uri": "https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.pgbi.vcf.gz",
"fetchSizeLimit": 20000000
},
"displays": [
{
"type": "LinearVariantDisplay",
"rows": "haplotype",
"filter": ["jexl:alleleLength(feature)>=50"]
}
]
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "VariantTrack",
"trackId": "hprc2_pgbi_grch38",
"name": "HPRC release 2 phased VCF, one record per allele (462 haplotypes)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "VcfTabixAdapter",
"uri": "https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.pgbi.vcf.gz",
"fetchSizeLimit": 20000000
},
"displays": [
{
"type": "LinearVariantDisplay",
"rows": "haplotype",
"filter": ["jexl:alleleLength(feature)>=50"]
}
]
}'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": "VariantTrack",
"trackId": "hprc2_pgbi_grch38",
"name": "HPRC release 2 phased VCF, one record per allele (462 haplotypes)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "VcfTabixAdapter",
"uri": "https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.pgbi.vcf.gz",
"fetchSizeLimit": 20000000
},
"displays": [
{
"type": "LinearVariantDisplay",
"rows": "haplotype",
"filter": ["jexl:alleleLength(feature)>=50"]
}
]
}Open this track in JBrowse Web ↗
Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=https%3A%2F%2Fjbrowse.org%2Fucsc%2Fhg38%2Fconfig.json&session=spec-%7B%22sessionTracks%22%3A%5B%7B%22type%22%3A%22VariantTrack%22%2C%22trackId%22%3A%22hprc2_pgbi_grch38%22%2C%22name%22%3A%22HPRC+release+2+phased+VCF%2C+one+record+per+allele+%28462+haplotypes%29%22%2C%22assemblyNames%22%3A%5B%22hg38%22%5D%2C%22adapter%22%3A%7B%22type%22%3A%22VcfTabixAdapter%22%2C%22uri%22%3A%22https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fhuman-pangenomics%2Fpangenomes%2Ffreeze%2Frelease2%2Fminigraph-cactus%2Fv2.1%2Fhprc-v2.1-mc-grch38%2Fhprc-v2.1-mc-grch38.pgbi.vcf.gz%22%2C%22fetchSizeLimit%22%3A20000000%7D%2C%22displays%22%3A%5B%7B%22type%22%3A%22LinearVariantDisplay%22%2C%22rows%22%3A%22haplotype%22%2C%22filter%22%3A%5B%22jexl%3AalleleLength%28feature%29%3E%3D50%22%5D%7D%5D%7D%5D%2C%22views%22%3A%5B%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22hg38%22%2C%22loc%22%3A%22chr6%3A32%2C500%2C000-32%2C560%2C000%22%2C%22tracks%22%3A%5B%22hprc2_pgbi_grch38%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+HPRC+release+2+phased+VCF%2C+one+record+per+allele+%28462+haplotypes%29This view in a notebook, with jbrowse-anywidget. Swap a track's uri for your file.
from jbrowse_anywidget import JBrowseApp, fetch_hub
config = fetch_hub("https://jbrowse.org/ucsc/hg38/config.json")
app = JBrowseApp(
assemblies=config["assemblies"],
tracks=config.get("tracks", []) + [
{
"type": "VariantTrack",
"trackId": "hprc2_pgbi_grch38",
"name": "HPRC release 2 phased VCF, one record per allele (462 haplotypes)",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "VcfTabixAdapter",
"uri": "https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.pgbi.vcf.gz",
"fetchSizeLimit": 20000000
},
"displays": [
{
"type": "LinearVariantDisplay",
"rows": "haplotype",
"filter": [
"jexl:alleleLength(feature)>=50"
]
}
]
}
],
views=[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr6:32,500,000-32,560,000",
"tracks": [
"hprc2_pgbi_grch38"
]
}
],
)
app # display the widgetThis view in your React 19 app, with @jbrowse/react-app2 and @jbrowse/core. Add your own files to tracks.
import { use } from 'react'
import { JBrowse } from '@jbrowse/react-app2'
import '@jbrowse/react-app2/styles.css'
import { addRelativeUris } from '@jbrowse/core/util/addRelativeUris'
const configUrl = "https://jbrowse.org/ucsc/hg38/config.json"
const configPromise = fetch(configUrl)
.then(res => res.json())
.then(config => {
addRelativeUris(config, new URL(configUrl))
return config
})
export default function Figure() {
const config = use(configPromise)
return (
<JBrowse
assemblies={config.assemblies}
tracks={[...(config.tracks ?? []), ...[
{
"type": "VariantTrack",
"trackId": "hprc2_pgbi_grch38",
"name": "HPRC release 2 phased VCF, one record per allele (462 haplotypes)",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "VcfTabixAdapter",
"uri": "https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.pgbi.vcf.gz",
"fetchSizeLimit": 20000000
},
"displays": [
{
"type": "LinearVariantDisplay",
"rows": "haplotype",
"filter": [
"jexl:alleleLength(feature)>=50"
]
}
]
}
]]}
aggregateTextSearchAdapters={config.aggregateTextSearchAdapters}
configuration={config.configuration}
views={[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr6:32,500,000-32,560,000",
"tracks": [
"hprc2_pgbi_grch38"
]
}
]}
/>
)
}jbrowse-img draws this view as an SVG, no browser needed. Swap --config or a track for your own.
cat > tracks.json <<'JSON'
[
{
"type": "VariantTrack",
"trackId": "hprc2_pgbi_grch38",
"name": "HPRC release 2 phased VCF, one record per allele (462 haplotypes)",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "VcfTabixAdapter",
"uri": "https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.pgbi.vcf.gz",
"fetchSizeLimit": 20000000
},
"displays": [
{
"type": "LinearVariantDisplay",
"rows": "haplotype",
"filter": [
"jexl:alleleLength(feature)>=50"
]
}
]
}
]
JSON
npx @jbrowse/img --config https://jbrowse.org/ucsc/hg38/config.json \
--trackConfigs tracks.json \
--assembly hg38 --loc chr6:32,500,000-32,560,000 \
--track hprc2_pgbi_grch38 \
--out figure.svgFor a PNG, --out figure.png (needs rsvg-convert: apt install librsvg2-bin, brew install librsvg).
rows: "haplotype"draws one row per haplotype, named<sample> HP1,<sample> HP2.filterdrops records, andalleleLength(feature)>=50keeps alleles of 50 bp and up, the size of the bubbles minigraph calls.alleleLengthis the length of the record's longest allele, so it counts an insertion's inserted bases.fetchSizeLimitraises the download cap past its default. The VCF contains the bases of each inserted allele, which puts the MHC class II window over the default.- Filter by → Edit filters... in the track menu shows the filter and changes it.
- Advanced → Edit plot... in the track menu shows
rowsandfilteras text and applies edits live.
Take Clustering → Cluster rows by genotype... in the track menu and press Run clustering. The rows reorder so haplotypes with the same alleles sit together, with a dendrogram beside them.
Right-click the charcoal allele beside HLA-DRB5 in the force-directed graph and take Highlight in hg38: a band marks the span of GRCh38 it replaces, which covers most of HLA-DRB5.
The VCF holds the HLA-DRB5 allele as several records, one for each of its sequences, which differ by a base or two. The blue block under the band is the haplotypes with any of its four sequences, plus a smaller block with an 86 kb deletion that removes the whole stretch.
Read C4's alleles as aligned bases
HPRC also publishes its alignment as hprc-v2.1-mc-grch38.full.maf.gz, a
multiple alignment with one row of bases per haplotype. A .tai index beside
the large file makes a locus one ranged read:
Goes in the tracks array of config.json. See Tracks.
{
"type": "MafTrack",
"trackId": "hprc_v2_1_mc_grch38",
"name": "HPRC release 2 pangenome alignment (464 haplotypes)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BgzipMafAdapter",
"uri": "https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.full.maf.gz"
}
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "MafTrack",
"trackId": "hprc_v2_1_mc_grch38",
"name": "HPRC release 2 pangenome alignment (464 haplotypes)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BgzipMafAdapter",
"uri": "https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.full.maf.gz"
}
}'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": "MafTrack",
"trackId": "hprc_v2_1_mc_grch38",
"name": "HPRC release 2 pangenome alignment (464 haplotypes)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BgzipMafAdapter",
"uri": "https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.full.maf.gz"
}
}Open this track in JBrowse Web ↗
Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=https%3A%2F%2Fjbrowse.org%2Fucsc%2Fhg38%2Fconfig.json&session=spec-%7B%22sessionTracks%22%3A%5B%7B%22type%22%3A%22MafTrack%22%2C%22trackId%22%3A%22hprc_v2_1_mc_grch38%22%2C%22name%22%3A%22HPRC+release+2+pangenome+alignment+%28464+haplotypes%29%22%2C%22assemblyNames%22%3A%5B%22hg38%22%5D%2C%22adapter%22%3A%7B%22type%22%3A%22BgzipMafAdapter%22%2C%22uri%22%3A%22https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fhuman-pangenomics%2Fpangenomes%2Ffreeze%2Frelease2%2Fminigraph-cactus%2Fv2.1%2Fhprc-v2.1-mc-grch38%2Fhprc-v2.1-mc-grch38.full.maf.gz%22%7D%7D%5D%2C%22views%22%3A%5B%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22hg38%22%2C%22loc%22%3A%22chr6%3A31%2C980%2C000-32%2C050%2C000%22%2C%22tracks%22%3A%5B%22hprc_v2_1_mc_grch38%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+HPRC+release+2+pangenome+alignment+%28464+haplotypes%29This view in a notebook, with jbrowse-anywidget. Swap a track's uri for your file.
from jbrowse_anywidget import JBrowseApp, fetch_hub
config = fetch_hub("https://jbrowse.org/ucsc/hg38/config.json")
app = JBrowseApp(
assemblies=config["assemblies"],
tracks=config.get("tracks", []) + [
{
"type": "MafTrack",
"trackId": "hprc_v2_1_mc_grch38",
"name": "HPRC release 2 pangenome alignment (464 haplotypes)",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "BgzipMafAdapter",
"uri": "https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.full.maf.gz"
}
}
],
views=[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr6:31,980,000-32,050,000",
"tracks": [
"hprc_v2_1_mc_grch38"
]
}
],
)
app # display the widgetThis view in your React 19 app, with @jbrowse/react-app2 and @jbrowse/core. Add your own files to tracks.
import { use } from 'react'
import { JBrowse } from '@jbrowse/react-app2'
import '@jbrowse/react-app2/styles.css'
import { addRelativeUris } from '@jbrowse/core/util/addRelativeUris'
const configUrl = "https://jbrowse.org/ucsc/hg38/config.json"
const configPromise = fetch(configUrl)
.then(res => res.json())
.then(config => {
addRelativeUris(config, new URL(configUrl))
return config
})
export default function Figure() {
const config = use(configPromise)
return (
<JBrowse
assemblies={config.assemblies}
tracks={[...(config.tracks ?? []), ...[
{
"type": "MafTrack",
"trackId": "hprc_v2_1_mc_grch38",
"name": "HPRC release 2 pangenome alignment (464 haplotypes)",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "BgzipMafAdapter",
"uri": "https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.full.maf.gz"
}
}
]]}
aggregateTextSearchAdapters={config.aggregateTextSearchAdapters}
configuration={config.configuration}
views={[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr6:31,980,000-32,050,000",
"tracks": [
"hprc_v2_1_mc_grch38"
]
}
]}
/>
)
}jbrowse-img draws this view as an SVG, no browser needed. Swap --config or a track for your own.
cat > tracks.json <<'JSON'
[
{
"type": "MafTrack",
"trackId": "hprc_v2_1_mc_grch38",
"name": "HPRC release 2 pangenome alignment (464 haplotypes)",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "BgzipMafAdapter",
"uri": "https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.full.maf.gz"
}
}
]
JSON
npx @jbrowse/img --config https://jbrowse.org/ucsc/hg38/config.json \
--trackConfigs tracks.json \
--assembly hg38 --loc chr6:31,980,000-32,050,000 \
--track hprc_v2_1_mc_grch38 \
--out figure.svgFor a PNG, --out figure.png (needs rsvg-convert: apt install librsvg2-bin, brew install librsvg).
With the uri shorthand, JBrowse finds the .tai beside the MAF. For a MAF of
your own, taffy writes the index beside it:
# writes alignment.maf.gz.tai, which the adapter finds by its name
taffy index -i alignment.maf.gzGo back to the C4 window, chr6:31,980,000-32,050,000, with the genes, the VCF
and this alignment over the graph track. A white stretch in an alignment row is
sequence that haplotype lacks. Then:
- Clustering → Cluster rows by genotype... on the VCF orders its rows.
- Clustering → Cluster rows by identity... on the alignment clusters over the window in view, because HPRC's file has no guide tree.
- Reset row order restores the order in the file.
- To shade CYP21A1P and TNXA, drag across
chr6:32,005,691-32,011,057on the scale bar and pick Highlight region.
The VCF's widest blue block is one record, a deletion of a whole C4-CYP21-TNX
module, which is the dashed arc in the C4 graph. Every alignment row in the
white block has that deletion in the VCF. The narrower blocks are haplotypes
that lack the 6.4 kb HERV-K (endogenous retrovirus) in a C4 gene's intron, which
GRCh38 has, the difference between a long and a short C4. The <INS> 26.4Kbp
label over the block in C4B belongs to a rarer record at the same site.
Follow haplotypes through C4
The graph track above draws the sequence that exists at C4. A graph cut from the haplotypes' walks also draws the route each haplotype takes. A walk is one haplotype's path through the graph, and a highlighted walk is a colored thread along the nodes it passes through. In the same window:
- Turn on HPRC release 2 haplotypes vs GRCh38, read from the haplotype walk files in the track selector. It opens as a force-directed graph of GRCh38's walk and eight haplotypes' walks.
- Turn the launch's variant matrix, HPRC2 pangenome structural variants (464 haplotypes), back on.
- Press the button beside Haplotypes in the haplotypes track's key, and
check
GRCh38,HG00128andHG00133. - Take Track sizing → Fit graph to track height in the track menu, which draws the whole graph inside the track.
Each highlighted walk takes its color in the key, and the rest of the graph fades to grey. Read the threads this way:
- Threads side by side pass through the same nodes. The three highlighted threads run together through C4A and most of the window.
- A thread that leaves the others takes another allele. In C4B, GRCh38's thread runs through the HERV-K insertion and HG00133's takes the link that skips it. The variant matrix marks that deletion, at chr6:32,017,423, in HG00133's row.
- A loop in one color is sequence only that haplotype has here. At the same place HG00128 alone runs the large loop, a further C4-CYP21-TNX module. Its block in the matrix is a separate record at chr6:32,017,430, where a 26 kb allele takes the place of 6.4 kb of GRCh38, and only HG00128 has it. The genes on it come from the annotation of HG00128's assembly, so each name ends with the haplotype.
- Hover a node, and the key gives its position on the contig of each highlighted haplotype.
A panel per haplotype, further down the same list, draws the same layout once for each highlighted haplotype, shaded light to dark from the start of its walk to the end. A panel's title gives the stretch of the haplotype's contig the walk covers and its length, and clicking a title highlights that haplotype alone.
Limits of the graph and the page
The HPRC page's examples are loci where at least one launch draws something readable. At a locus of your own, a picture that looks simple or empty can mislead in these cases:
- Near-identical duplications are drawn as a single thread. The graph puts the copies of SMN1 / SMN2, SRGAP2 and the 8p23.1 beta-defensin cluster on one path, so those examples offer no Graph launch. A gene-level graph shows copy number there.
- The graph does not align every haplotype everywhere. A haplotype the graph does not align across a window gets no lane, and the page counts them. At FLNA / EMD those are the haplotypes without an X chromosome; elsewhere the sequence exists in the assembly and the graph leaves it out.
- The VCF has no record for the largest events. HPRC drops the biggest sites from the VCF and keeps the smaller sites nested inside them, so the Variants launch cannot show the UGT2B17 deletion. The page's map reads each haplotype's forms from the graph itself, so it draws the deletion and names it.
- The antibody loci hold the cell lines' deletions. Many HPRC assemblies come from lymphoblastoid cell lines, B cells whose V(D)J recombination deletes hundreds of kb of IGH, IGK and IGL (Rodriguez et al. 2021, IGLoo for IGH). In the walk file the lanes read, many haplotypes jump over chunks of IGH and IGK, fewer over IGL, and none over the T-cell receptor loci TRA and TRB. Check a deletion there against the donor's germline data before reporting it.
- A typed locus is checked for structure only. The page reads the window you type, and where the haplotypes share one structure it says so, as do the Graph and Variants launches. A window can still land where the graph merges duplicated copies into one thread or the VCF has no record, and the page offers the launch anyway.
- Each launch shows one part of the locus. The graph shows which sequence exists, the VCF shows which haplotypes have it, and the lanes show how a few haplotypes are arranged.
Reproduce it end to end
Hosting your own graph builds the
index files and the bubbles track in one command that runs on any rGFA. Run on
hprc-v2.1-mc-grch38.sv.gfa.gz, it writes the files we host, and
README.txt beside them gives their
provenance. For a graph of your own, minigraph can list each assembly's route
through every bubble; see
Which haplotypes pass through each segment.
See also
- Tutorial: Pangenome (HPRC) part 2: haplotypes against each other
- Tutorial: Pangenome (HPRC) part 3: repeat lengths across haplotypes
- Tutorial: Pangenome (hosting your own graph)
- Tutorial: Pangenome (mouse)
- Tutorial: Pangenome (cattle)
- User guide: Graph genome view
- User guide: Variant sample rows
- User guide: MAF track
- BandageJS
External links
- Li H.
The rGFA format and
gfatools, which define the
SN/SO/SRtags this page opens the graph by, and whosebubblesubcommand calls the bubbles it reads. - taffy, which writes the
.taiindex that makes the alignment addressable by locus. - ggbandage, which draws the C4 graph from the same hosted files as ggplot2 layers in R.
- ggtubemap, which draws HLA-A's haplotypes as a tube map in ggplot2.
Citations
- HPRC release 2, the release this
page opens: the Minigraph-Cactus graph, the multiple alignment and the VCFs
vg deconstructwrites from the graph. - Hughes et al. (2006). A common CFH haplotype, with deletion of CFHR1 and CFHR3, is associated with lower risk of age-related macular degeneration
Feedback on this tutorial is welcome: contact us.