Methylation (long-read)
2 videos in this tutorial
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.17. Desktop beta builds are coming soon.
Nanopore and PacBio basecallers record each read's DNA methylation in
base-modification tags (MM and ML), and JBrowse draws those calls straight
from the BAM. At the SNRPN imprinting center, one parent's copy is methylated
and the other's is not. In HG002 nanopore reads there we:
- color each read by its modification calls
- tally the calls into an aggregate track with modkit
- group the reads by haplotype to pull the two parental alleles apart
- smooth each allele into a moving average across the imprinted domain
Prerequisites
- for your own data, long reads whose BAM or CRAM already has
MM/MLmodification tags, which modern ONT and PacBio basecallers write by default, plus a JBrowse instance to load them into (the web quickstart or the desktop quickstart) - modkit 0.6 or later, Oxford Nanopore's single-binary tool for tallying per-read calls into per-CpG methylation fractions, for the aggregate section only
- WhatsHap, to haplotag reads of your own
that have no
HPtag
pip install whatshapThe data
The files are region slices of public
ONT open data on the ont-open-data S3
bucket.
The track configs below load region slices we host, cut from these files, so no
download is needed. Reads of your own with MM and ML tags load by swapping
uri, as Per-read methylation from the alignments shows.
The files
| What it is | File |
|---|---|
The HP1 bedMethyl (per-CpG methylation fractions) from the wf-human-variation sup run on HG002, restricted to m (5mC) rows and cut to the SNRPN locus, and to chr15:22,000,000-27,000,000 for the last section | SAMPLE.wf_mods.1.bedmethyl.gz |
| The HP2 bedMethyl from that same run | SAMPLE.wf_mods.2.bedmethyl.gz |
The reads, from the HG002 sup basecalls, sliced to the same locus and haplotagged with whatshap haplotag against the phased SNP calls from that same wf-human-variation run | PAO83395.pass.cram |
Two parental alleles at the SNRPN imprinting center
Every view below is at chr15:24,948,000-24,962,000, the SNRPN imprinting
center; type it into the location box once the tracks are loaded. The reads and
the aggregate profile should agree on which allele is methylated.
Loading GRCh38
The track's assemblyNames has to name the assembly the reads were aligned to,
GRCh38.
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"
}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 Show all available genomes and pick it. To load the files of this config instead:
In JBrowse Desktop, Open new 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 figures also show UCSC's CpG islands and the NCBI RefSeq genes. The hosted hg38 hub config, https://jbrowse.org/ucsc/hg38/config.json, has both:
- CpG Islands reads https://jbrowse.org/ucsc/hg38/cpgIslandExt.bed.gz with a CSI index
- NCBI RefSeq - RefSeq All reads https://jbrowse.org/ucsc/hg38/ncbiRefSeq.gff.gz
Per-read methylation from the alignments
Load the modBAM as an alignments track. For your own reads, swap uri for a
sorted modBAM or CRAM with the .bai or .crai beside it, aligned to the same
assembly:
Goes in the tracks array of config.json. See Tracks.
{
"trackId": "HG002_snrpn_5mC_reads",
"name": "HG002 ONT reads (5mC, haplotagged)",
"uri": "https://jbrowse.org/demos/methylation/HG002_SNRPN_5mC_haplotagged.bam",
"assemblyNames": ["hg38"]
}jbrowse add-track https://jbrowse.org/demos/methylation/HG002_SNRPN_5mC_haplotagged.bam \
--trackId HG002_snrpn_5mC_reads \
--name "HG002 ONT reads (5mC, haplotagged)" \
--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/methylation/HG002_SNRPN_5mC_haplotagged.bam
Click Next. JBrowse reads the adapter and track type off the file name. Then fill in:
- Track name:
HG002 ONT reads (5mC, haplotagged) - 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%22HG002_snrpn_5mC_reads%22%2C%22name%22%3A%22HG002+ONT+reads+%285mC%2C+haplotagged%29%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Fmethylation%2FHG002_SNRPN_5mC_haplotagged.bam%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%22chr15%3A24%2C948%2C000-24%2C962%2C000%22%2C%22tracks%22%3A%5B%22HG002_snrpn_5mC_reads%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+HG002+ONT+reads+%285mC%2C+haplotagged%29File → Open track... also opens the file by URL and infers the .bai.
Color by... → Per-base coloring → Modifications in the track menu paints each read with its 5mC calls, in one of two modes:
- One color per modification type paints the positions the MM tag reports as modified
- One color per type, plus low-probability & unmodified in blue (IGV's "2-color" scheme) also fills in every CpG the tag left implicit, so an unmethylated region is solid blue
The alignments track guide covers both modes, the probability threshold, and the cytosine-context submenu.
Aggregate methylation with modkit bedMethyl
modkit pileup collapses the per-read calls into a bedMethyl file with one row per CpG per modification type, each holding the fraction of reads that were modified. The file is much smaller than the reads.1
# --cpg: count at CpG sites only
# --combine-strands: one row per CpG, the two strands summed
# --combine-mods with --modified-bases C: 5mC and 5hmC summed into one fraction
modkit pileup sample.bam output.bedmethyl --ref reference.fa \
--cpg --combine-strands --combine-mods --modified-bases C
bgzip output.bedmethyl
tabix -p bed output.bedmethyl.gzTwo modkit pileup options shape the output:
--combine-modscollapses 5mC and 5hmC into a single fraction (bisulfite-equivalent). Pass--modified-bases 5mC 5hmCwithout it to keep separate rows per modification type (mfor 5mC,hfor 5hmC)--phasedwrites one file per haplotype from the reads'HPtags, and this dataset uses it
With --phased the output argument is a directory, which gets hp1.bedmethyl,
hp2.bedmethyl and combined.bedmethyl:
modkit pileup sample.bam hp_bedmethyl/ --ref reference.fa \
--cpg --combine-strands --combine-mods --modified-bases C --phasedbedMethyl is a BED file with a numeric score column, so it loads as a
MultiQuantitativeTrack (see the
multi-quantitative track config guide).
JBrowse reads the modification type from the name column and draws one
subtrack per type, with a vertical bar per CpG on a percent-methylation axis:
Goes in the tracks array of config.json. See Tracks.
{
"type": "MultiQuantitativeTrack",
"trackId": "HG002_snrpn_modkit_hp1",
"name": "HG002 methylation HP1 (modkit)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BedTabixAdapter",
"uri": "https://jbrowse.org/demos/methylation/HG002_SNRPN_hp1.modkit.bed.gz"
}
}jbrowse add-track https://jbrowse.org/demos/methylation/HG002_SNRPN_hp1.modkit.bed.gz \
--trackId HG002_snrpn_modkit_hp1 \
--name "HG002 methylation HP1 (modkit)" \
--assemblyNames hg38 \
--trackType MultiQuantitativeTrackIn 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": "HG002_snrpn_modkit_hp1",
"name": "HG002 methylation HP1 (modkit)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BedTabixAdapter",
"uri": "https://jbrowse.org/demos/methylation/HG002_SNRPN_hp1.modkit.bed.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%22MultiQuantitativeTrack%22%2C%22trackId%22%3A%22HG002_snrpn_modkit_hp1%22%2C%22name%22%3A%22HG002+methylation+HP1+%28modkit%29%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%2Fmethylation%2FHG002_SNRPN_hp1.modkit.bed.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%22chr15%3A24%2C948%2C000-24%2C962%2C000%22%2C%22tracks%22%3A%5B%22HG002_snrpn_modkit_hp1%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+HG002+methylation+HP1+%28modkit%29Splitting the alleles apart
Each long read is one DNA molecule, so reads with an HP haplotype tag (from
WhatsHap, HiPhase or ONT's wf-human-variation) separate by allele. In
grammar-of-graphics terms, Group by...
sets a facet, which splits the display into stacked sections, one per value of
a field.
Pick Group by... → Tag... in the track menu and enter HP. The pileup then
stacks into:
- one band per haplotype, one methylated over the island and the other unmethylated
- an
HP: noneband for the reads the haplotagging could not assign
The dialog also offers to color reads by the tag; with methylation coloring on,
that box starts unchecked, and leaving it unchecked keeps the coloring.
Advanced → Edit plot... shows the resulting facet as text.
The two per-haplotype bedMethyl files from --phased load as one track above
the reads, with a row per file. Pinning the axis at 0 to 100 puts both rows on
one scale, so an unmethylated row stays flat:
Goes in the tracks array of config.json. See Tracks.
{
"type": "MultiQuantitativeTrack",
"trackId": "HG002_snrpn_modkit_multi",
"name": "HG002 5mC by haplotype (modkit)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BedTabixAdapter",
"name": "HP1",
"color": "#d62728",
"uri": "https://jbrowse.org/demos/methylation/HG002_SNRPN_hp1.modkit.bed.gz"
},
{
"type": "BedTabixAdapter",
"name": "HP2",
"color": "#1f77b4",
"uri": "https://jbrowse.org/demos/methylation/HG002_SNRPN_hp2.modkit.bed.gz"
}
]
},
"displayDefaults": {
"mark": "bar",
"encoding": {
"y": {
"scale": { "domainMin": 0, "domainMax": 100 },
"axis": { "title": "% 5mC" }
}
}
}
}jbrowse add-track-json '{
"type": "MultiQuantitativeTrack",
"trackId": "HG002_snrpn_modkit_multi",
"name": "HG002 5mC by haplotype (modkit)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BedTabixAdapter",
"name": "HP1",
"color": "#d62728",
"uri": "https://jbrowse.org/demos/methylation/HG002_SNRPN_hp1.modkit.bed.gz"
},
{
"type": "BedTabixAdapter",
"name": "HP2",
"color": "#1f77b4",
"uri": "https://jbrowse.org/demos/methylation/HG002_SNRPN_hp2.modkit.bed.gz"
}
]
},
"displayDefaults": {
"mark": "bar",
"encoding": {
"y": {
"scale": { "domainMin": 0, "domainMax": 100 },
"axis": { "title": "% 5mC" }
}
}
}
}'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": "HG002_snrpn_modkit_multi",
"name": "HG002 5mC by haplotype (modkit)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BedTabixAdapter",
"name": "HP1",
"color": "#d62728",
"uri": "https://jbrowse.org/demos/methylation/HG002_SNRPN_hp1.modkit.bed.gz"
},
{
"type": "BedTabixAdapter",
"name": "HP2",
"color": "#1f77b4",
"uri": "https://jbrowse.org/demos/methylation/HG002_SNRPN_hp2.modkit.bed.gz"
}
]
},
"displayDefaults": {
"mark": "bar",
"encoding": {
"y": {
"scale": { "domainMin": 0, "domainMax": 100 },
"axis": { "title": "% 5mC" }
}
}
}
}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%22HG002_snrpn_modkit_multi%22%2C%22name%22%3A%22HG002+5mC+by+haplotype+%28modkit%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%22BedTabixAdapter%22%2C%22name%22%3A%22HP1%22%2C%22color%22%3A%22%23d62728%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Fmethylation%2FHG002_SNRPN_hp1.modkit.bed.gz%22%7D%2C%7B%22type%22%3A%22BedTabixAdapter%22%2C%22name%22%3A%22HP2%22%2C%22color%22%3A%22%231f77b4%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Fmethylation%2FHG002_SNRPN_hp2.modkit.bed.gz%22%7D%5D%7D%2C%22displayDefaults%22%3A%7B%22mark%22%3A%22bar%22%2C%22encoding%22%3A%7B%22y%22%3A%7B%22scale%22%3A%7B%22domainMin%22%3A0%2C%22domainMax%22%3A100%7D%2C%22axis%22%3A%7B%22title%22%3A%22%25+5mC%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%22chr15%3A24%2C948%2C000-24%2C962%2C000%22%2C%22tracks%22%3A%5B%22HG002_snrpn_modkit_multi%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+HG002+5mC+by+haplotype+%28modkit%29Reads of your own without an HP tag get one from whatshap haplotag, which
reads a phased VCF. The
alignments track guide
covers the Group-by dialog:
whatshap haplotag --reference reference.fa -o haplotagged.bam phased.vcf.gz reads.bam
samtools index haplotagged.bamSmoothing across the imprinted domain
A single CpG's fraction rests on the few reads covering it, so per-site values
scatter from 0 to 100 and a difference spread over many sites is hard to see. A
window step averages each CpG with a fixed number of neighbouring CpGs, so a
CpG island weighs as many sites as it holds. We'll load both haplotypes around
SNRPN, each in a row with its raw values under a moving average:
Goes in the tracks array of config.json. See Tracks.
{
"type": "MultiQuantitativeTrack",
"trackId": "HG002_imprinted_5mC_smoothed",
"name": "HG002 5mC by haplotype, moving average",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BedTabixAdapter",
"name": "HP1",
"color": "#d62728",
"uri": "https://jbrowse.org/demos/methylation/HG002_chr15_imprinted_hp1.modkit.bed.gz"
},
{
"type": "BedTabixAdapter",
"name": "HP2",
"color": "#1f77b4",
"uri": "https://jbrowse.org/demos/methylation/HG002_chr15_imprinted_hp2.modkit.bed.gz"
}
]
},
"displays": [
{
"type": "LinearMarkDisplay",
"displayId": "HG002_imprinted_5mC_smoothed-LinearMarkDisplay",
"rows": "source",
"legend": { "show": false },
"fetchSizeLimit": 5000000,
"encoding": {
"y": {
"scale": { "domainMin": 0, "domainMax": 100 },
"axis": { "title": "% 5mC" }
}
},
"marks": [
{
"mark": "point",
"encoding": {
"y": "score",
"color": { "value": "#bbbbbb" },
"size": 2
}
},
{
"mark": { "type": "line", "interpolate": "linear" },
"transform": [
{
"type": "window",
"groupby": ["source"],
"frame": [-50, 50],
"ops": [
{
"op": "mean",
"field": "score",
"weight": "n_valid_cov",
"as": "meth"
}
]
}
],
"encoding": {
"y": "meth",
"color": {
"field": "source",
"scale": {
"domain": ["HP1", "HP2"],
"range": ["#d62728", "#1f77b4"]
}
},
"strokeWidth": 2
}
}
]
}
]
}jbrowse add-track-json '{
"type": "MultiQuantitativeTrack",
"trackId": "HG002_imprinted_5mC_smoothed",
"name": "HG002 5mC by haplotype, moving average",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BedTabixAdapter",
"name": "HP1",
"color": "#d62728",
"uri": "https://jbrowse.org/demos/methylation/HG002_chr15_imprinted_hp1.modkit.bed.gz"
},
{
"type": "BedTabixAdapter",
"name": "HP2",
"color": "#1f77b4",
"uri": "https://jbrowse.org/demos/methylation/HG002_chr15_imprinted_hp2.modkit.bed.gz"
}
]
},
"displays": [
{
"type": "LinearMarkDisplay",
"displayId": "HG002_imprinted_5mC_smoothed-LinearMarkDisplay",
"rows": "source",
"legend": { "show": false },
"fetchSizeLimit": 5000000,
"encoding": {
"y": {
"scale": { "domainMin": 0, "domainMax": 100 },
"axis": { "title": "% 5mC" }
}
},
"marks": [
{
"mark": "point",
"encoding": {
"y": "score",
"color": { "value": "#bbbbbb" },
"size": 2
}
},
{
"mark": { "type": "line", "interpolate": "linear" },
"transform": [
{
"type": "window",
"groupby": ["source"],
"frame": [-50, 50],
"ops": [
{
"op": "mean",
"field": "score",
"weight": "n_valid_cov",
"as": "meth"
}
]
}
],
"encoding": {
"y": "meth",
"color": {
"field": "source",
"scale": {
"domain": ["HP1", "HP2"],
"range": ["#d62728", "#1f77b4"]
}
},
"strokeWidth": 2
}
}
]
}
]
}'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": "HG002_imprinted_5mC_smoothed",
"name": "HG002 5mC by haplotype, moving average",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BedTabixAdapter",
"name": "HP1",
"color": "#d62728",
"uri": "https://jbrowse.org/demos/methylation/HG002_chr15_imprinted_hp1.modkit.bed.gz"
},
{
"type": "BedTabixAdapter",
"name": "HP2",
"color": "#1f77b4",
"uri": "https://jbrowse.org/demos/methylation/HG002_chr15_imprinted_hp2.modkit.bed.gz"
}
]
},
"displays": [
{
"type": "LinearMarkDisplay",
"displayId": "HG002_imprinted_5mC_smoothed-LinearMarkDisplay",
"rows": "source",
"legend": { "show": false },
"fetchSizeLimit": 5000000,
"encoding": {
"y": {
"scale": { "domainMin": 0, "domainMax": 100 },
"axis": { "title": "% 5mC" }
}
},
"marks": [
{
"mark": "point",
"encoding": {
"y": "score",
"color": { "value": "#bbbbbb" },
"size": 2
}
},
{
"mark": { "type": "line", "interpolate": "linear" },
"transform": [
{
"type": "window",
"groupby": ["source"],
"frame": [-50, 50],
"ops": [
{
"op": "mean",
"field": "score",
"weight": "n_valid_cov",
"as": "meth"
}
]
}
],
"encoding": {
"y": "meth",
"color": {
"field": "source",
"scale": {
"domain": ["HP1", "HP2"],
"range": ["#d62728", "#1f77b4"]
}
},
"strokeWidth": 2
}
}
]
}
]
}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%22HG002_imprinted_5mC_smoothed%22%2C%22name%22%3A%22HG002+5mC+by+haplotype%2C+moving+average%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%22BedTabixAdapter%22%2C%22name%22%3A%22HP1%22%2C%22color%22%3A%22%23d62728%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Fmethylation%2FHG002_chr15_imprinted_hp1.modkit.bed.gz%22%7D%2C%7B%22type%22%3A%22BedTabixAdapter%22%2C%22name%22%3A%22HP2%22%2C%22color%22%3A%22%231f77b4%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fdemos%2Fmethylation%2FHG002_chr15_imprinted_hp2.modkit.bed.gz%22%7D%5D%7D%2C%22displays%22%3A%5B%7B%22type%22%3A%22LinearMarkDisplay%22%2C%22displayId%22%3A%22HG002_imprinted_5mC_smoothed-LinearMarkDisplay%22%2C%22rows%22%3A%22source%22%2C%22legend%22%3A%7B%22show%22%3Afalse%7D%2C%22fetchSizeLimit%22%3A5000000%2C%22encoding%22%3A%7B%22y%22%3A%7B%22scale%22%3A%7B%22domainMin%22%3A0%2C%22domainMax%22%3A100%7D%2C%22axis%22%3A%7B%22title%22%3A%22%25+5mC%22%7D%7D%7D%2C%22marks%22%3A%5B%7B%22mark%22%3A%22point%22%2C%22encoding%22%3A%7B%22y%22%3A%22score%22%2C%22color%22%3A%7B%22value%22%3A%22%23bbbbbb%22%7D%2C%22size%22%3A2%7D%7D%2C%7B%22mark%22%3A%7B%22type%22%3A%22line%22%2C%22interpolate%22%3A%22linear%22%7D%2C%22transform%22%3A%5B%7B%22type%22%3A%22window%22%2C%22groupby%22%3A%5B%22source%22%5D%2C%22frame%22%3A%5B-50%2C50%5D%2C%22ops%22%3A%5B%7B%22op%22%3A%22mean%22%2C%22field%22%3A%22score%22%2C%22weight%22%3A%22n_valid_cov%22%2C%22as%22%3A%22meth%22%7D%5D%7D%5D%2C%22encoding%22%3A%7B%22y%22%3A%22meth%22%2C%22color%22%3A%7B%22field%22%3A%22source%22%2C%22scale%22%3A%7B%22domain%22%3A%5B%22HP1%22%2C%22HP2%22%5D%2C%22range%22%3A%5B%22%23d62728%22%2C%22%231f77b4%22%5D%7D%7D%2C%22strokeWidth%22%3A2%7D%7D%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%22chr15%3A24%2C800%2C000-25%2C200%2C000%22%2C%22tracks%22%3A%5B%22HG002_imprinted_5mC_smoothed%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+HG002+5mC+by+haplotype%2C+moving+averageThe display draws two marks over the same rows:
- the
pointmark plots each CpG'sscore, its percent methylated, in grey - the
linemark plotsmeth, which thewindowstep writes: each CpG's mean over the 50 CpGs on either side, weighted byn_valid_cov, the read depth modkit counted there - with
groupby: ["source"]the step averages each haplotype over that haplotype's CpGs, and withrows: "source"the display gives each haplotype a row whose label names it, solegend.showis off - with
fetchSizeLimitraised, the track reads the whole slice when zoomed out
Type chr15:24,800,000-25,200,000 into the location box to see the SNRPN
promoter and the stretch of SNHG14 downstream of it:
Edit marks... in the track menu opens the marks. In the line's window
step, set rows before and rows after to 500 for a 1,001-CpG average,
then type chr15:22,200,000-26,900,000 to take in the whole imprinted domain:
See also
- Tutorial: Methylation (bisulfite)
- Tutorial: Phased trio analysis (1000 Genomes)
- Tutorial: Comparing one genome's two haplotypes (T2T-HG002)
- Tutorial: Inspecting phased reads (GIAB HG002)
- Tutorial: RNA-seq visualization
- User guide: Alignments track
- User guide: Alignments track
- User guide: Quantitative track
External links
- modkit documentation
- Methylation (long-read) in R, the same analysis written for ggjbrowse
Notes
-
To compare two samples, run
modkit dmron their per-sample pileups and load its BED output as aFeatureTrackbeside the bedMethyl tracks, so the differentially-methylated regions line up with the positions driving them. ↩
Feedback on this tutorial is welcome: contact us.