AlphaGenome 2 predictions by cell type
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.
An inflammatory bowel disease association on chromosome 21 fine-maps to seven SNPs in 1.2 kb of gene desert, 289 kb from the ETS2 promoter. AlphaGenome 2 predicts a variant's effect on expression and on chromatin accessibility separately for each cell type it was trained on. Drawn per cell type along the chromosome, those predictions show which SNP has an effect, on which gene, and in which cell types, following DeepMind's own worked example. At ETS2 and the enhancer between ETS2 and PSMG1, we:
- load the credible set as a variant track
- load each SNP's predicted effect on each gene from one BED, faceted into a section per ileum immune cell type, then per SNP in macrophages
- load the input gradient of ETS2 expression along the megabase around it
- open the enhancer and load predicted single-cell ATAC (scATAC) per cell type for the change the protective allele makes, over the measured blood monocyte rows
- load the predicted effect of every base change at the enhancer as a heatmap
Every track on this page except the credible set and the genes is a model's output. The tracks follow DeepMind's fine-mapping notebook for this locus.
Prerequisites
- nothing beyond a web browser to follow the page
- to make the tracks for your own variants, an
AlphaGenome API key and
Python 3.10 or later with
pip install "alphagenome==2.0.*" pyBigWig pysam
Loading GRCh38
AlphaGenome 2 predicts from GRCh38 sequence, and the files below use its
chr21-style chromosome names:
Goes in the assemblies array of config.json. See Assemblies.
{
"name": "hg38",
"uri": "https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz",
"refNameAliases": {
"uri": "https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/hg38_aliases.txt"
},
"cytobands": "https://jbrowse.org/genomes/GRCh38/cytoBand.txt"
}Edits config.json in the current folder, creating it if there is none. See JBrowse CLI with Desktop.
jbrowse add-assembly https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz \
--name hg38 \
--refNameAliases https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/hg38_aliases.txt \
--config '{"cytobands":"https://jbrowse.org/genomes/GRCh38/cytoBand.txt"}'hg38 is one of the genomes JBrowse Desktop hosts, with gene tracks already set up: on the start screen click Browse hosted genomes and pick it. To load the files of this config instead:
In JBrowse Desktop, Open your own genome on the start screen (or File → Open genome... in a session), then Open from a URL and paste, one per line:
https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz
https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz.fai
https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz.gziJBrowse reads the format off the file name. Then fill in:
- Genome name:
hg38 - refName aliases (under More options):
https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/hg38_aliases.txt - cytobands (under More options):
https://jbrowse.org/genomes/GRCh38/cytoBand.txt
The genes are NCBI's curated RefSeq set from the hg38 page on genomes.jbrowse.org:
Goes in the tracks array of config.json. See Tracks.
{
"trackId": "hg38-ncbiRefSeqCurated",
"name": "NCBI RefSeq - RefSeq Curated",
"uri": "https://jbrowse.org/ucsc/hg38/ncbiRefSeqCurated.gff.gz",
"csi": true,
"assemblyNames": ["hg38"]
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track https://jbrowse.org/ucsc/hg38/ncbiRefSeqCurated.gff.gz \
--trackId hg38-ncbiRefSeqCurated \
--name "NCBI RefSeq - RefSeq Curated" \
--assemblyNames hg38 \
--indexFile https://jbrowse.org/ucsc/hg38/ncbiRefSeqCurated.gff.gz.csiIn JBrowse Desktop, or in any running JBrowse Web session, open a view on this track’s assembly, then File → Open track... and, in Add a track from file or URL, enter:
- Main file:
https://jbrowse.org/ucsc/hg38/ncbiRefSeqCurated.gff.gz - Index file:
https://jbrowse.org/ucsc/hg38/ncbiRefSeqCurated.gff.gz.csi
JBrowse reads the adapter and track type off the file name. Then fill in:
- Track name:
NCBI RefSeq - RefSeq Curated - Assembly:
hg38
Click Add.
The credible set as a variant track
The credible set is the seven SNPs SuSiE kept from the IBD GWAS (study
GCST004133) in Stankey et al. (2024). The VCF has each SNP's posterior inclusion
probability (PIP) and GWAS effect in INFO, so clicking a SNP shows both. The
reference allele is the risk allele at every SNP, and the alternate is
protective:
Goes in the tracks array of config.json. See Tracks.
{
"trackId": "ets2_ibd_credible_set",
"name": "IBD credible set at chr21q22",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/credible_set.vcf.gz",
"assemblyNames": ["hg38"]
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track https://jbrowse.org/demos/alphagenome2_singlecell/ets2/credible_set.vcf.gz \
--trackId ets2_ibd_credible_set \
--name "IBD credible set at chr21q22" \
--assemblyNames hg38In JBrowse Desktop, or in any running JBrowse Web session, open a view on this track’s assembly, then File → Open track... and, in Add a track from file or URL, enter:
- Main file:
https://jbrowse.org/demos/alphagenome2_singlecell/ets2/credible_set.vcf.gz
JBrowse reads the adapter and track type off the file name. Then fill in:
- Track name:
IBD credible set at chr21q22 - Assembly:
hg38
Click Add.
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%22trackId%22%3A%22ets2_ibd_credible_set%22%2C%22name%22%3A%22IBD+credible+set+at+chr21q22%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Falphagenome2_singlecell%2Fets2%2Fcredible_set.vcf.gz%22%2C%22assemblyNames%22%3A%5B%22hg38%22%5D%7D%5D%2C%22views%22%3A%5B%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22hg38%22%2C%22loc%22%3A%22chr21%3A39%2C093%2C000..39%2C095%2C400%22%2C%22tracks%22%3A%5B%22ets2_ibd_credible_set%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+IBD+credible+set+at+chr21q22This 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", []) + [
{
"trackId": "ets2_ibd_credible_set",
"name": "IBD credible set at chr21q22",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/credible_set.vcf.gz",
"assemblyNames": [
"hg38"
]
}
],
views=[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr21:39,093,000..39,095,400",
"tracks": [
"ets2_ibd_credible_set"
]
}
],
)
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 ?? []), ...[
{
"trackId": "ets2_ibd_credible_set",
"name": "IBD credible set at chr21q22",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/credible_set.vcf.gz",
"assemblyNames": [
"hg38"
]
}
]]}
aggregateTextSearchAdapters={config.aggregateTextSearchAdapters}
configuration={config.configuration}
views={[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr21:39,093,000..39,095,400",
"tracks": [
"ets2_ibd_credible_set"
]
}
]}
/>
)
}jbrowse-img draws this view as an SVG, no browser needed. Swap --config or a track for your own.
cat > tracks.json <<'JSON'
[
{
"trackId": "ets2_ibd_credible_set",
"name": "IBD credible set at chr21q22",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/credible_set.vcf.gz",
"assemblyNames": [
"hg38"
]
}
]
JSON
npx @jbrowse/img --config https://jbrowse.org/ucsc/hg38/config.json \
--trackConfigs tracks.json \
--assembly hg38 --loc chr21:39,093,000..39,095,400 \
--track ets2_ibd_credible_set \
--out figure.svgFor a PNG, --out figure.png (needs rsvg-convert: apt install librsvg2-bin, brew install librsvg).
Predicted expression effects as a BED
score_variants predicts each SNP's effect on every gene within half a
megabase, once per cell type. The ileum conditions are the seven immune cell
types the notebook uses, and each is a tissue and Cell Ontology pair such as
UBERON:0002116_CL:0000235 for ileum macrophages:
scores = variant_scorers.tidy_scores(
model.score_variants(
intervals=intervals,
variants=variants,
variant_scorers=[variant_scorers.RECOMMENDED_VARIANT_SCORERS['SC_GENE_EXPRESSION']],
conditions=conds,
),
filter_protein_coding=True,
)A score is one log fold change per protein-coding gene, alternate over
reference, so a score below zero means the protective allele lowers the gene's
predicted expression. The script writes one BED line per gene, SNP and cell
type, over the gene's span in the model's own annotation. A # header names the
columns, and every column becomes a field JBrowse can filter, facet and color by
(tab-separated, shown space-aligned):
#chrom chromStart chromEnd name score strand cell_type snp
chr21 38805182 38824955 ETS2 -0.2327 + Macrophage rs2836882
chr21 38805182 38824955 ETS2 -0.2832 + Monocyte rs2836882
chr21 38805182 38824955 ETS2 -0.0023 + B cell rs2836882rs2836882's effect on expression in each cell type
The track lays the notebook's heatmap along the chromosome, with a section per
cell type and each gene a rectangle colored by its score. filter keeps
rs2836882's lines, facet makes the sections, and the facet's pileup packs
overlapping genes into separate lanes:
Goes in the tracks array of config.json. See Tracks.
{
"type": "FeatureTrack",
"trackId": "ag2_ets2_expression_by_cell_type",
"name": "rs2836882 predicted expression effect per gene, by ileum cell type",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BedTabixAdapter",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/expression_effects.bed.gz"
},
"displays": [
{
"type": "LinearMarkDisplay",
"displayId": "ag2_ets2_expression_by_cell_type-LinearMarkDisplay",
"height": 300,
"filter": [{ "field": "snp", "equal": "rs2836882" }],
"facet": {
"field": "cell_type",
"sort": [
"Macrophage",
"Monocyte",
"B cell",
"CD4 T",
"CD8 T",
"Treg",
"NK"
],
"transform": [{ "type": "pileup" }]
},
"encoding": {
"color": {
"field": "score",
"scale": {
"type": "linear",
"scheme": "redblue",
"domainMin": -0.3,
"domainMax": 0.3,
"domainMid": 0
},
"legend": { "title": "log fold change" }
}
},
"marks": [{ "mark": "rect" }],
"tooltip": "name"
}
]
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "FeatureTrack",
"trackId": "ag2_ets2_expression_by_cell_type",
"name": "rs2836882 predicted expression effect per gene, by ileum cell type",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BedTabixAdapter",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/expression_effects.bed.gz"
},
"displays": [
{
"type": "LinearMarkDisplay",
"displayId": "ag2_ets2_expression_by_cell_type-LinearMarkDisplay",
"height": 300,
"filter": [{ "field": "snp", "equal": "rs2836882" }],
"facet": {
"field": "cell_type",
"sort": [
"Macrophage",
"Monocyte",
"B cell",
"CD4 T",
"CD8 T",
"Treg",
"NK"
],
"transform": [{ "type": "pileup" }]
},
"encoding": {
"color": {
"field": "score",
"scale": {
"type": "linear",
"scheme": "redblue",
"domainMin": -0.3,
"domainMax": 0.3,
"domainMid": 0
},
"legend": { "title": "log fold change" }
}
},
"marks": [{ "mark": "rect" }],
"tooltip": "name"
}
]
}'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": "FeatureTrack",
"trackId": "ag2_ets2_expression_by_cell_type",
"name": "rs2836882 predicted expression effect per gene, by ileum cell type",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BedTabixAdapter",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/expression_effects.bed.gz"
},
"displays": [
{
"type": "LinearMarkDisplay",
"displayId": "ag2_ets2_expression_by_cell_type-LinearMarkDisplay",
"height": 300,
"filter": [{ "field": "snp", "equal": "rs2836882" }],
"facet": {
"field": "cell_type",
"sort": [
"Macrophage",
"Monocyte",
"B cell",
"CD4 T",
"CD8 T",
"Treg",
"NK"
],
"transform": [{ "type": "pileup" }]
},
"encoding": {
"color": {
"field": "score",
"scale": {
"type": "linear",
"scheme": "redblue",
"domainMin": -0.3,
"domainMax": 0.3,
"domainMid": 0
},
"legend": { "title": "log fold change" }
}
},
"marks": [{ "mark": "rect" }],
"tooltip": "name"
}
]
}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%22FeatureTrack%22%2C%22trackId%22%3A%22ag2_ets2_expression_by_cell_type%22%2C%22name%22%3A%22rs2836882+predicted+expression+effect+per+gene%2C+by+ileum+cell+type%22%2C%22assemblyNames%22%3A%5B%22hg38%22%5D%2C%22adapter%22%3A%7B%22type%22%3A%22BedTabixAdapter%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Falphagenome2_singlecell%2Fets2%2Fexpression_effects.bed.gz%22%7D%2C%22displays%22%3A%5B%7B%22type%22%3A%22LinearMarkDisplay%22%2C%22displayId%22%3A%22ag2_ets2_expression_by_cell_type-LinearMarkDisplay%22%2C%22height%22%3A300%2C%22filter%22%3A%5B%7B%22field%22%3A%22snp%22%2C%22equal%22%3A%22rs2836882%22%7D%5D%2C%22facet%22%3A%7B%22field%22%3A%22cell_type%22%2C%22sort%22%3A%5B%22Macrophage%22%2C%22Monocyte%22%2C%22B+cell%22%2C%22CD4+T%22%2C%22CD8+T%22%2C%22Treg%22%2C%22NK%22%5D%2C%22transform%22%3A%5B%7B%22type%22%3A%22pileup%22%7D%5D%7D%2C%22encoding%22%3A%7B%22color%22%3A%7B%22field%22%3A%22score%22%2C%22scale%22%3A%7B%22type%22%3A%22linear%22%2C%22scheme%22%3A%22redblue%22%2C%22domainMin%22%3A-0.3%2C%22domainMax%22%3A0.3%2C%22domainMid%22%3A0%7D%2C%22legend%22%3A%7B%22title%22%3A%22log+fold+change%22%7D%7D%7D%2C%22marks%22%3A%5B%7B%22mark%22%3A%22rect%22%7D%5D%2C%22tooltip%22%3A%22name%22%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%22chr21%3A38%2C700%2C000..39%2C330%2C000%22%2C%22tracks%22%3A%5B%22ag2_ets2_expression_by_cell_type%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+rs2836882+predicted+expression+effect+per+gene%2C+by+ileum+cell+typeThis 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": "FeatureTrack",
"trackId": "ag2_ets2_expression_by_cell_type",
"name": "rs2836882 predicted expression effect per gene, by ileum cell type",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "BedTabixAdapter",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/expression_effects.bed.gz"
},
"displays": [
{
"type": "LinearMarkDisplay",
"displayId": "ag2_ets2_expression_by_cell_type-LinearMarkDisplay",
"height": 300,
"filter": [
{
"field": "snp",
"equal": "rs2836882"
}
],
"facet": {
"field": "cell_type",
"sort": [
"Macrophage",
"Monocyte",
"B cell",
"CD4 T",
"CD8 T",
"Treg",
"NK"
],
"transform": [
{
"type": "pileup"
}
]
},
"encoding": {
"color": {
"field": "score",
"scale": {
"type": "linear",
"scheme": "redblue",
"domainMin": -0.3,
"domainMax": 0.3,
"domainMid": 0
},
"legend": {
"title": "log fold change"
}
}
},
"marks": [
{
"mark": "rect"
}
],
"tooltip": "name"
}
]
}
],
views=[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr21:38,700,000..39,330,000",
"tracks": [
"ag2_ets2_expression_by_cell_type"
]
}
],
)
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": "FeatureTrack",
"trackId": "ag2_ets2_expression_by_cell_type",
"name": "rs2836882 predicted expression effect per gene, by ileum cell type",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "BedTabixAdapter",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/expression_effects.bed.gz"
},
"displays": [
{
"type": "LinearMarkDisplay",
"displayId": "ag2_ets2_expression_by_cell_type-LinearMarkDisplay",
"height": 300,
"filter": [
{
"field": "snp",
"equal": "rs2836882"
}
],
"facet": {
"field": "cell_type",
"sort": [
"Macrophage",
"Monocyte",
"B cell",
"CD4 T",
"CD8 T",
"Treg",
"NK"
],
"transform": [
{
"type": "pileup"
}
]
},
"encoding": {
"color": {
"field": "score",
"scale": {
"type": "linear",
"scheme": "redblue",
"domainMin": -0.3,
"domainMax": 0.3,
"domainMid": 0
},
"legend": {
"title": "log fold change"
}
}
},
"marks": [
{
"mark": "rect"
}
],
"tooltip": "name"
}
]
}
]]}
aggregateTextSearchAdapters={config.aggregateTextSearchAdapters}
configuration={config.configuration}
views={[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr21:38,700,000..39,330,000",
"tracks": [
"ag2_ets2_expression_by_cell_type"
]
}
]}
/>
)
}jbrowse-img draws this view as an SVG, no browser needed. Swap --config or a track for your own.
cat > tracks.json <<'JSON'
[
{
"type": "FeatureTrack",
"trackId": "ag2_ets2_expression_by_cell_type",
"name": "rs2836882 predicted expression effect per gene, by ileum cell type",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "BedTabixAdapter",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/expression_effects.bed.gz"
},
"displays": [
{
"type": "LinearMarkDisplay",
"displayId": "ag2_ets2_expression_by_cell_type-LinearMarkDisplay",
"height": 300,
"filter": [
{
"field": "snp",
"equal": "rs2836882"
}
],
"facet": {
"field": "cell_type",
"sort": [
"Macrophage",
"Monocyte",
"B cell",
"CD4 T",
"CD8 T",
"Treg",
"NK"
],
"transform": [
{
"type": "pileup"
}
]
},
"encoding": {
"color": {
"field": "score",
"scale": {
"type": "linear",
"scheme": "redblue",
"domainMin": -0.3,
"domainMax": 0.3,
"domainMid": 0
},
"legend": {
"title": "log fold change"
}
}
},
"marks": [
{
"mark": "rect"
}
],
"tooltip": "name"
}
]
}
]
JSON
npx @jbrowse/img --config https://jbrowse.org/ucsc/hg38/config.json \
--trackConfigs tracks.json \
--assembly hg38 --loc chr21:38,700,000..39,330,000 \
--track ag2_ets2_expression_by_cell_type \
--out figure.svgFor a PNG, --out figure.png (needs rsvg-convert: apt install librsvg2-bin, brew install librsvg).
With domainMin, domainMax and domainMid pinned, a score of zero is white
in every section, as in the notebook's color scale. Hovering a rectangle names
its gene. Genes without a rectangle, such as ETS2-AS1, are not protein-coding,
so score_variants left them out.
The second track reads the same BED filtered to macrophages and faceted by SNP, a section per credible-set SNP in genomic order:
Goes in the tracks array of config.json. See Tracks.
{
"type": "FeatureTrack",
"trackId": "ag2_ets2_macrophage_by_snp",
"name": "Macrophage predicted expression effect per gene, by credible-set SNP",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BedTabixAdapter",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/expression_effects.bed.gz"
},
"displays": [
{
"type": "LinearMarkDisplay",
"displayId": "ag2_ets2_macrophage_by_snp-LinearMarkDisplay",
"height": 300,
"filter": [{ "field": "cell_type", "equal": "Macrophage" }],
"facet": {
"field": "snp",
"sort": [
"rs4817986",
"rs2836878",
"rs4817987",
"rs2836881",
"rs9808651",
"rs2836882",
"rs2836883"
],
"transform": [{ "type": "pileup" }]
},
"encoding": {
"color": {
"field": "score",
"scale": {
"type": "linear",
"scheme": "redblue",
"domainMin": -0.3,
"domainMax": 0.3,
"domainMid": 0
},
"legend": { "title": "log fold change" }
}
},
"marks": [{ "mark": "rect" }],
"tooltip": "name"
}
]
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "FeatureTrack",
"trackId": "ag2_ets2_macrophage_by_snp",
"name": "Macrophage predicted expression effect per gene, by credible-set SNP",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BedTabixAdapter",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/expression_effects.bed.gz"
},
"displays": [
{
"type": "LinearMarkDisplay",
"displayId": "ag2_ets2_macrophage_by_snp-LinearMarkDisplay",
"height": 300,
"filter": [{ "field": "cell_type", "equal": "Macrophage" }],
"facet": {
"field": "snp",
"sort": [
"rs4817986",
"rs2836878",
"rs4817987",
"rs2836881",
"rs9808651",
"rs2836882",
"rs2836883"
],
"transform": [{ "type": "pileup" }]
},
"encoding": {
"color": {
"field": "score",
"scale": {
"type": "linear",
"scheme": "redblue",
"domainMin": -0.3,
"domainMax": 0.3,
"domainMid": 0
},
"legend": { "title": "log fold change" }
}
},
"marks": [{ "mark": "rect" }],
"tooltip": "name"
}
]
}'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": "FeatureTrack",
"trackId": "ag2_ets2_macrophage_by_snp",
"name": "Macrophage predicted expression effect per gene, by credible-set SNP",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BedTabixAdapter",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/expression_effects.bed.gz"
},
"displays": [
{
"type": "LinearMarkDisplay",
"displayId": "ag2_ets2_macrophage_by_snp-LinearMarkDisplay",
"height": 300,
"filter": [{ "field": "cell_type", "equal": "Macrophage" }],
"facet": {
"field": "snp",
"sort": [
"rs4817986",
"rs2836878",
"rs4817987",
"rs2836881",
"rs9808651",
"rs2836882",
"rs2836883"
],
"transform": [{ "type": "pileup" }]
},
"encoding": {
"color": {
"field": "score",
"scale": {
"type": "linear",
"scheme": "redblue",
"domainMin": -0.3,
"domainMax": 0.3,
"domainMid": 0
},
"legend": { "title": "log fold change" }
}
},
"marks": [{ "mark": "rect" }],
"tooltip": "name"
}
]
}Input gradient of ETS2 expression
predict_interval_gradients takes the gradient of one gene's predicted
expression with respect to each base of the megabase centered on its
transcription start site, multiplied by the reference sequence, which gives one
value per base. Positive values mark bases that raise the prediction:
gradient = model.predict_interval_gradients(
genes.at['ETS2', 'gene_id'],
requested_output=dna_client.OutputType.SC_GENE_EXPRESSION,
condition=ileum['Macrophage'],
)
per_base = gradient.gradients.sum(axis=1)The script writes per_base as a BigWig, which loads as a quantitative track
with a symmetric axis:
Goes in the tracks array of config.json. See Tracks.
{
"type": "QuantitativeTrack",
"trackId": "ag2_ets2_gradient",
"name": "Input gradient of ETS2 expression in ileum macrophage",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BigWigAdapter",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/gradient_ETS2_Macrophage.bw"
},
"displayDefaults": {
"mark": "bar",
"height": 100,
"encoding": {
"y": {
"scale": { "domainMin": -0.15, "domainMax": 0.15 },
"axis": { "title": "gradient × input" }
}
}
}
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track https://jbrowse.org/demos/alphagenome2_singlecell/ets2/gradient_ETS2_Macrophage.bw \
--trackId ag2_ets2_gradient \
--name "Input gradient of ETS2 expression in ileum macrophage" \
--assemblyNames hg38 \
--displayDefaults '{"mark":"bar","height":100,"encoding":{"y":{"scale":{"domainMin":-0.15,"domainMax":0.15},"axis":{"title":"gradient × input"}}}}'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": "QuantitativeTrack",
"trackId": "ag2_ets2_gradient",
"name": "Input gradient of ETS2 expression in ileum macrophage",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BigWigAdapter",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/gradient_ETS2_Macrophage.bw"
},
"displayDefaults": {
"mark": "bar",
"height": 100,
"encoding": {
"y": {
"scale": { "domainMin": -0.15, "domainMax": 0.15 },
"axis": { "title": "gradient × input" }
}
}
}
}Open the three tracks over the span from ETS2 to BRWD1:
chr21:38,700,000-39,330,000ETS2 is red, a lower predicted expression with the protective allele, in the macrophage and monocyte sections and white in the lymphoid ones. Of the genes nearer the SNPs, PSMG1 is pale in the myeloid sections and BRWD1 stays white. In the macrophage track ETS2 is deep red in the rs2836882 section, pale pink in the rs9808651 section and white in the other five, although rs2836878 has the highest PIP.
The input gradient's tallest bar in the whole megabase is at rs2836882, 289 kb from ETS2, taller than any at the ETS2 promoter.
Predicted accessibility at the enhancer
The variant prediction behind the BigWigs below is predict_variants with
OutputType.SC_ATAC, one call per cell type, which returns the predicted scATAC
for the reference and the alternate sequence. The script keeps the 10x Cell
Ranger track, as the notebook does, and writes the reference and the alternate
minus the reference as two BigWigs per cell type.
AlphaGenome 2 was trained on single-cell expression from these ileum cell types
but on no scATAC from them. supported_conditions() lists the mode of each cell
type's prediction for each output, and for ileum scATAC it is
imputed_supported, and the track names include it. The change track's axis is
pinned symmetric, so zero sits mid-row. The fence lists three of its seven rows:
Goes in the tracks array of config.json. See Tracks.
{
"type": "MultiQuantitativeTrack",
"trackId": "ag2_ets2_atac_change",
"name": "Predicted scATAC change, protective minus risk (imputed_supported)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "Macrophage",
"group": "Myeloid",
"color": "#d62728",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_Macrophage.bw"
},
{
"type": "BigWigAdapter",
"name": "Monocyte",
"group": "Myeloid",
"color": "#ff7f0e",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_Monocyte.bw"
},
{
"type": "BigWigAdapter",
"name": "B cell",
"group": "Lymphoid",
"color": "#1f77b4",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_B_cell.bw"
}
]
},
"displayDefaults": {
"mark": "bar",
"height": 240,
"encoding": {
"y": {
"scale": { "domainMin": -14, "domainMax": 14 },
"axis": { "title": "scATAC change" }
}
}
}
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "MultiQuantitativeTrack",
"trackId": "ag2_ets2_atac_change",
"name": "Predicted scATAC change, protective minus risk (imputed_supported)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "Macrophage",
"group": "Myeloid",
"color": "#d62728",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_Macrophage.bw"
},
{
"type": "BigWigAdapter",
"name": "Monocyte",
"group": "Myeloid",
"color": "#ff7f0e",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_Monocyte.bw"
},
{
"type": "BigWigAdapter",
"name": "B cell",
"group": "Lymphoid",
"color": "#1f77b4",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_B_cell.bw"
}
]
},
"displayDefaults": {
"mark": "bar",
"height": 240,
"encoding": {
"y": {
"scale": { "domainMin": -14, "domainMax": 14 },
"axis": { "title": "scATAC change" }
}
}
}
}'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": "MultiQuantitativeTrack",
"trackId": "ag2_ets2_atac_change",
"name": "Predicted scATAC change, protective minus risk (imputed_supported)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "Macrophage",
"group": "Myeloid",
"color": "#d62728",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_Macrophage.bw"
},
{
"type": "BigWigAdapter",
"name": "Monocyte",
"group": "Myeloid",
"color": "#ff7f0e",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_Monocyte.bw"
},
{
"type": "BigWigAdapter",
"name": "B cell",
"group": "Lymphoid",
"color": "#1f77b4",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_B_cell.bw"
}
]
},
"displayDefaults": {
"mark": "bar",
"height": 240,
"encoding": {
"y": {
"scale": { "domainMin": -14, "domainMax": 14 },
"axis": { "title": "scATAC change" }
}
}
}
}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%22MultiQuantitativeTrack%22%2C%22trackId%22%3A%22ag2_ets2_atac_change%22%2C%22name%22%3A%22Predicted+scATAC+change%2C+protective+minus+risk+%28imputed_supported%29%22%2C%22assemblyNames%22%3A%5B%22hg38%22%5D%2C%22adapter%22%3A%7B%22type%22%3A%22MultiWiggleAdapter%22%2C%22subadapters%22%3A%5B%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22Macrophage%22%2C%22group%22%3A%22Myeloid%22%2C%22color%22%3A%22%23d62728%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Falphagenome2_singlecell%2Fets2%2Fatac_change_Macrophage.bw%22%7D%2C%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22Monocyte%22%2C%22group%22%3A%22Myeloid%22%2C%22color%22%3A%22%23ff7f0e%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Falphagenome2_singlecell%2Fets2%2Fatac_change_Monocyte.bw%22%7D%2C%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22B+cell%22%2C%22group%22%3A%22Lymphoid%22%2C%22color%22%3A%22%231f77b4%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Falphagenome2_singlecell%2Fets2%2Fatac_change_B_cell.bw%22%7D%5D%7D%2C%22displayDefaults%22%3A%7B%22mark%22%3A%22bar%22%2C%22height%22%3A240%2C%22encoding%22%3A%7B%22y%22%3A%7B%22scale%22%3A%7B%22domainMin%22%3A-14%2C%22domainMax%22%3A14%7D%2C%22axis%22%3A%7B%22title%22%3A%22scATAC+change%22%7D%7D%7D%7D%7D%5D%2C%22views%22%3A%5B%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22hg38%22%2C%22loc%22%3A%22chr21%3A39%2C094%2C144..39%2C095%2C144%22%2C%22tracks%22%3A%5B%22ag2_ets2_atac_change%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+Predicted+scATAC+change%2C+protective+minus+risk+%28imputed_supported%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": "MultiQuantitativeTrack",
"trackId": "ag2_ets2_atac_change",
"name": "Predicted scATAC change, protective minus risk (imputed_supported)",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "Macrophage",
"group": "Myeloid",
"color": "#d62728",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_Macrophage.bw"
},
{
"type": "BigWigAdapter",
"name": "Monocyte",
"group": "Myeloid",
"color": "#ff7f0e",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_Monocyte.bw"
},
{
"type": "BigWigAdapter",
"name": "B cell",
"group": "Lymphoid",
"color": "#1f77b4",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_B_cell.bw"
}
]
},
"displayDefaults": {
"mark": "bar",
"height": 240,
"encoding": {
"y": {
"scale": {
"domainMin": -14,
"domainMax": 14
},
"axis": {
"title": "scATAC change"
}
}
}
}
}
],
views=[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr21:39,094,144..39,095,144",
"tracks": [
"ag2_ets2_atac_change"
]
}
],
)
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": "MultiQuantitativeTrack",
"trackId": "ag2_ets2_atac_change",
"name": "Predicted scATAC change, protective minus risk (imputed_supported)",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "Macrophage",
"group": "Myeloid",
"color": "#d62728",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_Macrophage.bw"
},
{
"type": "BigWigAdapter",
"name": "Monocyte",
"group": "Myeloid",
"color": "#ff7f0e",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_Monocyte.bw"
},
{
"type": "BigWigAdapter",
"name": "B cell",
"group": "Lymphoid",
"color": "#1f77b4",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_B_cell.bw"
}
]
},
"displayDefaults": {
"mark": "bar",
"height": 240,
"encoding": {
"y": {
"scale": {
"domainMin": -14,
"domainMax": 14
},
"axis": {
"title": "scATAC change"
}
}
}
}
}
]]}
aggregateTextSearchAdapters={config.aggregateTextSearchAdapters}
configuration={config.configuration}
views={[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr21:39,094,144..39,095,144",
"tracks": [
"ag2_ets2_atac_change"
]
}
]}
/>
)
}jbrowse-img draws this view as an SVG, no browser needed. Swap --config or a track for your own.
cat > tracks.json <<'JSON'
[
{
"type": "MultiQuantitativeTrack",
"trackId": "ag2_ets2_atac_change",
"name": "Predicted scATAC change, protective minus risk (imputed_supported)",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "Macrophage",
"group": "Myeloid",
"color": "#d62728",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_Macrophage.bw"
},
{
"type": "BigWigAdapter",
"name": "Monocyte",
"group": "Myeloid",
"color": "#ff7f0e",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_Monocyte.bw"
},
{
"type": "BigWigAdapter",
"name": "B cell",
"group": "Lymphoid",
"color": "#1f77b4",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/atac_change_B_cell.bw"
}
]
},
"displayDefaults": {
"mark": "bar",
"height": 240,
"encoding": {
"y": {
"scale": {
"domainMin": -14,
"domainMax": 14
},
"axis": {
"title": "scATAC change"
}
}
}
}
}
]
JSON
npx @jbrowse/img --config https://jbrowse.org/ucsc/hg38/config.json \
--trackConfigs tracks.json \
--assembly hg38 --loc chr21:39,094,144..39,095,144 \
--track ag2_ets2_atac_change \
--out figure.svgFor a PNG, --out figure.png (needs rsvg-convert: apt install librsvg2-bin, brew install librsvg).
ag2_ets2_atac_reference in the hosted config holds the risk allele's predicted
scATAC the same way, from atac_reference_<Cell_type>.bw, with an axis from
zero. Under both goes measured scATAC from blood: the monocyte rows of the 10x
PBMC pseudobulk track of Single-cell RNA and ATAC pseudobulk, whose hosted
config has all twelve rows. Its cells are unstimulated blood monocytes, so it
tests whether monocytes open this enhancer and cannot check the ileum
predictions:
Goes in the tracks array of config.json. See Tracks.
{
"type": "MultiQuantitativeTrack",
"trackId": "pbmc5k_scatac_pseudobulk_hg38",
"name": "Single-cell ATAC pseudobulk by cell type (10x 5k PBMC, SnapATAC2)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "CD14 Mono",
"group": "Myeloid",
"color": "#aa40fc",
"uri": "https://jbrowse.org/demos/scatac_pbmc5k/CD14_Mono.bw"
},
{
"type": "BigWigAdapter",
"name": "CD16 Mono",
"group": "Myeloid",
"color": "#8c564b",
"uri": "https://jbrowse.org/demos/scatac_pbmc5k/CD16_Mono.bw"
}
]
},
"displayDefaults": { "mark": "bar", "height": 100 }
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "MultiQuantitativeTrack",
"trackId": "pbmc5k_scatac_pseudobulk_hg38",
"name": "Single-cell ATAC pseudobulk by cell type (10x 5k PBMC, SnapATAC2)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "CD14 Mono",
"group": "Myeloid",
"color": "#aa40fc",
"uri": "https://jbrowse.org/demos/scatac_pbmc5k/CD14_Mono.bw"
},
{
"type": "BigWigAdapter",
"name": "CD16 Mono",
"group": "Myeloid",
"color": "#8c564b",
"uri": "https://jbrowse.org/demos/scatac_pbmc5k/CD16_Mono.bw"
}
]
},
"displayDefaults": { "mark": "bar", "height": 100 }
}'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": "MultiQuantitativeTrack",
"trackId": "pbmc5k_scatac_pseudobulk_hg38",
"name": "Single-cell ATAC pseudobulk by cell type (10x 5k PBMC, SnapATAC2)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "CD14 Mono",
"group": "Myeloid",
"color": "#aa40fc",
"uri": "https://jbrowse.org/demos/scatac_pbmc5k/CD14_Mono.bw"
},
{
"type": "BigWigAdapter",
"name": "CD16 Mono",
"group": "Myeloid",
"color": "#8c564b",
"uri": "https://jbrowse.org/demos/scatac_pbmc5k/CD16_Mono.bw"
}
]
},
"displayDefaults": { "mark": "bar", "height": 100 }
}Open the kilobase around rs2836882:
chr21:39,094,144-39,095,144Predicted accessibility is near zero outside the macrophage and monocyte rows, and in those two rows the protective allele lowers it across the enhancer, most near rs2836882. Stankey et al. measured the same direction in primary macrophages, where the risk allele has higher accessibility and PU.1 binding.
Every base change at the enhancer
In silico mutagenesis (ISM) scores every single-base change in a window, here the 64 bases around rs2836882, for its effect on ETS2 in macrophages:
ism = model.score_ism_variants(
interval=window,
ism_interval=ism_interval,
condition=ileum['Macrophage'],
variant_scorers=[variant_scorers.RECOMMENDED_VARIANT_SCORERS['SC_GENE_EXPRESSION']],
)The script writes one BigWig per base mutated to, ism_A.bw to ism_T.bw, and
a MultiQuantitativeTrack draws them as a heatmap of four rows. A base's own
row stays empty, since changing a base to itself has no effect. The figure shows
the forward strand of the Reference sequence track, hg38-refseq, above it:
Goes in the tracks array of config.json. See Tracks.
{
"type": "MultiQuantitativeTrack",
"trackId": "ag2_ets2_ism",
"name": "rs2836882 ISM, ETS2 expression in ileum macrophage, by base mutated to",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "A",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_A.bw"
},
{
"type": "BigWigAdapter",
"name": "C",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_C.bw"
},
{
"type": "BigWigAdapter",
"name": "G",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_G.bw"
},
{
"type": "BigWigAdapter",
"name": "T",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_T.bw"
}
]
},
"displayDefaults": {
"mark": "rect",
"height": 80,
"encoding": {
"y": { "scale": { "domainMin": -0.35, "domainMax": 0.35 } },
"color": {
"scale": { "type": "linear", "scheme": "redblue", "domainMid": 0 },
"legend": { "title": "log fold change" }
}
}
}
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "MultiQuantitativeTrack",
"trackId": "ag2_ets2_ism",
"name": "rs2836882 ISM, ETS2 expression in ileum macrophage, by base mutated to",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "A",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_A.bw"
},
{
"type": "BigWigAdapter",
"name": "C",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_C.bw"
},
{
"type": "BigWigAdapter",
"name": "G",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_G.bw"
},
{
"type": "BigWigAdapter",
"name": "T",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_T.bw"
}
]
},
"displayDefaults": {
"mark": "rect",
"height": 80,
"encoding": {
"y": { "scale": { "domainMin": -0.35, "domainMax": 0.35 } },
"color": {
"scale": { "type": "linear", "scheme": "redblue", "domainMid": 0 },
"legend": { "title": "log fold change" }
}
}
}
}'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": "MultiQuantitativeTrack",
"trackId": "ag2_ets2_ism",
"name": "rs2836882 ISM, ETS2 expression in ileum macrophage, by base mutated to",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "A",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_A.bw"
},
{
"type": "BigWigAdapter",
"name": "C",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_C.bw"
},
{
"type": "BigWigAdapter",
"name": "G",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_G.bw"
},
{
"type": "BigWigAdapter",
"name": "T",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_T.bw"
}
]
},
"displayDefaults": {
"mark": "rect",
"height": 80,
"encoding": {
"y": { "scale": { "domainMin": -0.35, "domainMax": 0.35 } },
"color": {
"scale": { "type": "linear", "scheme": "redblue", "domainMid": 0 },
"legend": { "title": "log fold change" }
}
}
}
}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%22MultiQuantitativeTrack%22%2C%22trackId%22%3A%22ag2_ets2_ism%22%2C%22name%22%3A%22rs2836882+ISM%2C+ETS2+expression+in+ileum+macrophage%2C+by+base+mutated+to%22%2C%22assemblyNames%22%3A%5B%22hg38%22%5D%2C%22adapter%22%3A%7B%22type%22%3A%22MultiWiggleAdapter%22%2C%22subadapters%22%3A%5B%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22A%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Falphagenome2_singlecell%2Fets2%2Fism_A.bw%22%7D%2C%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22C%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Falphagenome2_singlecell%2Fets2%2Fism_C.bw%22%7D%2C%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22G%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Falphagenome2_singlecell%2Fets2%2Fism_G.bw%22%7D%2C%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22T%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Falphagenome2_singlecell%2Fets2%2Fism_T.bw%22%7D%5D%7D%2C%22displayDefaults%22%3A%7B%22mark%22%3A%22rect%22%2C%22height%22%3A80%2C%22encoding%22%3A%7B%22y%22%3A%7B%22scale%22%3A%7B%22domainMin%22%3A-0.35%2C%22domainMax%22%3A0.35%7D%7D%2C%22color%22%3A%7B%22scale%22%3A%7B%22type%22%3A%22linear%22%2C%22scheme%22%3A%22redblue%22%2C%22domainMid%22%3A0%7D%2C%22legend%22%3A%7B%22title%22%3A%22log+fold+change%22%7D%7D%7D%7D%7D%5D%2C%22views%22%3A%5B%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22hg38%22%2C%22loc%22%3A%22chr21%3A39%2C094%2C602..39%2C094%2C686%22%2C%22tracks%22%3A%5B%22ag2_ets2_ism%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+rs2836882+ISM%2C+ETS2+expression+in+ileum+macrophage%2C+by+base+mutated+toThis 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": "MultiQuantitativeTrack",
"trackId": "ag2_ets2_ism",
"name": "rs2836882 ISM, ETS2 expression in ileum macrophage, by base mutated to",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "A",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_A.bw"
},
{
"type": "BigWigAdapter",
"name": "C",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_C.bw"
},
{
"type": "BigWigAdapter",
"name": "G",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_G.bw"
},
{
"type": "BigWigAdapter",
"name": "T",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_T.bw"
}
]
},
"displayDefaults": {
"mark": "rect",
"height": 80,
"encoding": {
"y": {
"scale": {
"domainMin": -0.35,
"domainMax": 0.35
}
},
"color": {
"scale": {
"type": "linear",
"scheme": "redblue",
"domainMid": 0
},
"legend": {
"title": "log fold change"
}
}
}
}
}
],
views=[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr21:39,094,602..39,094,686",
"tracks": [
"ag2_ets2_ism"
]
}
],
)
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": "MultiQuantitativeTrack",
"trackId": "ag2_ets2_ism",
"name": "rs2836882 ISM, ETS2 expression in ileum macrophage, by base mutated to",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "A",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_A.bw"
},
{
"type": "BigWigAdapter",
"name": "C",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_C.bw"
},
{
"type": "BigWigAdapter",
"name": "G",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_G.bw"
},
{
"type": "BigWigAdapter",
"name": "T",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_T.bw"
}
]
},
"displayDefaults": {
"mark": "rect",
"height": 80,
"encoding": {
"y": {
"scale": {
"domainMin": -0.35,
"domainMax": 0.35
}
},
"color": {
"scale": {
"type": "linear",
"scheme": "redblue",
"domainMid": 0
},
"legend": {
"title": "log fold change"
}
}
}
}
}
]]}
aggregateTextSearchAdapters={config.aggregateTextSearchAdapters}
configuration={config.configuration}
views={[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr21:39,094,602..39,094,686",
"tracks": [
"ag2_ets2_ism"
]
}
]}
/>
)
}jbrowse-img draws this view as an SVG, no browser needed. Swap --config or a track for your own.
cat > tracks.json <<'JSON'
[
{
"type": "MultiQuantitativeTrack",
"trackId": "ag2_ets2_ism",
"name": "rs2836882 ISM, ETS2 expression in ileum macrophage, by base mutated to",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "A",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_A.bw"
},
{
"type": "BigWigAdapter",
"name": "C",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_C.bw"
},
{
"type": "BigWigAdapter",
"name": "G",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_G.bw"
},
{
"type": "BigWigAdapter",
"name": "T",
"uri": "https://jbrowse.org/demos/alphagenome2_singlecell/ets2/ism_T.bw"
}
]
},
"displayDefaults": {
"mark": "rect",
"height": 80,
"encoding": {
"y": {
"scale": {
"domainMin": -0.35,
"domainMax": 0.35
}
},
"color": {
"scale": {
"type": "linear",
"scheme": "redblue",
"domainMid": 0
},
"legend": {
"title": "log fold change"
}
}
}
}
}
]
JSON
npx @jbrowse/img --config https://jbrowse.org/ucsc/hg38/config.json \
--trackConfigs tracks.json \
--assembly hg38 --loc chr21:39,094,602..39,094,686 \
--track ag2_ets2_ism \
--out figure.svgFor a PNG, --out figure.png (needs rsvg-convert: apt install librsvg2-bin, brew install librsvg).
Every change at the seven bases TGCGTCA, rs2836882's G the fourth of them,
lowers ETS2. The notebook identifies them as an AP-1-like motif from the same
scores. The largest single effect, T to A at 39,094,626, is in a second stretch
of red 15 to 25 bases to the left, which the notebook does not discuss.
Reproduce it end to end
build_alphagenome2_singlecell.sh
writes every track on this page with your API key. It:
- scores the seven credible-set SNPs against the seven ileum cell types and writes one BED line per gene, SNP and cell type
- predicts scATAC around rs2836882 for both alleles in each cell type, every base change around it, and the input gradient of ETS2
- predicts scATAC at six PBMC marker loci for Single-cell RNA and ATAC pseudobulk
- writes
config.jsonover hg38 and the RefSeq genes, opening on ETS2
curl -fO https://raw.githubusercontent.com/GMOD/jbrowse-components/main/scripts/build_alphagenome2_singlecell.sh
# BASE=. writes track URIs relative to config.json, for a local copy
ALPHAGENOME_API_KEY=your_key BASE=. bash build_alphagenome2_singlecell.shOpen alphagenome2_singlecell_build/config.json in
JBrowse Desktop to browse the result. For other
variants, replace the credible set and the cell types at the top of the script's
Python block.
See also
- Tutorial: AlphaGenome predictions
- Tutorial: Single-cell RNA and ATAC pseudobulk
- Reference: MultiWiggleAdapter
- Reference: LinearWiggleDisplay
External links
- AlphaGenome 2 announcement
- Fine-mapping the ETS2 locus, the notebook this page follows
- AlphaGenome API documentation
Citations
- Stankey et al. (2024). A disease-associated gene desert directs macrophage inflammation through ETS2
- de Lange et al. (2017). Genome-wide association study implicates immune activation of multiple integrin genes in inflammatory bowel disease
Feedback on this tutorial is welcome: contact us.