visualization-workflow
Comprehensive guide for visualizing ENCODE data including deeptools heatmaps, IGV screenshots, UCSC track hubs, and publication-quality plots. Use when users need to create visualizations of ChIP-seq signal, peak landscapes, genome browser views, or any visual representation of E
Install
npx skills add https://github.com/ammawla/encode-toolkit/tree/main/skills/visualization-workflow
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install ammawla-encode-toolkit@llmmart
git clone https://github.com/ammawla/encode-toolkit.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole ammawla/encode-toolkit collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Visualization Workflow for ENCODE Data
When to Use
- User wants to create genome browser visualizations, heatmaps, or signal track plots from ENCODE data
- User asks about "visualization", "genome browser", "deeptools", "heatmap", "signal track", or "IGV"
- User needs to generate publication-ready figures from ChIP-seq, ATAC-seq, or other genomic data
- User wants to compare signal profiles across conditions, tissues, or histone marks
- Example queries: "visualize H3K27ac signal at promoters", "create a heatmap of ChIP-seq signal", "set up a UCSC track hub for my data"
Help the user create informative, publication-quality visualizations of ENCODE genomic data. This skill covers four major visualization approaches: deepTools heatmaps and profiles, IGV genome browser views, UCSC track hubs for sharing, and publication-quality static plots using R and Python. Visualization is not decorative -- it is an essential analytical step that reveals patterns invisible in summary statistics and validates computational findings.
Literature Foundation
| Reference | Journal | Key Contribution | DOI | Citations |
|---|---|---|---|---|
| Ramirez et al. (2016) | Nucleic Acids Research | deepTools2: next-generation server for deep-sequencing data analysis; heatmaps, profiles, correlation, PCA | 10.1093/nar/gkw257 | ~3,800 |
| Robinson et al. (2011) | Nature Biotechnology | Integrative Genomics Viewer (IGV): interactive exploration of large genomic datasets | 10.1038/nbt.1754 | ~10,000 |
| Kent et al. (2002) | Genome Research | The Human Genome Browser at UCSC: foundation for track-based genomic visualization | 10.1101/gr.229102 | ~8,000 |
| Ramirez et al. (2014) | Nucleic Acids Research | deepTools: flexible platform for exploring deep-sequencing data; original computeMatrix/plotHeatmap framework | 10.1093/nar/gku365 | ~2,500 |
| Amemiya et al. (2019) | Scientific Reports | ENCODE Blacklist: comprehensive identification of artifact regions to exclude from visualization | 10.1038/s41598-019-45839-z | ~1,372 |
| Wickham (2016) | Springer | ggplot2: Elegant Graphics for Data Analysis; grammar of graphics for genomic visualization | ISBN: 978-3-319-24277-4 | ~30,000+ |
Part 1: deepTools Heatmaps and Profiles
deepTools (Ramirez et al. 2014, 2016) is the standard toolkit for visualizing ChIP-seq and ATAC-seq signal across genomic regions. The core workflow is: compute a signal matrix, then render it as a heatmap or profile plot.
1a. computeMatrix: Building the Signal Matrix
computeMatrix extracts signal values from bigWig files across a set of genomic regions. Two modes are available:
reference-point mode -- centers the signal on a single anchor point (e.g., TSS, peak summit):
# Signal centered on peak summits, +/- 3kb
computeMatrix reference-point \
-S H3K27ac_fc.bigWig H3K4me3_fc.bigWig ATAC_fc.bigWig \
-R peaks.bed \
--referencePoint center \
-b 3000 -a 3000 \
--binSize 50 \
--missingDataAsZero \
--sortRegions descend \
--sortUsing mean \
-o matrix_refpoint.gz \
-p 8
scale-regions mode -- scales all regions to uniform length (e.g., gene bodies):
# Signal across scaled gene bodies with 2kb flanks
computeMatrix scale-regions \
-S H3K36me3_fc.bigWig RNA_signal.bigWig \
-R genes.bed \
--regionBodyLength 5000 \
-b 2000 -a 2000 \
--binSize 50 \
--missingDataAsZero \
-o matrix_scaled.gz \
-p 8
When to use which mode:
reference-point: TF ChIP-seq peaks, ATAC-seq summits, TSSs, enhancer centers -- any feature defined by a pointscale-regions: gene bodies, broad histone domains (H3K27me3, H3K36me3), TADs -- features with variable length
1b. plotHeatmap: Rendering the Matrix
plotHeatmap -m matrix_refpoint.gz \
-o heatmap.png \
--colorMap RdYlBu_r \
--whatToShow "heatmap and colorbar" \
--sortRegions descend \
--sortUsing mean \
--heatmapHeight 15 \
--heatmapWidth 4 \
--zMin 0 --zMax 10 \
--samplesLabel "H3K27ac" "H3K4me3" "ATAC" \
--regionsLabel "Peaks" \
--dpi 300
Clustering: To reveal sub-patterns within peak sets:
plotHeatmap -m matrix_refpoint.gz \
-o heatmap_clustered.png \
--kmeans 4 \
--colorMap viridis \
--zMin 0 --zMax 10 \
--outFileSortedRegions clusters.bed \
--dpi 300
The --outFileSortedRegions flag exports the cluster assignments as a BED file, enabling downstream analysis of each cluster separately.
Recommended color maps by mark type:
| Mark Type | Recommended colorMap | Rationale |
|---|---|---|
| Active marks (H3K27ac, H3K4me3) | Reds, YlOrRd | Warm colors for activation |
| Repressive marks (H3K27me3, H3K9me3) | Blues, PuBu | Cool colors for repression |
| Accessibility (ATAC, DNase) | Greens, YlGn | Distinct from histone colors |
| Multi-mark comparison | viridis, inferno | Perceptually uniform, colorblind-safe |
1c. plotProfile: Average Signal Plots
Profile plots show the average signal across all regions, useful for comparing samples:
plotProfile -m matrix_refpoint.gz \
-o profile.png \
--perGroup \
--plotTitle "Signal at H3K27ac peaks" \
--yAxisLabel "Fold change over input" \
--samplesLabel "H3K27ac" "H3K4me3" "ATAC" \
--dpi 300
Use --perGroup when you have multiple region sets (e.g., active vs poised enhancers) and want separate profile lines for each group.
1d. Signal Correlation and PCA
Before making complex visualizations, verify that replicates correlate and conditions separate:
# Build correlation matrix
multiBigwigSummary bins \
-b sample1.bw sample2.bw sample3.bw sample4.bw \
--labels Rep1 Rep2 Rep3 Rep4 \
--binSize 10000 \
-o results.npz \
-p 8
# Correlation heatmap
plotCorrelation -in results.npz \
--corMethod pearson \
--whatToPlot heatmap \
--plotFile correlation.pdf \
--skipZeros
# PCA plot
plotPCA -in results.npz \
--plotFile pca.pdf \
--labels Rep1 Rep2 Rep3 Rep4
Part 2: IGV Visualization
The Integrative Genomics Viewer (Robinson et al. 2011) provides interactive, locus-level inspection of ENCODE data. IGV is essential for validating computational findings at individual loci.
2a. Loading ENCODE Files in IGV
ENCODE data can be loaded directly from URLs without downloading:
- Open IGV and select the correct genome (hg38 for GRCh38, mm10 for mouse)
- File > Load from URL > paste the ENCODE file download URL
- For bigWig files, IGV streams data on-the-fly (no full download needed)
Recommended file types for IGV:
| File Type | IGV Display | Best For |
|---|---|---|
| bigWig (fold change over control) | Continuous signal track | Viewing signal intensity |
| bigBed (IDR thresholded peaks) | Discrete interval track | Viewing peak locations |
| BAM (alignments) | Read pileup + coverage | Inspecting read-level evidence |
2b. Batch Screenshots with IGV
For systematic locus-level visualization across many genes, use IGV batch scripting:
new
genome hg38
load https://www.encodeproject.org/files/ENCFF.../@@download/ENCFF....bigWig
load https://www.encodeproject.org/files/ENCFF.../@@download/ENCFF....bigBed
snapshotDirectory /path/to/output/
goto chr11:2,159,779-2,161,209
snapshot INS_locus.png
goto chr7:44,182,955-44,184,393
snapshot GCK_locus.png
goto chr17:40,927,190-40,928,775
snapshot HNF1B_locus.png
Run with: igv.sh -b batch_script.txt
2c. IGV.js for Web-Based Viewing
For sharing interactive browser views without requiring local IGV installation:
<div id="igv-div"></div>
<script src="https://cdn.jsdelivr.net/npm/igv@2.15.0/dist/igv.min.js"></script>
<script>
var options = {
genome: "hg38",
locus: "chr11:2,159,779-2,161,209",
tracks: [
{
name: "H3K27ac Signal",
url: "https://www.encodeproject.org/files/ENCFF.../@@download/ENCFF....bigWig",
type: "wig",
color: "rgb(255,128,0)"
},
{
name: "ATAC Peaks",
url: "https://www.encodeproject.org/files/ENCFF.../@@download/ENCFF....bigBed",
type: "annotation",
color: "rgb(0,150,0)"
}
]
};
igv.createBrowser(document.getElementById("igv-div"), options);
</script>
Part 3: UCSC Track Hubs
UCSC Track Hubs (Kent et al. 2002) enable sharing of custom visualization configurations with collaborators and reviewers. A track hub is a set of text files that describe how to display your data in the UCSC Genome Browser.
3a. Hub File Structure
A track hub requires three files hosted on a public web server:
hub.txt # Hub metadata
genomes.txt # Which genomes are available
hg38/
trackDb.txt # Track definitions
*.bigWig # Signal files
*.bigBed # Peak files
hub.txt:
hub myEncodeHub
shortLabel My ENCODE Analysis
longLabel Integrative analysis of pancreatic islet chromatin
genomesFile genomes.txt
email user@institution.edu
genomes.txt:
genome hg38
trackDb hg38/trackDb.txt
3b. trackDb.txt: Track Definitions
A composite track hub for comparing multiple experiments:
track histoneComposite
compositeTrack on
shortLabel Histone Marks
longLabel Histone modification ChIP-seq from pancreatic islets
type bigWig
visibility full
autoScale off
viewLimits 0:15
maxHeightPixels 100:50:8
track H3K27ac_signal
parent histoneComposite
bigDataUrl H3K27ac_fc.bigWig
shortLabel H3K27ac
longLabel H3K27ac fold change over input - pancreatic islet
type bigWig
color 255,128,0
visibility full
track H3K4me3_signal
parent histoneComposite
bigDataUrl H3K4me3_fc.bigWig
shortLabel H3K4me3
longLabel H3K4me3 fold change over input - pancreatic islet
type bigWig
color 255,0,0
visibility full
track H3K27me3_signal
parent histoneComposite
bigDataUrl H3K27me3_fc.bigWig
shortLabel H3K27me3
longLabel H3K27me3 fold change over input - pancreatic islet
type bigWig
color 0,0,255
visibility full
track ATAC_signal
parent histoneComposite
bigDataUrl ATAC_fc.bigWig
shortLabel ATAC-seq
longLabel ATAC-seq signal - pancreatic islet
type bigWig
color 0,180,0
visibility full
track peaksComposite
compositeTrack on
shortLabel Peaks
longLabel Peak calls from ENCODE pipeline
type bigBed
visibility dense
track H3K27ac_peaks
parent peaksComposite
bigDataUrl H3K27ac_peaks.bigBed
shortLabel H3K27ac peaks
longLabel H3K27ac IDR thresholded peaks
type bigBed
color 255,128,0
visibility dense
track ATAC_peaks
parent peaksComposite
bigDataUrl ATAC_peaks.bigBed
shortLabel ATAC peaks
longLabel ATAC-seq IDR thresholded peaks
type bigBed
color 0,180,0
visibility dense
3c. Hosting and Loading
Host the hub directory on any HTTPS-accessible server (institutional web space, AWS S3, GitHub Pages, Cyverse). Then load in UCSC:
https://genome.ucsc.edu/cgi-bin/hgTracks?db=hg38&hubUrl=https://yourserver.edu/hub.txt
Recommended color scheme for chromatin marks:
| Mark | RGB Color | Hex |
|---|---|---|
| H3K4me3 | 255,0,0 | #FF0000 |
| H3K27ac | 255,128,0 | #FF8000 |
| H3K4me1 | 255,255,0 | #FFFF00 |
| H3K36me3 | 0,128,0 | #008000 |
| H3K27me3 | 0,0,255 | #0000FF |
| H3K9me3 | 128,128,128 | #808080 |
| ATAC/DNase | 0,180,0 | #00B400 |
| CTCF | 0,180,180 | #00B4B4 |
Part 4: Publication-Quality Plots
4a. R: ggplot2 + GenomicRanges
library(GenomicRanges)
library(ggplot2)
library(ChIPseeker)
# --- Genomic Feature Distribution ---
peaks <- readPeakFile("H3K27ac_peaks.narrowPeak")
txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene::TxDb.Hsapiens.UCSC.hg38.knownGene
peakAnno <- annotatePeak(peaks, TxDb = txdb, level = "gene")
plotAnnoBar(peakAnno) +
theme_minimal(base_size = 14) +
ggtitle("H3K27ac Peak Distribution") +
theme(plot.title = element_text(hjust = 0.5))
ggsave("peak_distribution.pdf", width = 8, height = 5)
# --- Distance to TSS ---
plotDistToTSS(peakAnno, title = "H3K27ac Distance to TSS") +
theme_minimal(base_size = 14)
ggsave("tss_distance.pdf", width = 8, height = 5)
# --- Peak Width Distribution ---
peak_df <- data.frame(width = width(peaks))
ggplot(peak_df, aes(x = width)) +
geom_histogram(bins = 100, fill = "#FF8000", alpha = 0.8) +
scale_x_log10() +
labs(x = "Peak Width (bp)", y = "Count", title = "H3K27ac Peak Width Distribution") +
theme_minimal(base_size = 14)
ggsave("peak_widths.pdf", width = 8, height = 5)
4b. Python: matplotlib and seaborn
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# --- Signal Heatmap from deepTools matrix ---
# Load the deepTools matrix (tab file)
# plotHeatmap --outFileNameMatrix matrix_values.tab exports the raw values
data = np.loadtxt("matrix_values.tab", skiprows=3)
fig, ax = plt.subplots(figsize=(6, 10))
sns.heatmap(
data,
cmap="YlOrRd",
vmin=0, vmax=10,
xticklabels=False,
yticklabels=False,
cbar_kws={"label": "Fold change over input"},
ax=ax
)
ax.set_xlabel("Position relative to center")
ax.set_ylabel("Peaks (sorted by signal)")
ax.set_title("H3K27ac Signal at ATAC Peaks")
plt.tight_layout()
plt.savefig("signal_heatmap.pdf", dpi=300)
# --- Multi-Sample Correlation Matrix ---
# Use Pearson correlation values from deepTools plotCorrelation --outFileCorMatrix
corr_matrix = np.loadtxt("correlation_matrix.tab", skiprows=1, usecols=range(1,5))
labels = ["Islet_R1", "Islet_R2", "Liver_R1", "Liver_R2"]
fig, ax = plt.subplots(figsize=(7, 6))
sns.heatmap(
corr_matrix,
annot=True, fmt=".3f",
xticklabels=labels, yticklabels=labels,
cmap="RdYlBu_r",
vmin=0.5, vmax=1.0,
square=True,
ax=ax
)
ax.set_title("Pearson Correlation of H3K27ac Signal")
plt.tight_layout()
plt.savefig("correlation_matrix.pdf", dpi=300)
4c. Recommended Visualization Settings for Publications
| Element | Recommendation |
|---|---|
| Resolution | 300 DPI minimum for print; 150 DPI for screen |
| Format | PDF or SVG for vector; PNG for raster (avoid JPEG for genomic data) |
| Font | Arial or Helvetica, 8-12pt for labels |
| Color | Use colorblind-safe palettes (viridis, cividis); avoid red-green only |
| Scale bars | Always include genomic coordinate axis |
| Normalization label | State normalization method on y-axis (e.g., "Fold change over input") |
| Panel labels | Use (A), (B), (C) for multi-panel figures |
Full Workflow
The recommended end-to-end visualization workflow for ENCODE data:
Step 1: Download signal and peak files
encode_search_experiments(assay_title="Histone ChIP-seq", organ="pancreas")
encode_list_files(experiment_accession="ENCSR...", file_format="bigWig",
output_type="fold change over control", assembly="GRCh38")
encode_download_files(file_accessions=["ENCFF..."], download_dir="/data/")
Step 2: Quality check signal correlation
multiBigwigSummary + plotCorrelation + plotPCA
Step 3: Generate deepTools heatmaps
computeMatrix reference-point + plotHeatmap + plotProfile
Step 4: Create UCSC track hub for interactive sharing
Build hub.txt + genomes.txt + trackDb.txt
Host on public server and share URL
Step 5: Take IGV snapshots at key loci
IGV batch script for loci of interest
Step 6: Build publication figures
R/Python static plots with consistent styling
Common Pitfalls
bigWig normalization mismatch: ENCODE provides multiple bigWig types per experiment. "Fold change over control" is input-normalized and suitable for cross-experiment comparison. "Signal of unique reads" is raw coverage and NOT comparable across experiments with different sequencing depths. "Signal p-value" shows statistical significance. Always use the same bigWig type across all samples in a visualization. When setting manual y-axis limits, verify the normalization matches.
Color scale saturation: Auto-scaling (
autoScale onin UCSC, or default in deepTools) sets the color range to each track's individual min/max. This hides differences between samples -- a weak signal track will look identical to a strong signal track. Always set manual min/max values (--zMin 0 --zMax 10in deepTools,viewLimits 0:15in UCSC) that are consistent across all tracks being compared. Determine appropriate limits by inspecting the signal distribution first.Region selection quality: Heatmaps and profiles are only as good as the regions used. If you compute a heatmap at all 200,000 MACS2 peaks, many will be noise. Filter peaks by IDR threshold, signal value, or overlap with other marks before visualization. For TF ChIP-seq, use IDR thresholded peaks. For comparison heatmaps, use a consensus peak set filtered by quality.
Resolution mismatch: bigWig files have a fixed bin size determined during generation. If the bigWig has 25bp bins but you set
computeMatrix --binSize 10, deepTools interpolates rather than gaining resolution. Conversely, using--binSize 1000at a narrow locus produces a blocky visualization. Match your visualization bin size to the data resolution and the genomic scale being shown. For most ENCODE bigWigs (10-25bp bins),--binSize 50is a good default.Missing input control track: Signal tracks without input normalization can show artifacts at high-copy regions, heterochromatic zones, and assembly gaps. Always include the input or IgG control as a reference track in genome browser views. For deepTools heatmaps, use "fold change over control" bigWigs which already have the input subtracted. When building track hubs, include the input track alongside the ChIP signal so reviewers can assess background.
Presenting Results
When showing visualization commands and outputs to the user:
- Show the full command with all parameters, not just the tool name
- Explain the output files: list file names, formats, and what each shows
- Suggest follow-up analyses: if the heatmap reveals clusters, suggest differential analysis of each cluster; if IGV shows unexpected signal, suggest quality-checking the experiment
- Provide figure legends: draft publication-ready figure legends describing what is shown, what normalization was used, and what the color scale represents
Walkthrough: Creating a Multi-Mark Signal Heatmap for Liver Enhancers
Goal: Visualize H3K27ac, H3K4me1, and ATAC-seq signal at liver enhancers using deeptools. Context: User has identified liver enhancer peaks and wants publication-ready heatmaps.
Step 1: Find signal tracks for three marks
encode_search_files(
assay_title="Histone ChIP-seq",
organ="liver",
target="H3K27ac",
file_format="bigWig",
output_type="fold change over control",
assembly="GRCh38"
)
Expected output:
{
"results": [
{"accession": "ENCFF234ACE", "file_format": "bigWig", "output_type": "fold change over control", "assembly": "GRCh38", "file_size": 149422080, "file_size_human": "142.5 MB", "experiment_accession": "ENCSR133RZO"}
],
"total": 6,
"limit": 25,
"offset": 0,
"has_more": false,
"next_offset": null
}
Step 2: Download bigWig files for visualization
encode_download_files(
file_accessions=["ENCFF234ACE", "ENCFF567ME1", "ENCFF890ATQ"],
download_dir="/data/viz/liver_enhancers"
)
Step 3: Generate heatmap with deeptools
Run computeMatrix and plotHeatmap (see bioinformatics-installer skill for deeptools installation):
computeMatrix reference-point -S H3K27ac.bw H3K4me1.bw ATAC.bw -R enhancers.bedplotHeatmap -m matrix.gz -o liver_enhancer_heatmap.pdf
Interpretation: Active enhancers show H3K27ac + H3K4me1 flanking the ATAC-seq accessibility summit. Poised enhancers show H3K4me1 without H3K27ac.
Code Examples
1. Search for signal tracks to visualize
encode_search_files(
organ="brain",
assay_title="ATAC-seq",
file_format="bigWig",
output_type="fold change over control",
assembly="GRCh38"
)
Expected output:
{
"results": [
{"accession": "ENCFF111BRN", "file_format": "bigWig", "output_type": "fold change over control", "assembly": "GRCh38", "file_size": 103488716, "file_size_human": "98.7 MB", "experiment_accession": "ENCSR800BRN"}
],
"total": 12,
"limit": 25,
"offset": 0,
"has_more": false,
"next_offset": null
}
Integration
| This skill produces... | Feed into... | Using tool/skill |
|---|---|---|
| Heatmap figures (PDF/PNG) | Figure legends | scientific-writing skill |
| Track hub configuration files | UCSC Genome Browser display | ucsc-browser skill |
| Signal matrices (deeptools) | Clustering analysis | integrative-analysis skill |
| Genome browser screenshots | Publication figures | scientific-writing -> figure legends |
| Peak-centered signal profiles | Motif enrichment context | motif-analysis skill |
Related Skills
- histone-aggregation -- Merge histone ChIP-seq peaks across experiments before visualization; provides the peak sets for heatmaps
- accessibility-aggregation -- Merge ATAC-seq/DNase-seq peaks across experiments; provides accessible regions for signal visualization
- epigenome-profiling -- Build comprehensive epigenomic profiles that feed into multi-mark heatmaps and track hubs
- quality-assessment -- Verify experiment quality before investing time in visualization; poor quality data produces misleading heatmaps
- download-encode -- Retrieve the bigWig and BED files needed as input for all visualization approaches
- publication-trust -- Verify literature claims backing analytical decisions
For the request: "$ARGUMENTS"
Files (encode-toolkit)
-
references
-
literature.md 12.2 KB
# Visualization Workflow — Literature References **Last updated:** 2026-03-07 **Purpose:** Reference catalog for the visualization-workflow skill — key papers on genome browsers, track visualization tools, heatmap and signal profile generation, 3D genome visualization, normalization methods, and annotation retrieval systems for creating publication-quality figures from ENCODE data. The visualization-workflow skill guides users through visualizing ENCODE data at multiple scales: individual loci (genome browsers), genome-wide patterns (heatmaps, metaplots), 3D chromatin architecture (contact maps), and comparative displays (multi-sample overlays). Effective visualization requires appropriate normalization, color scales, and annotation layers. These 8 papers cover four aspects of genomic visualization: (1) genome browsers for locus-level exploration, (2) signal processing tools for genome-wide heatmaps and profiles, (3) 3D genome visualization, and (4) normalization and annotation retrieval for accurate cross-sample displays. --- ## Genome Browsers Genome browsers are the primary tools for locus-level visualization of ENCODE data. They display multiple data types as horizontal tracks aligned to genomic coordinates, enabling visual integration of ChIP-seq signal, accessibility peaks, gene models, and conservation scores at specific regulatory regions. The UCSC Genome Browser is web-based (data rendered server-side), while IGV is a desktop application (data rendered locally). --- ### Kent et al. 2002 — UCSC Genome Browser: foundational genomic visualization - **Citation:** Kent WJ, Sugnet CW, Furey TS, Roskin KM, Pringle TH, Zahler AM, Haussler D. The human genome browser at UCSC. *Genome Research*, 12(6), 996-1006, 2002. - **DOI:** [10.1101/gr.229102](https://doi.org/10.1101/gr.229102) - **PMID:** 12045153 | **PMC:** PMC186604 - **Citations:** ~5,000 - **Key findings:** Introduced the UCSC Genome Browser, establishing the multi-track paradigm for genomic data visualization with synchronized coordinate systems. The browser displays diverse data types (gene models, conservation, repeats, regulatory annotations, custom user data) as horizontal tracks aligned to genomic coordinates. ENCODE data is directly available as public track hubs with pre-configured display settings for signal tracks (bigWig), peak calls (BED/bigBed), and interaction data (interact format). The visualization-workflow skill uses UCSC as the primary locus-level visualization tool and can generate track hub configurations (hub.txt, genomes.txt, trackDb.txt) for custom ENCODE data displays. UCSC also hosts the ENCODE cCRE tracks and regulation tracks that overlay element annotations on any genomic region. --- ### Robinson et al. 2011 — IGV: interactive local genomic data exploration - **Citation:** Robinson JT, Thorvaldsdottir H, Winckler W, Guttman M, Lander ES, Getz G, Mesirov JP. Integrative genomics viewer. *Nature Biotechnology*, 29(1), 24-26, 2011. - **DOI:** [10.1038/nbt.1754](https://doi.org/10.1038/nbt.1754) - **PMID:** 21221095 | **PMC:** PMC3346182 - **Citations:** ~10,000 - **Key findings:** Introduced IGV, a high-performance desktop application for interactive exploration of large genomic datasets. IGV renders data locally, enabling rapid navigation through BAM alignments, VCF variants, BED peaks, and bigWig signal tracks without uploading to a remote server. This is critical for unpublished or in-progress analyses. Key features: - Split-panel views for multi-sample comparison - Read-level visualization for inspecting individual alignments - Sashimi plots for splice junction visualization in RNA-seq - Session files (XML) for reproducible visualization configurations The visualization-workflow skill recommends IGV for exploratory analysis of downloaded ENCODE files, particularly for inspecting read-level evidence at specific loci. --- ### Thorvaldsdottir et al. 2013 — IGV best practices for publication-quality figures - **Citation:** Thorvaldsdottir H, Robinson JT, Mesirov JP. Integrative Genomics Viewer (IGV): high-performance genomics data visualization and exploration. *Briefings in Bioinformatics*, 14(2), 178-192, 2013. - **DOI:** [10.1093/bib/bbs017](https://doi.org/10.1093/bib/bbs017) - **PMID:** 22517427 | **PMC:** PMC3603213 - **Citations:** ~2,000 - **Key findings:** Comprehensive guidance on IGV for publication figures: - Track height optimization (taller for signal, shorter for peaks) - Color scheme selection (blue for ChIP, green for accessibility, red for expression) - Consistent y-axis scales when comparing samples - Input/control tracks alongside ChIP-seq signal - Gene model annotations for genomic context - Batch screenshot generation via IGV command-line for multi-locus panels The paper also describes IGV session files for reproducible views and the IGV batch script interface for automated figure generation across hundreds of loci. The visualization-workflow skill encodes these best practices into its figure generation recommendations. --- ## Signal Processing and Heatmap Visualization Genome-wide visualization requires transforming raw sequencing data into interpretable signal profiles, heatmaps, and metaplots. deepTools is the standard toolkit for these transformations, providing normalization, matrix computation, and publication-ready plotting. --- ### Ramirez et al. 2016 — deepTools: genome-wide signal visualization - **Citation:** Ramirez F, Ryan DP, Gruning B, Bhatt V, Kilpert F, Richter AS, Heyne S, Dundar F, Manke T. deepTools2: a next generation web server for deep-sequencing data analysis. *Nucleic Acids Research*, 44(W1), W160-W165, 2016. - **DOI:** [10.1093/nar/gkw257](https://doi.org/10.1093/nar/gkw257) - **PMID:** 27079975 | **PMC:** PMC4987876 - **Citations:** ~3,800 - **Key findings:** deepTools provides the standard toolkit for genome-wide signal visualization: - **computeMatrix**: Extract signal around genomic features (TSS, peaks, gene bodies) - **plotHeatmap**: Clustered heatmaps of signal at thousands of sites - **plotProfile**: Average signal metaplots (e.g., H3K27ac at enhancers) - **bamCoverage**: Generate normalized bigWig from BAM files - **bamCompare**: Log2 ratio of ChIP vs. input signal - **plotCorrelation**: Sample similarity matrices Supports normalization methods: RPKM, CPM, BPM, RPGC (reads per genomic content). The visualization-workflow skill recommends deepTools as the primary tool for genome-wide patterns — heatmaps of histone marks at enhancers, metaplots of accessibility at TSS, and ChIP/input ratio tracks for signal-to-noise assessment. --- ## 3D Genome Visualization Hi-C contact maps require specialized visualization tools that handle the two-dimensional matrix format and provide synchronized views of linear tracks alongside contact frequency data. --- ### Kerpedjiev et al. 2018 — HiGlass: interactive Hi-C contact maps - **Citation:** Kerpedjiev P, Abdennur N, Lekschas F, McCallum C, Dinkla K, Strobelt H, Luber JM, Ouellette SB, Azhir A, Kumar N, Hwang J, Lee S, Alber BH, Pfister H, Mirny LA, Park PJ, Gehlenborg N. HiGlass: web-based visual exploration and analysis of genome interaction maps. *Genome Biology*, 19(1), 125, 2018. - **DOI:** [10.1186/s13059-018-1486-1](https://doi.org/10.1186/s13059-018-1486-1) - **PMID:** 30143029 | **PMC:** PMC6109259 - **Citations:** ~600 - **Key findings:** HiGlass provides interactive, multi-resolution Hi-C visualization with: - Synchronized 1D track views alongside 2D contact matrices - Multi-resolution tiling for smooth zoom (chromosome to kilobase) - Side-by-side contact map comparison between biosamples - CTCF/cohesin ChIP-seq track overlay to annotate loop anchors - Integration with 4D Nucleome and ENCODE Hi-C data The visualization-workflow skill recommends HiGlass for Hi-C visualization, particularly when linking 3D contacts to 1D ENCODE annotations (ChIP-seq peaks at loop anchors, accessibility at TAD boundaries, expression at loop-connected promoters). --- ## Heatmap and Statistical Visualization For multi-dimensional ENCODE data displays that go beyond genome browser views, ComplexHeatmap provides the flexibility to create publication-ready multi-panel figures with synchronized annotations, clustering, and color scales. --- ### Gu et al. 2016 — ComplexHeatmap: multi-panel publication figures - **Citation:** Gu Z, Eils R, Schlesner M. Complex heatmaps reveal patterns and correlations in multidimensional genomic data. *Bioinformatics*, 32(18), 2847-2849, 2016. - **DOI:** [10.1093/bioinformatics/btw313](https://doi.org/10.1093/bioinformatics/btw313) - **PMID:** 27207943 - **Citations:** ~3,500 - **Key findings:** ComplexHeatmap (R/Bioconductor) creates customizable multi-panel heatmaps with synchronized annotations, dendrograms, and color scales. For ENCODE visualization: - Multi-mark views: rows = regions, columns = histone marks, color = signal intensity - Cross-biosample panels: rows = cCREs, columns = biosamples, color = activity state - Correlation matrices between experiments - ChromHMM state annotations alongside quantitative signal The visualization-workflow skill recommends ComplexHeatmap for all multi-dimensional ENCODE displays requiring statistical annotation and hierarchical clustering. --- ## Normalization for Cross-Sample Visualization Visualizing multiple ENCODE experiments on the same scale requires appropriate normalization. Naive normalization (RPKM, CPM) can produce biased comparisons when the underlying signal distributions differ between samples. --- ### Robinson & Oshlack 2010 — TMM normalization for accurate cross-sample display - **Citation:** Robinson MD, Oshlack A. A scaling normalization method for differential expression analysis of RNA-seq data. *Genome Biology*, 11(3), R25, 2010. - **DOI:** [10.1186/gb-2010-11-3-r25](https://doi.org/10.1186/gb-2010-11-3-r25) - **PMID:** 20196867 | **PMC:** PMC2864565 - **Citations:** ~8,000 - **Key findings:** Introduced TMM (Trimmed Mean of M-values) normalization, demonstrating that naive read-count normalization produces biased cross-sample comparisons when underlying distributions differ (composition bias). TMM computes normalization factors from trimmed mean of log-fold-changes. While developed for RNA-seq, TMM-style normalization is equally critical for ChIP-seq and ATAC-seq cross-sample comparison — if one sample has globally stronger signal, CPM normalization underestimates differences at individual peaks. The visualization-workflow skill warns users about normalization artifacts and recommends: - TMM for expression data (RNA-seq, gene quantifications) - RPGC for ChIP-seq signal track comparison (normalizes by genome content) - Spike-in normalization for comparing ChIP-seq between conditions - Quantile normalization only within matched sample groups --- ## Annotation Retrieval for Visualization Genomic visualizations require annotation layers — gene names, functional categories, ontology terms — that provide biological context for the underlying signal data. biomaRt enables programmatic retrieval of these annotations. --- ### Durinck et al. 2009 — biomaRt: programmatic annotation for visualizations - **Citation:** Durinck S, Spellman PT, Birney E, Huber W. Mapping identifiers for the integration of genomic datasets with the R/Bioconductor package biomaRt. *Nature Protocols*, 4(8), 1184-1191, 2009. - **DOI:** [10.1038/nprot.2009.97](https://doi.org/10.1038/nprot.2009.97) - **PMID:** 19617889 | **PMC:** PMC3159387 - **Citations:** ~2,500 - **Key findings:** biomaRt provides an R interface to BioMart databases (Ensembl, UCSC, Wormbase), enabling programmatic retrieval of: - Gene identifier conversion (Ensembl ID, symbol, Entrez) - TSS coordinates for metaplot anchor points - GO annotations for functional grouping in heatmaps - Cross-species orthologs for comparative visualization - Chromosome band annotations for karyotype views The visualization-workflow skill uses biomaRt for automated annotation retrieval when building visualizations — labeling peaks with gene names, grouping regions by functional category, and annotating heatmap rows with genomic metadata. biomaRt connects to Ensembl's REST API, enabling annotation without local database installation. ---
-
-
SKILL.md 22 KB
--- name: visualization-workflow description: "Comprehensive guide for visualizing ENCODE data including deeptools heatmaps, IGV screenshots, UCSC track hubs, and publication-quality plots. Use when users need to create visualizations of ChIP-seq signal, peak landscapes, genome browser views, or any visual representation of ENCODE data. Trigger on: heatmap, visualization, genome browser, track hub, IGV, deeptools, signal plot, peak visualization, profile plot, publication figure, bigWig visualization." --- # Visualization Workflow for ENCODE Data ## When to Use - User wants to create genome browser visualizations, heatmaps, or signal track plots from ENCODE data - User asks about "visualization", "genome browser", "deeptools", "heatmap", "signal track", or "IGV" - User needs to generate publication-ready figures from ChIP-seq, ATAC-seq, or other genomic data - User wants to compare signal profiles across conditions, tissues, or histone marks - Example queries: "visualize H3K27ac signal at promoters", "create a heatmap of ChIP-seq signal", "set up a UCSC track hub for my data" Help the user create informative, publication-quality visualizations of ENCODE genomic data. This skill covers four major visualization approaches: deepTools heatmaps and profiles, IGV genome browser views, UCSC track hubs for sharing, and publication-quality static plots using R and Python. Visualization is not decorative -- it is an essential analytical step that reveals patterns invisible in summary statistics and validates computational findings. ## Literature Foundation | Reference | Journal | Key Contribution | DOI | Citations | |-----------|---------|-----------------|-----|-----------| | Ramirez et al. (2016) | Nucleic Acids Research | deepTools2: next-generation server for deep-sequencing data analysis; heatmaps, profiles, correlation, PCA | [10.1093/nar/gkw257](https://doi.org/10.1093/nar/gkw257) | ~3,800 | | Robinson et al. (2011) | Nature Biotechnology | Integrative Genomics Viewer (IGV): interactive exploration of large genomic datasets | [10.1038/nbt.1754](https://doi.org/10.1038/nbt.1754) | ~10,000 | | Kent et al. (2002) | Genome Research | The Human Genome Browser at UCSC: foundation for track-based genomic visualization | [10.1101/gr.229102](https://doi.org/10.1101/gr.229102) | ~8,000 | | Ramirez et al. (2014) | Nucleic Acids Research | deepTools: flexible platform for exploring deep-sequencing data; original computeMatrix/plotHeatmap framework | [10.1093/nar/gku365](https://doi.org/10.1093/nar/gku365) | ~2,500 | | Amemiya et al. (2019) | Scientific Reports | ENCODE Blacklist: comprehensive identification of artifact regions to exclude from visualization | [10.1038/s41598-019-45839-z](https://doi.org/10.1038/s41598-019-45839-z) | ~1,372 | | Wickham (2016) | Springer | ggplot2: Elegant Graphics for Data Analysis; grammar of graphics for genomic visualization | ISBN: 978-3-319-24277-4 | ~30,000+ | ## Part 1: deepTools Heatmaps and Profiles deepTools (Ramirez et al. 2014, 2016) is the standard toolkit for visualizing ChIP-seq and ATAC-seq signal across genomic regions. The core workflow is: compute a signal matrix, then render it as a heatmap or profile plot. ### 1a. computeMatrix: Building the Signal Matrix `computeMatrix` extracts signal values from bigWig files across a set of genomic regions. Two modes are available: **reference-point mode** -- centers the signal on a single anchor point (e.g., TSS, peak summit): ```bash # Signal centered on peak summits, +/- 3kb computeMatrix reference-point \ -S H3K27ac_fc.bigWig H3K4me3_fc.bigWig ATAC_fc.bigWig \ -R peaks.bed \ --referencePoint center \ -b 3000 -a 3000 \ --binSize 50 \ --missingDataAsZero \ --sortRegions descend \ --sortUsing mean \ -o matrix_refpoint.gz \ -p 8 ``` **scale-regions mode** -- scales all regions to uniform length (e.g., gene bodies): ```bash # Signal across scaled gene bodies with 2kb flanks computeMatrix scale-regions \ -S H3K36me3_fc.bigWig RNA_signal.bigWig \ -R genes.bed \ --regionBodyLength 5000 \ -b 2000 -a 2000 \ --binSize 50 \ --missingDataAsZero \ -o matrix_scaled.gz \ -p 8 ``` **When to use which mode**: - `reference-point`: TF ChIP-seq peaks, ATAC-seq summits, TSSs, enhancer centers -- any feature defined by a point - `scale-regions`: gene bodies, broad histone domains (H3K27me3, H3K36me3), TADs -- features with variable length ### 1b. plotHeatmap: Rendering the Matrix ```bash plotHeatmap -m matrix_refpoint.gz \ -o heatmap.png \ --colorMap RdYlBu_r \ --whatToShow "heatmap and colorbar" \ --sortRegions descend \ --sortUsing mean \ --heatmapHeight 15 \ --heatmapWidth 4 \ --zMin 0 --zMax 10 \ --samplesLabel "H3K27ac" "H3K4me3" "ATAC" \ --regionsLabel "Peaks" \ --dpi 300 ``` **Clustering**: To reveal sub-patterns within peak sets: ```bash plotHeatmap -m matrix_refpoint.gz \ -o heatmap_clustered.png \ --kmeans 4 \ --colorMap viridis \ --zMin 0 --zMax 10 \ --outFileSortedRegions clusters.bed \ --dpi 300 ``` The `--outFileSortedRegions` flag exports the cluster assignments as a BED file, enabling downstream analysis of each cluster separately. **Recommended color maps by mark type**: | Mark Type | Recommended colorMap | Rationale | |-----------|---------------------|-----------| | Active marks (H3K27ac, H3K4me3) | Reds, YlOrRd | Warm colors for activation | | Repressive marks (H3K27me3, H3K9me3) | Blues, PuBu | Cool colors for repression | | Accessibility (ATAC, DNase) | Greens, YlGn | Distinct from histone colors | | Multi-mark comparison | viridis, inferno | Perceptually uniform, colorblind-safe | ### 1c. plotProfile: Average Signal Plots Profile plots show the average signal across all regions, useful for comparing samples: ```bash plotProfile -m matrix_refpoint.gz \ -o profile.png \ --perGroup \ --plotTitle "Signal at H3K27ac peaks" \ --yAxisLabel "Fold change over input" \ --samplesLabel "H3K27ac" "H3K4me3" "ATAC" \ --dpi 300 ``` Use `--perGroup` when you have multiple region sets (e.g., active vs poised enhancers) and want separate profile lines for each group. ### 1d. Signal Correlation and PCA Before making complex visualizations, verify that replicates correlate and conditions separate: ```bash # Build correlation matrix multiBigwigSummary bins \ -b sample1.bw sample2.bw sample3.bw sample4.bw \ --labels Rep1 Rep2 Rep3 Rep4 \ --binSize 10000 \ -o results.npz \ -p 8 # Correlation heatmap plotCorrelation -in results.npz \ --corMethod pearson \ --whatToPlot heatmap \ --plotFile correlation.pdf \ --skipZeros # PCA plot plotPCA -in results.npz \ --plotFile pca.pdf \ --labels Rep1 Rep2 Rep3 Rep4 ``` ## Part 2: IGV Visualization The Integrative Genomics Viewer (Robinson et al. 2011) provides interactive, locus-level inspection of ENCODE data. IGV is essential for validating computational findings at individual loci. ### 2a. Loading ENCODE Files in IGV ENCODE data can be loaded directly from URLs without downloading: 1. Open IGV and select the correct genome (hg38 for GRCh38, mm10 for mouse) 2. File > Load from URL > paste the ENCODE file download URL 3. For bigWig files, IGV streams data on-the-fly (no full download needed) **Recommended file types for IGV**: | File Type | IGV Display | Best For | |-----------|------------|----------| | bigWig (fold change over control) | Continuous signal track | Viewing signal intensity | | bigBed (IDR thresholded peaks) | Discrete interval track | Viewing peak locations | | BAM (alignments) | Read pileup + coverage | Inspecting read-level evidence | ### 2b. Batch Screenshots with IGV For systematic locus-level visualization across many genes, use IGV batch scripting: ``` new genome hg38 load https://www.encodeproject.org/files/ENCFF.../@@download/ENCFF....bigWig load https://www.encodeproject.org/files/ENCFF.../@@download/ENCFF....bigBed snapshotDirectory /path/to/output/ goto chr11:2,159,779-2,161,209 snapshot INS_locus.png goto chr7:44,182,955-44,184,393 snapshot GCK_locus.png goto chr17:40,927,190-40,928,775 snapshot HNF1B_locus.png ``` Run with: `igv.sh -b batch_script.txt` ### 2c. IGV.js for Web-Based Viewing For sharing interactive browser views without requiring local IGV installation: ```html <div id="igv-div"></div> <script src="https://cdn.jsdelivr.net/npm/igv@2.15.0/dist/igv.min.js"></script> <script> var options = { genome: "hg38", locus: "chr11:2,159,779-2,161,209", tracks: [ { name: "H3K27ac Signal", url: "https://www.encodeproject.org/files/ENCFF.../@@download/ENCFF....bigWig", type: "wig", color: "rgb(255,128,0)" }, { name: "ATAC Peaks", url: "https://www.encodeproject.org/files/ENCFF.../@@download/ENCFF....bigBed", type: "annotation", color: "rgb(0,150,0)" } ] }; igv.createBrowser(document.getElementById("igv-div"), options); </script> ``` ## Part 3: UCSC Track Hubs UCSC Track Hubs (Kent et al. 2002) enable sharing of custom visualization configurations with collaborators and reviewers. A track hub is a set of text files that describe how to display your data in the UCSC Genome Browser. ### 3a. Hub File Structure A track hub requires three files hosted on a public web server: ``` hub.txt # Hub metadata genomes.txt # Which genomes are available hg38/ trackDb.txt # Track definitions *.bigWig # Signal files *.bigBed # Peak files ``` **hub.txt**: ``` hub myEncodeHub shortLabel My ENCODE Analysis longLabel Integrative analysis of pancreatic islet chromatin genomesFile genomes.txt email user@institution.edu ``` **genomes.txt**: ``` genome hg38 trackDb hg38/trackDb.txt ``` ### 3b. trackDb.txt: Track Definitions A composite track hub for comparing multiple experiments: ``` track histoneComposite compositeTrack on shortLabel Histone Marks longLabel Histone modification ChIP-seq from pancreatic islets type bigWig visibility full autoScale off viewLimits 0:15 maxHeightPixels 100:50:8 track H3K27ac_signal parent histoneComposite bigDataUrl H3K27ac_fc.bigWig shortLabel H3K27ac longLabel H3K27ac fold change over input - pancreatic islet type bigWig color 255,128,0 visibility full track H3K4me3_signal parent histoneComposite bigDataUrl H3K4me3_fc.bigWig shortLabel H3K4me3 longLabel H3K4me3 fold change over input - pancreatic islet type bigWig color 255,0,0 visibility full track H3K27me3_signal parent histoneComposite bigDataUrl H3K27me3_fc.bigWig shortLabel H3K27me3 longLabel H3K27me3 fold change over input - pancreatic islet type bigWig color 0,0,255 visibility full track ATAC_signal parent histoneComposite bigDataUrl ATAC_fc.bigWig shortLabel ATAC-seq longLabel ATAC-seq signal - pancreatic islet type bigWig color 0,180,0 visibility full track peaksComposite compositeTrack on shortLabel Peaks longLabel Peak calls from ENCODE pipeline type bigBed visibility dense track H3K27ac_peaks parent peaksComposite bigDataUrl H3K27ac_peaks.bigBed shortLabel H3K27ac peaks longLabel H3K27ac IDR thresholded peaks type bigBed color 255,128,0 visibility dense track ATAC_peaks parent peaksComposite bigDataUrl ATAC_peaks.bigBed shortLabel ATAC peaks longLabel ATAC-seq IDR thresholded peaks type bigBed color 0,180,0 visibility dense ``` ### 3c. Hosting and Loading Host the hub directory on any HTTPS-accessible server (institutional web space, AWS S3, GitHub Pages, Cyverse). Then load in UCSC: ``` https://genome.ucsc.edu/cgi-bin/hgTracks?db=hg38&hubUrl=https://yourserver.edu/hub.txt ``` **Recommended color scheme for chromatin marks**: | Mark | RGB Color | Hex | |------|-----------|-----| | H3K4me3 | 255,0,0 | #FF0000 | | H3K27ac | 255,128,0 | #FF8000 | | H3K4me1 | 255,255,0 | #FFFF00 | | H3K36me3 | 0,128,0 | #008000 | | H3K27me3 | 0,0,255 | #0000FF | | H3K9me3 | 128,128,128 | #808080 | | ATAC/DNase | 0,180,0 | #00B400 | | CTCF | 0,180,180 | #00B4B4 | ## Part 4: Publication-Quality Plots ### 4a. R: ggplot2 + GenomicRanges ```r library(GenomicRanges) library(ggplot2) library(ChIPseeker) # --- Genomic Feature Distribution --- peaks <- readPeakFile("H3K27ac_peaks.narrowPeak") txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene::TxDb.Hsapiens.UCSC.hg38.knownGene peakAnno <- annotatePeak(peaks, TxDb = txdb, level = "gene") plotAnnoBar(peakAnno) + theme_minimal(base_size = 14) + ggtitle("H3K27ac Peak Distribution") + theme(plot.title = element_text(hjust = 0.5)) ggsave("peak_distribution.pdf", width = 8, height = 5) # --- Distance to TSS --- plotDistToTSS(peakAnno, title = "H3K27ac Distance to TSS") + theme_minimal(base_size = 14) ggsave("tss_distance.pdf", width = 8, height = 5) # --- Peak Width Distribution --- peak_df <- data.frame(width = width(peaks)) ggplot(peak_df, aes(x = width)) + geom_histogram(bins = 100, fill = "#FF8000", alpha = 0.8) + scale_x_log10() + labs(x = "Peak Width (bp)", y = "Count", title = "H3K27ac Peak Width Distribution") + theme_minimal(base_size = 14) ggsave("peak_widths.pdf", width = 8, height = 5) ``` ### 4b. Python: matplotlib and seaborn ```python import numpy as np import matplotlib.pyplot as plt import seaborn as sns # --- Signal Heatmap from deepTools matrix --- # Load the deepTools matrix (tab file) # plotHeatmap --outFileNameMatrix matrix_values.tab exports the raw values data = np.loadtxt("matrix_values.tab", skiprows=3) fig, ax = plt.subplots(figsize=(6, 10)) sns.heatmap( data, cmap="YlOrRd", vmin=0, vmax=10, xticklabels=False, yticklabels=False, cbar_kws={"label": "Fold change over input"}, ax=ax ) ax.set_xlabel("Position relative to center") ax.set_ylabel("Peaks (sorted by signal)") ax.set_title("H3K27ac Signal at ATAC Peaks") plt.tight_layout() plt.savefig("signal_heatmap.pdf", dpi=300) # --- Multi-Sample Correlation Matrix --- # Use Pearson correlation values from deepTools plotCorrelation --outFileCorMatrix corr_matrix = np.loadtxt("correlation_matrix.tab", skiprows=1, usecols=range(1,5)) labels = ["Islet_R1", "Islet_R2", "Liver_R1", "Liver_R2"] fig, ax = plt.subplots(figsize=(7, 6)) sns.heatmap( corr_matrix, annot=True, fmt=".3f", xticklabels=labels, yticklabels=labels, cmap="RdYlBu_r", vmin=0.5, vmax=1.0, square=True, ax=ax ) ax.set_title("Pearson Correlation of H3K27ac Signal") plt.tight_layout() plt.savefig("correlation_matrix.pdf", dpi=300) ``` ### 4c. Recommended Visualization Settings for Publications | Element | Recommendation | |---------|---------------| | Resolution | 300 DPI minimum for print; 150 DPI for screen | | Format | PDF or SVG for vector; PNG for raster (avoid JPEG for genomic data) | | Font | Arial or Helvetica, 8-12pt for labels | | Color | Use colorblind-safe palettes (viridis, cividis); avoid red-green only | | Scale bars | Always include genomic coordinate axis | | Normalization label | State normalization method on y-axis (e.g., "Fold change over input") | | Panel labels | Use (A), (B), (C) for multi-panel figures | ## Full Workflow The recommended end-to-end visualization workflow for ENCODE data: ``` Step 1: Download signal and peak files encode_search_experiments(assay_title="Histone ChIP-seq", organ="pancreas") encode_list_files(experiment_accession="ENCSR...", file_format="bigWig", output_type="fold change over control", assembly="GRCh38") encode_download_files(file_accessions=["ENCFF..."], download_dir="/data/") Step 2: Quality check signal correlation multiBigwigSummary + plotCorrelation + plotPCA Step 3: Generate deepTools heatmaps computeMatrix reference-point + plotHeatmap + plotProfile Step 4: Create UCSC track hub for interactive sharing Build hub.txt + genomes.txt + trackDb.txt Host on public server and share URL Step 5: Take IGV snapshots at key loci IGV batch script for loci of interest Step 6: Build publication figures R/Python static plots with consistent styling ``` ## Common Pitfalls 1. **bigWig normalization mismatch**: ENCODE provides multiple bigWig types per experiment. "Fold change over control" is input-normalized and suitable for cross-experiment comparison. "Signal of unique reads" is raw coverage and NOT comparable across experiments with different sequencing depths. "Signal p-value" shows statistical significance. Always use the same bigWig type across all samples in a visualization. When setting manual y-axis limits, verify the normalization matches. 2. **Color scale saturation**: Auto-scaling (`autoScale on` in UCSC, or default in deepTools) sets the color range to each track's individual min/max. This hides differences between samples -- a weak signal track will look identical to a strong signal track. Always set manual min/max values (`--zMin 0 --zMax 10` in deepTools, `viewLimits 0:15` in UCSC) that are consistent across all tracks being compared. Determine appropriate limits by inspecting the signal distribution first. 3. **Region selection quality**: Heatmaps and profiles are only as good as the regions used. If you compute a heatmap at all 200,000 MACS2 peaks, many will be noise. Filter peaks by IDR threshold, signal value, or overlap with other marks before visualization. For TF ChIP-seq, use IDR thresholded peaks. For comparison heatmaps, use a consensus peak set filtered by quality. 4. **Resolution mismatch**: bigWig files have a fixed bin size determined during generation. If the bigWig has 25bp bins but you set `computeMatrix --binSize 10`, deepTools interpolates rather than gaining resolution. Conversely, using `--binSize 1000` at a narrow locus produces a blocky visualization. Match your visualization bin size to the data resolution and the genomic scale being shown. For most ENCODE bigWigs (10-25bp bins), `--binSize 50` is a good default. 5. **Missing input control track**: Signal tracks without input normalization can show artifacts at high-copy regions, heterochromatic zones, and assembly gaps. Always include the input or IgG control as a reference track in genome browser views. For deepTools heatmaps, use "fold change over control" bigWigs which already have the input subtracted. When building track hubs, include the input track alongside the ChIP signal so reviewers can assess background. ## Presenting Results When showing visualization commands and outputs to the user: - **Show the full command** with all parameters, not just the tool name - **Explain the output files**: list file names, formats, and what each shows - **Suggest follow-up analyses**: if the heatmap reveals clusters, suggest differential analysis of each cluster; if IGV shows unexpected signal, suggest quality-checking the experiment - **Provide figure legends**: draft publication-ready figure legends describing what is shown, what normalization was used, and what the color scale represents ## Walkthrough: Creating a Multi-Mark Signal Heatmap for Liver Enhancers **Goal**: Visualize H3K27ac, H3K4me1, and ATAC-seq signal at liver enhancers using deeptools. **Context**: User has identified liver enhancer peaks and wants publication-ready heatmaps. ### Step 1: Find signal tracks for three marks ``` encode_search_files( assay_title="Histone ChIP-seq", organ="liver", target="H3K27ac", file_format="bigWig", output_type="fold change over control", assembly="GRCh38" ) ``` Expected output: ```json { "results": [ {"accession": "ENCFF234ACE", "file_format": "bigWig", "output_type": "fold change over control", "assembly": "GRCh38", "file_size": 149422080, "file_size_human": "142.5 MB", "experiment_accession": "ENCSR133RZO"} ], "total": 6, "limit": 25, "offset": 0, "has_more": false, "next_offset": null } ``` ### Step 2: Download bigWig files for visualization ``` encode_download_files( file_accessions=["ENCFF234ACE", "ENCFF567ME1", "ENCFF890ATQ"], download_dir="/data/viz/liver_enhancers" ) ``` ### Step 3: Generate heatmap with deeptools Run computeMatrix and plotHeatmap (see bioinformatics-installer skill for deeptools installation): - `computeMatrix reference-point -S H3K27ac.bw H3K4me1.bw ATAC.bw -R enhancers.bed` - `plotHeatmap -m matrix.gz -o liver_enhancer_heatmap.pdf` **Interpretation**: Active enhancers show H3K27ac + H3K4me1 flanking the ATAC-seq accessibility summit. Poised enhancers show H3K4me1 without H3K27ac. ## Code Examples ### 1. Search for signal tracks to visualize ``` encode_search_files( organ="brain", assay_title="ATAC-seq", file_format="bigWig", output_type="fold change over control", assembly="GRCh38" ) ``` Expected output: ```json { "results": [ {"accession": "ENCFF111BRN", "file_format": "bigWig", "output_type": "fold change over control", "assembly": "GRCh38", "file_size": 103488716, "file_size_human": "98.7 MB", "experiment_accession": "ENCSR800BRN"} ], "total": 12, "limit": 25, "offset": 0, "has_more": false, "next_offset": null } ``` ## Integration | This skill produces... | Feed into... | Using tool/skill | |---|---|---| | Heatmap figures (PDF/PNG) | Figure legends | scientific-writing skill | | Track hub configuration files | UCSC Genome Browser display | ucsc-browser skill | | Signal matrices (deeptools) | Clustering analysis | integrative-analysis skill | | Genome browser screenshots | Publication figures | scientific-writing -> figure legends | | Peak-centered signal profiles | Motif enrichment context | motif-analysis skill | ## Related Skills - **histone-aggregation** -- Merge histone ChIP-seq peaks across experiments before visualization; provides the peak sets for heatmaps - **accessibility-aggregation** -- Merge ATAC-seq/DNase-seq peaks across experiments; provides accessible regions for signal visualization - **epigenome-profiling** -- Build comprehensive epigenomic profiles that feed into multi-mark heatmaps and track hubs - **quality-assessment** -- Verify experiment quality before investing time in visualization; poor quality data produces misleading heatmaps - **download-encode** -- Retrieve the bigWig and BED files needed as input for all visualization approaches - **publication-trust** -- Verify literature claims backing analytical decisions ## For the request: "$ARGUMENTS"
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.