/bio-data-visualization-genome-tracks
<!--
$ npx -y skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-data-visualization-genome-tracks --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/bio-data-visualization-genome-tracks
Context preview
The summary Claude sees to decide when to auto-load this skill.
<!--
SKILL.md
bio-data-visualization-genome-tracks.SKILL.md<!--
COPYRIGHT NOTICE
This file is part of the "Universal Biomedical Skills" project.
Copyright (c) 2026 MD BABU MIA, PhD <md.babu.mia@mssm.edu>
All Rights Reserved.
#
This code is proprietary and confidential.
Unauthorized copying of this file, via any medium is strictly prohibited.
#
Provenance: Authenticated by MD BABU MIA
-->
--- name: bio-data-visualization-genome-tracks description: Create genome browser-style visualizations showing multiple data tracks (coverage, peaks, genes) using pyGenomeTracks, Gviz, and IGV. Use when visualizing genomic data at specific loci with multiple aligned tracks. tool_type: mixed primary_tool: pyGenomeTracks measurable_outcome: Execute skill workflow successfully with valid output within 15 minutes. allowed-tools:
- read_file
- run_shell_command
---
Genome Track Visualization
pyGenomeTracks (Python/CLI)
# Create tracks configuration file
cat > tracks.ini << 'EOF'
[bigwig]
file = coverage.bw
title = Coverage
height = 4
color = #4DBBD5
min_value = 0
[spacer]
height = 0.5
[peaks]
file = peaks.bed
title = Peaks
color = #E64B35
height = 2
labels = false
[spacer]
height = 0.5
[genes]
file = genes.gtf
title = Genes
height = 5
fontsize = 10
style = flybase
color = #3C5488
[x-axis]
EOF
# Generate plot
pyGenomeTracks --tracks tracks.ini --region chr1:1000000-2000000 \
--outFileName tracks.png --dpi 150pyGenomeTracks with Multiple Samples
[sample1 coverage]
file = sample1.bw
title = Sample 1
height = 3
color = #4DBBD5
min_value = 0
max_value = auto
[sample2 coverage]
file = sample2.bw
title = Sample 2
height = 3
color = #E64B35
min_value = 0
max_value = auto
[sample1 peaks]
file = sample1_peaks.narrowPeak
title = Sample 1 Peaks
color = #4DBBD5
height = 1
file_type = narrowPeak
[sample2 peaks]
file = sample2_peaks.narrowPeak
title = Sample 2 Peaks
color = #E64B35
height = 1
file_type = narrowPeak
pyGenomeTracks Programmatic
import pygenometracks.tracks as pygtk
tracks = pygtk.PlotTracks('tracks.ini', fig_width=40, dpi=150)
tracks.plot('output.png', 'chr1', 1000000, 2000000)Gviz (R)
library(Gviz)
library(GenomicRanges)
# Genome axis
gtrack <- GenomeAxisTrack()
# Ideogram
itrack <- IdeogramTrack(genome = 'hg38', chromosome = 'chr1')
# Gene model
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene
grtrack <- GeneRegionTrack(txdb, genome = 'hg38', chromosome = 'chr1',
name = 'Genes', transcriptAnnotation = 'symbol')
# Data track from BigWig
dtrack <- DataTrack(range = 'coverage.bw', genome = 'hg38', chromosome = 'chr1',
name = 'Coverage', type = 'histogram', col.histogram = '#4DBBD5')
# Annotation track from BED
atrack <- AnnotationTrack(range = 'peaks.bed', genome = 'hg38', chromosome = 'chr1',
name = 'Peaks', fill = '#E64B35')
# Plot tracks
plotTracks(list(itrack, gtrack, dtrack, atrack, grtrack),
from = 1000000, to = 2000000, sizes = c(1, 1, 3, 1, 3))Gviz with Multiple Samples
# Create overlay data track
dtrack1 <- DataTrack(range = 'sample1.bw', name = 'Sample1', col = '#4DBBD5')
dtrack2 <- DataTrack(range = 'sample2.bw', name = 'Sample2', col = '#E64B35')
overlay <- OverlayTrack(trackList = list(dtrack1, dtrack2))
plotTracks(list(gtrack, overlay, grtrack), from = 1000000, to = 2000000,
type = 'histogram', legend = TRUE)Gviz Customization
# Highlight regions
ht <- HighlightTrack(trackList = list(dtrack, atrack),
start = c(1200000, 1500000),
end = c(1300000, 1600000),
chromosome = 'chr1')
# Custom display parameters
displayPars(dtrack) <- list(
background.title = '#3C5488',
fontcolor.title = 'white',
col.axis = 'black',
ylim = c(0, 100)
)
plotTracks(list(gtrack, ht, grtrack), from = 1000000, to = 2000000)IGV.js (Web)
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/igv@3.0.0/dist/igv.min.js"></script>
</head>
<body>
<div id="igv-div"></div>
<script>
var options = {
genome: "hg38",
locus: "chr1:1,000,000-2,000,000",
tracks: [
{
name: "Coverage",
url: "coverage.bw",
type: "wig",
color: "#4DBBD5"
},
{
name: "Peaks",
url: "peaks.bed",
type: "annotation",
color: "#E64B35"
}
]
};
igv.createBrowser(document.getElementById('igv-div'), options);
</script>
</body>
</html>Create BigWig from BAM
# Using deepTools
bamCoverage -b sample.bam -o coverage.bw \
--binSize 10 --normalizeUsing RPKM --effectiveGenomeSize 2913022398
# Using bedtools + wigToBigWig
bedtools genomecov -bg -ibam sample.bam > coverage.bedGraph
sort -k1,1 -k2,2n coverage.bedGraph > coverage.sorted.bedGraph
bedGraphToBigWig coverage.sorted.bedGraph chrom.sizes coverage.bwMulti-Region Plot
# pyGenomeTracks with BED regions
pyGenomeTracks --tracks tracks.ini --BED regions.bed \
--outFileName multi_region.pdf --dpi 150# Gviz with multiple regions
regions <- GRanges(seqnames = 'chr1', ranges = IRanges(start = c(1e6, 2e6), end = c(1.5e6, 2.5e6)))
pdf('multi_region.pdf', width = 10, height = 8)
for (i in seq_along(regions)) {
plotTracks(track_list, from = start(regions[i]), to = end(regions[i]))
}
dev.off()Related Skills
- genome-intervals/bigwig-tracks - BigWig file handling
- chip-seq/chipseq-visualization - ChIP-specific tracks
- hi-c-analysis/hic-visualization - Hi-C contact maps
<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->
Read more
<!--
COPYRIGHT NOTICE
This file is part of the "Universal Biomedical Skills" project.
Copyright (c) 2026 MD BABU MIA, PhD <md.babu.mia@mssm.edu>
All Rights Reserved.
#
This code is proprietary and confidential.
Unauthorized copying of this file, via any medium is strictly prohibited.
#
Provenance: Authenticated by MD BABU MIA
-->
--- name: bio-data-visualization-genome-tracks description: Create genome browser-style visualizations showing multiple data tracks (coverage, peaks, genes) using pyGenomeTracks, Gviz, and IGV. Use when visualizing genomic data at specific loci with multiple aligned tracks. tool_type: mixed primary_tool: pyGenomeTracks measurable_outcome: Execute skill workflow successfully with valid output within 15 minutes. allowed-tools:
- read_file
- run_shell_command
---
Genome Track Visualization
pyGenomeTracks (Python/CLI)
# Create tracks configuration file
cat > tracks.ini << 'EOF'
[bigwig]
file = coverage.bw
title = Coverage
height = 4
color = #4DBBD5
min_value = 0
[spacer]
height = 0.5
[peaks]
file = peaks.bed
title = Peaks
color = #E64B35
height = 2
labels = false
[spacer]
height = 0.5
[genes]
file = genes.gtf
title = Genes
height = 5
fontsize = 10
style = flybase
color = #3C5488
[x-axis]
EOF
# Generate plot
pyGenomeTracks --tracks tracks.ini --region chr1:1000000-2000000 \
--outFileName tracks.png --dpi 150pyGenomeTracks with Multiple Samples
[sample1 coverage] file = sample1.bw title = Sample 1 height = 3 color = #4DBBD5 min_value = 0 max_value = auto [sample2 coverage] file = sample2.bw title = Sample 2 height = 3 color = #E64B35 min_value = 0 max_value = auto [sample1 peaks] file = sample1_peaks.narrowPeak title = Sample 1 Peaks color = #4DBBD5 height = 1 file_type = narrowPeak [sample2 peaks] file = sample2_peaks.narrowPeak title = Sample 2 Peaks color = #E64B35 height = 1 file_type = narrowPeak
pyGenomeTracks Programmatic
import pygenometracks.tracks as pygtk
tracks = pygtk.PlotTracks('tracks.ini', fig_width=40, dpi=150)
tracks.plot('output.png', 'chr1', 1000000, 2000000)Gviz (R)
library(Gviz)
library(GenomicRanges)
# Genome axis
gtrack <- GenomeAxisTrack()
# Ideogram
itrack <- IdeogramTrack(genome = 'hg38', chromosome = 'chr1')
# Gene model
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene
grtrack <- GeneRegionTrack(txdb, genome = 'hg38', chromosome = 'chr1',
name = 'Genes', transcriptAnnotation = 'symbol')
# Data track from BigWig
dtrack <- DataTrack(range = 'coverage.bw', genome = 'hg38', chromosome = 'chr1',
name = 'Coverage', type = 'histogram', col.histogram = '#4DBBD5')
# Annotation track from BED
atrack <- AnnotationTrack(range = 'peaks.bed', genome = 'hg38', chromosome = 'chr1',
name = 'Peaks', fill = '#E64B35')
# Plot tracks
plotTracks(list(itrack, gtrack, dtrack, atrack, grtrack),
from = 1000000, to = 2000000, sizes = c(1, 1, 3, 1, 3))Gviz with Multiple Samples
# Create overlay data track
dtrack1 <- DataTrack(range = 'sample1.bw', name = 'Sample1', col = '#4DBBD5')
dtrack2 <- DataTrack(range = 'sample2.bw', name = 'Sample2', col = '#E64B35')
overlay <- OverlayTrack(trackList = list(dtrack1, dtrack2))
plotTracks(list(gtrack, overlay, grtrack), from = 1000000, to = 2000000,
type = 'histogram', legend = TRUE)Gviz Customization
# Highlight regions
ht <- HighlightTrack(trackList = list(dtrack, atrack),
start = c(1200000, 1500000),
end = c(1300000, 1600000),
chromosome = 'chr1')
# Custom display parameters
displayPars(dtrack) <- list(
background.title = '#3C5488',
fontcolor.title = 'white',
col.axis = 'black',
ylim = c(0, 100)
)
plotTracks(list(gtrack, ht, grtrack), from = 1000000, to = 2000000)IGV.js (Web)
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/igv@3.0.0/dist/igv.min.js"></script>
</head>
<body>
<div id="igv-div"></div>
<script>
var options = {
genome: "hg38",
locus: "chr1:1,000,000-2,000,000",
tracks: [
{
name: "Coverage",
url: "coverage.bw",
type: "wig",
color: "#4DBBD5"
},
{
name: "Peaks",
url: "peaks.bed",
type: "annotation",
color: "#E64B35"
}
]
};
igv.createBrowser(document.getElementById('igv-div'), options);
</script>
</body>
</html>Create BigWig from BAM
# Using deepTools
bamCoverage -b sample.bam -o coverage.bw \
--binSize 10 --normalizeUsing RPKM --effectiveGenomeSize 2913022398
# Using bedtools + wigToBigWig
bedtools genomecov -bg -ibam sample.bam > coverage.bedGraph
sort -k1,1 -k2,2n coverage.bedGraph > coverage.sorted.bedGraph
bedGraphToBigWig coverage.sorted.bedGraph chrom.sizes coverage.bwMulti-Region Plot
# pyGenomeTracks with BED regions
pyGenomeTracks --tracks tracks.ini --BED regions.bed \
--outFileName multi_region.pdf --dpi 150# Gviz with multiple regions
regions <- GRanges(seqnames = 'chr1', ranges = IRanges(start = c(1e6, 2e6), end = c(1.5e6, 2.5e6)))
pdf('multi_region.pdf', width = 10, height = 8)
for (i in seq_along(regions)) {
plotTracks(track_list, from = start(regions[i]), to = end(regions[i]))
}
dev.off()Related Skills
- genome-intervals/bigwig-tracks - BigWig file handling
- chip-seq/chipseq-visualization - ChIP-specific tracks
- hi-c-analysis/hic-visualization - Hi-C contact maps
<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->
The largest open-source medical AI skill library for OpenClaw.
Other skills on openclaw-medical-skills.
- /aav-vector-design-agent
<!--
Open skill - /adaptyv
Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use
Open skill - /adhd-daily-planner
Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that
Open skill - /aeon
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations
Open skill - /agent-browser
Browse the web for any task — research topics, read articles, interact with web apps, fill forms, take screenshots, extract data, and test web pages. Use whenever a browser would be useful, not just when the user explicitly asks.
Open skill - /agentd-drug-discovery
<!--
Open skill

