/bio-data-visualization-genome-browser-tracks
<!--
$ npx -y skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-data-visualization-genome-browser-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-browser-tracks
Context preview
The summary Claude sees to decide when to auto-load this skill.
<!--
SKILL.md
bio-data-visualization-genome-browser-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-browser-tracks description: Generate genome browser visualizations using pyGenomeTracks or IGV batch scripting for publication figures. Use when creating publication figures of genomic regions with multiple data 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 Browser Tracks
pyGenomeTracks INI Configuration
[x-axis]
where = top
[bigwig_coverage]
file = sample.bw
title = Coverage
height = 3
color = #4DBBD5
min_value = 0
max_value = auto
[spacer]
height = 0.5
[peaks]
file = peaks.bed
title = Peaks
color = #E64B35
height = 1
display = collapsed
[genes]
file = genes.gtf
title = Genes
height = 5
fontsize = 10
style = UCSC
color = navy
pyGenomeTracks Command
# Generate track plot
pyGenomeTracks --tracks tracks.ini --region chr1:1000000-2000000 \
--outFileName region.png --dpi 300
# Multiple regions
for region in chr1:1000000-2000000 chr2:5000000-6000000; do
pyGenomeTracks --tracks tracks.ini --region $region \
--outFileName "${region//:/_}.png" --dpi 300
donepyGenomeTracks Python API
import pygenometracks.tracks as pygtk
from pygenometracks import plotTracks
# Programmatic track configuration
tracks = '''
[x-axis]
where = top
[bigwig]
file = coverage.bw
title = ChIP-seq
height = 4
color = #4DBBD5
[bed]
file = peaks.narrowPeak
title = Peaks
height = 1
color = #E64B35
'''
# Write config and plot
with open('tracks.ini', 'w') as f:
f.write(tracks)
# Using command line via subprocess
import subprocess
subprocess.run([
'pyGenomeTracks',
'--tracks', 'tracks.ini',
'--region', 'chr1:1000000-2000000',
'--outFileName', 'output.png',
'--dpi', '300'
])Track Types
bigWig Coverage
[bigwig]
file = signal.bw
title = Coverage
height = 4
color = #4DBBD5
min_value = 0
max_value = auto
number_of_bins = 700
nans_to_zeros = true
summary_method = mean
# overlay_previous = share-y # For overlaying multiple tracks
BED/narrowPeak
[bed]
file = peaks.narrowPeak
title = Peaks
height = 2
color = #E64B35
display = collapsed # or stacked, interleaved, triangles
labels = false
# file_type = bed # auto-detected usually
[bed_links]
file = interactions.bedpe
title = Loops
height = 3
file_type = links
links_type = arcs
color = purple
line_width = 1
Gene Annotations
[genes]
file = genes.gtf
title = Genes
height = 6
fontsize = 10
style = UCSC # or flybase
prefered_name = gene_name
merge_transcripts = false
color = navy
border_color = black
# arrow_interval = 2 # Arrow frequency
[genes_bed12]
file = genes.bed12
title = Transcripts
height = 5
fontsize = 8
color = darkblue
Hi-C Matrix
[hic_matrix]
file = matrix.cool
title = Hi-C
height = 10
depth = 1000000
min_value = 0
max_value = 100
transform = log1p
colormap = RdYlBu_r
show_masked_bins = false
IGV Batch Scripting
# Create batch script
cat > igv_batch.txt << 'EOF'
new
genome hg38
load sample1.bam
load peaks.bed
snapshotDirectory ./snapshots
goto chr1:1000000-2000000
snapshot region1.png
goto chr2:5000000-6000000
snapshot region2.png
exit
EOF
# Run IGV in batch mode
igv -b igv_batch.txt
IGV Batch Commands
# Common IGV batch commands
new # New session
genome hg38 # Load genome
load file.bam # Load track
snapshotDirectory ./out # Set output dir
goto chr1:1000000-2000000 # Navigate to region
sort base # Sort reads
collapse # Collapse tracks
expand # Expand tracks
squish # Squish display
maxPanelHeight 500 # Set panel height
snapshot file.png # Take screenshot
exit # Exit IGV
Gviz (R)
library(Gviz)
library(GenomicRanges)
# Axis track
axTrack <- GenomeAxisTrack()
# Gene track from TxDb
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene
grTrack <- GeneRegionTrack(txdb, chromosome = 'chr1', name = 'Genes')
# Data track from BigWig
dTrack <- DataTrack(range = 'coverage.bw', type = 'h',
chromosome = 'chr1', name = 'Coverage',
col = '#4DBBD5')
# Annotation track from BED
aTrack <- AnnotationTrack(range = 'peaks.bed', name = 'Peaks',
chromosome = 'chr1', fill = '#E64B35')
# Plot tracks
plotTracks(list(axTrack, dTrack, aTrack, grTrack),
from = 1000000, to = 2000000,
chromosome = 'chr1')
# Save to PDF
pdf('tracks.pdf', width = 10, height = 6)
plotTracks(list(axTrack, dTrack, aTrack, grTrack),
from = 1000000, to = 2000000)
dev.off()Multi-Sample Comparison
# tracks.ini for multiple samples
[x-axis]
[sample1_bw]
file = sample1.bw
title = Sample 1
height = 3
color = #4DBBD5
min_value = 0
max_value = 100
[sample2_bw]
file = sample2.bw
title = Sample 2
height = 3
color = #E64B35
min_value = 0
max_value = 100
overlay_previous = share-y
[spacer]
height = 0.3
[sample1_peaks]
file = sample1_peaks.bed
title = S1 Peaks
height = 1
color = #4DBBD5
[sample2_peaks]
file = sample2_peaks.bed
title = S2 Peaks
height = 1
color = #E64B35
Publication Export
# High resolution PNG
pyGenomeTracks --tracks tracks.ini --region chr1:1-1000000 \
--outFileName figure.png --dpi 300 --width 40
# PDF for vector graphics
pyGenomeTracks --tracks tracks.ini --region chr1:1-1000000 \
--outFileName figure.pRead 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-browser-tracks description: Generate genome browser visualizations using pyGenomeTracks or IGV batch scripting for publication figures. Use when creating publication figures of genomic regions with multiple data 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 Browser Tracks
pyGenomeTracks INI Configuration
[x-axis] where = top [bigwig_coverage] file = sample.bw title = Coverage height = 3 color = #4DBBD5 min_value = 0 max_value = auto [spacer] height = 0.5 [peaks] file = peaks.bed title = Peaks color = #E64B35 height = 1 display = collapsed [genes] file = genes.gtf title = Genes height = 5 fontsize = 10 style = UCSC color = navy
pyGenomeTracks Command
# Generate track plot
pyGenomeTracks --tracks tracks.ini --region chr1:1000000-2000000 \
--outFileName region.png --dpi 300
# Multiple regions
for region in chr1:1000000-2000000 chr2:5000000-6000000; do
pyGenomeTracks --tracks tracks.ini --region $region \
--outFileName "${region//:/_}.png" --dpi 300
donepyGenomeTracks Python API
import pygenometracks.tracks as pygtk
from pygenometracks import plotTracks
# Programmatic track configuration
tracks = '''
[x-axis]
where = top
[bigwig]
file = coverage.bw
title = ChIP-seq
height = 4
color = #4DBBD5
[bed]
file = peaks.narrowPeak
title = Peaks
height = 1
color = #E64B35
'''
# Write config and plot
with open('tracks.ini', 'w') as f:
f.write(tracks)
# Using command line via subprocess
import subprocess
subprocess.run([
'pyGenomeTracks',
'--tracks', 'tracks.ini',
'--region', 'chr1:1000000-2000000',
'--outFileName', 'output.png',
'--dpi', '300'
])Track Types
bigWig Coverage
[bigwig] file = signal.bw title = Coverage height = 4 color = #4DBBD5 min_value = 0 max_value = auto number_of_bins = 700 nans_to_zeros = true summary_method = mean # overlay_previous = share-y # For overlaying multiple tracks
BED/narrowPeak
[bed] file = peaks.narrowPeak title = Peaks height = 2 color = #E64B35 display = collapsed # or stacked, interleaved, triangles labels = false # file_type = bed # auto-detected usually [bed_links] file = interactions.bedpe title = Loops height = 3 file_type = links links_type = arcs color = purple line_width = 1
Gene Annotations
[genes] file = genes.gtf title = Genes height = 6 fontsize = 10 style = UCSC # or flybase prefered_name = gene_name merge_transcripts = false color = navy border_color = black # arrow_interval = 2 # Arrow frequency [genes_bed12] file = genes.bed12 title = Transcripts height = 5 fontsize = 8 color = darkblue
Hi-C Matrix
[hic_matrix] file = matrix.cool title = Hi-C height = 10 depth = 1000000 min_value = 0 max_value = 100 transform = log1p colormap = RdYlBu_r show_masked_bins = false
IGV Batch Scripting
# Create batch script cat > igv_batch.txt << 'EOF' new genome hg38 load sample1.bam load peaks.bed snapshotDirectory ./snapshots goto chr1:1000000-2000000 snapshot region1.png goto chr2:5000000-6000000 snapshot region2.png exit EOF # Run IGV in batch mode igv -b igv_batch.txt
IGV Batch Commands
# Common IGV batch commands new # New session genome hg38 # Load genome load file.bam # Load track snapshotDirectory ./out # Set output dir goto chr1:1000000-2000000 # Navigate to region sort base # Sort reads collapse # Collapse tracks expand # Expand tracks squish # Squish display maxPanelHeight 500 # Set panel height snapshot file.png # Take screenshot exit # Exit IGV
Gviz (R)
library(Gviz)
library(GenomicRanges)
# Axis track
axTrack <- GenomeAxisTrack()
# Gene track from TxDb
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene
grTrack <- GeneRegionTrack(txdb, chromosome = 'chr1', name = 'Genes')
# Data track from BigWig
dTrack <- DataTrack(range = 'coverage.bw', type = 'h',
chromosome = 'chr1', name = 'Coverage',
col = '#4DBBD5')
# Annotation track from BED
aTrack <- AnnotationTrack(range = 'peaks.bed', name = 'Peaks',
chromosome = 'chr1', fill = '#E64B35')
# Plot tracks
plotTracks(list(axTrack, dTrack, aTrack, grTrack),
from = 1000000, to = 2000000,
chromosome = 'chr1')
# Save to PDF
pdf('tracks.pdf', width = 10, height = 6)
plotTracks(list(axTrack, dTrack, aTrack, grTrack),
from = 1000000, to = 2000000)
dev.off()Multi-Sample Comparison
# tracks.ini for multiple samples [x-axis] [sample1_bw] file = sample1.bw title = Sample 1 height = 3 color = #4DBBD5 min_value = 0 max_value = 100 [sample2_bw] file = sample2.bw title = Sample 2 height = 3 color = #E64B35 min_value = 0 max_value = 100 overlay_previous = share-y [spacer] height = 0.3 [sample1_peaks] file = sample1_peaks.bed title = S1 Peaks height = 1 color = #4DBBD5 [sample2_peaks] file = sample2_peaks.bed title = S2 Peaks height = 1 color = #E64B35
Publication Export
# High resolution PNG
pyGenomeTracks --tracks tracks.ini --region chr1:1-1000000 \
--outFileName figure.png --dpi 300 --width 40
# PDF for vector graphics
pyGenomeTracks --tracks tracks.ini --region chr1:1-1000000 \
--outFileName figure.pThe 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

