Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Create and read bigWig browser tracks for visualizing continuous genomic data. Convert bedGraph to bigWig, extract signal values, and generate coverage tracks using UCSC tools and pyBigWig. Use when preparing coverage tracks for genome browsers or extracting signal at specific regions.
.claude/skills/bio-genome-intervals-bigwig-tracks/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-15 | ✗→✓ | ▲ Improved | 51% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 78% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 119% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 373% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 103% | 0% |
<!--
#
#
-->
BigWig is an indexed binary format for continuous genomic data. Efficient for genome browsers and programmatic access.
| Format | Size | Random Access | Browser Support | |--------|------|---------------|-----------------| | bedGraph | Large | No | Limited | | bigWig | ~10x smaller | Yes (indexed) | Excellent |
bash# UCSC tools conda install -c bioconda ucsc-bedgraphtobigwig ucsc-bigwigtobedgraph # Or download directly wget http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/bedGraphToBigWig chmod +x bedGraphToBigWig
bash# Sort bedGraph first (required) sort -k1,1 -k2,2n coverage.bedGraph > coverage.sorted.bedGraph # Convert to bigWig bedGraphToBigWig coverage.sorted.bedGraph chrom.sizes output.bw # chrom.sizes format: chr<TAB>size # chr1 248956422 # chr2 242193529
bash# From FASTA index cut -f1,2 reference.fa.fai > chrom.sizes # Download from UCSC wget https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.chrom.sizes # From BAM header samtools view -H alignments.bam | grep @SQ | sed 's/@SQ\tSN:\|LN://g' > chrom.sizes
bash# Generate bedGraph from BAM bedtools genomecov -ibam alignments.bam -bg > coverage.bedGraph # Sort bedGraph sort -k1,1 -k2,2n coverage.bedGraph > coverage.sorted.bedGraph # Convert to bigWig bedGraphToBigWig coverage.sorted.bedGraph hg38.chrom.sizes coverage.bw # Clean up intermediate files rm coverage.bedGraph coverage.sorted.bedGraph
bashpip install pyBigWig
pythonimport pyBigWig # Open file bw = pyBigWig.open('coverage.bw') # File info print(f'Chromosomes: {bw.chroms()}') print(f'Header: {bw.header()}') # Check if file is bigWig (not bigBed) print(f'Is bigWig: {bw.isBigWig()}') # Close when done bw.close()
pythonimport pyBigWig bw = pyBigWig.open('coverage.bw') # Get values for a region (returns numpy array) values = bw.values('chr1', 1000000, 1001000) print(f'Mean: {values.mean():.2f}') print(f'Max: {values.max():.2f}') # Get specific intervals with values intervals = bw.intervals('chr1', 1000000, 1001000) # Returns: [(start, end, value), ...] for start, end, val in intervals: print(f'{start}-{end}: {val}') # Statistics for region stats = bw.stats('chr1', 1000000, 1001000, type='mean') print(f'Mean coverage: {stats[0]:.2f}') # Available stat types: mean, min, max, coverage, std, sum max_val = bw.stats('chr1', 1000000, 1001000, type='max') coverage = bw.stats('chr1', 1000000, 1001000, type='coverage') bw.close()
pythonimport pyBigWig bw = pyBigWig.open('coverage.bw') # Get mean values in 100bp bins across region region_start, region_end = 1000000, 2000000 n_bins = 1000 # 100bp bins binned = bw.stats('chr1', region_start, region_end, type='mean', nBins=n_bins) # Returns list of n_bins values bw.close()
pythonimport pyBigWig import pybedtools bw = pyBigWig.open('coverage.bw') bed = pybedtools.BedTool('regions.bed') # Get mean signal per region results = [] for interval in bed: chrom, start, end = interval.chrom, interval.start, interval.end mean_signal = bw.stats(chrom, start, end, type='mean')[0] results.append({ 'chrom': chrom, 'start': start, 'end': end, 'name': interval.name, 'signal': mean_signal if mean_signal else 0 }) bw.close() # Convert to DataFrame import pandas as pd df = pd.DataFrame(results) print(df)
pythonimport pyBigWig # Create new bigWig bw = pyBigWig.open('output.bw', 'w') # Add header (chromosome sizes) bw.addHeader([('chr1', 248956422), ('chr2', 242193529)]) # Add entries (must be sorted by position) # Method 1: Individual entries bw.addEntries(['chr1', 'chr1'], [0, 100], ends=[100, 200], values=[1.5, 2.3]) # Method 2: Chromosome at a time (more efficient) bw.addEntries('chr1', [0, 100, 200], ends=[100, 200, 300], values=[1.5, 2.3, 3.1]) # Method 3: Fixed-width spans (most efficient for dense data) bw.addEntries('chr2', 0, values=[1.0, 2.0, 3.0, 4.0], span=100, step=100) # Creates: chr2:0-100=1.0, chr2:100-200=2.0, chr2:200-300=3.0, chr2:300-400=4.0 bw.close()
bashconda install -c bioconda deeptools
bash# RPKM normalization bamCoverage -b alignments.bam -o coverage.bw --normalizeUsing RPKM # CPM normalization bamCoverage -b alignments.bam -o coverage.bw --normalizeUsing CPM # BPM (bins per million) - like TPM for ChIP-seq bamCoverage -b alignments.bam -o coverage.bw --normalizeUsing BPM # With bin size and smoothing bamCoverage -b alignments.bam -o coverage.bw \ --binSize 10 \ --normalizeUsing CPM \ --smoothLength 30 # Extend reads to fragment length bamCoverage -b alignments.bam -o coverage.bw \ --extendReads 200 \ --normalizeUsing CPM
bash# Log2 ratio of two bigWig files bigwigCompare -b1 treatment.bw -b2 control.bw -o log2ratio.bw --ratio log2 # Subtract bigwigCompare -b1 treatment.bw -b2 control.bw -o diff.bw --ratio subtract # Mean of multiple files bigwigAverage -b file1.bw file2.bw file3.bw -o average.bw
bash# Matrix for heatmap (signal around regions) computeMatrix reference-point -S signal.bw -R regions.bed \ -b 2000 -a 2000 -o matrix.gz # Plot heatmap plotHeatmap -m matrix.gz -o heatmap.png # Summary statistics per region multiBigwigSummary BED-file -b sample1.bw sample2.bw -o results.npz --BED regions.bed
bash# Using UCSC tool bigWigToBedGraph input.bw output.bedGraph # Extract specific region bigWigToBedGraph input.bw output.bedGraph -chrom=chr1 -start=1000000 -end=2000000
bash# Generate normalized track bamCoverage -b chip.bam -o chip.bw \ --normalizeUsing CPM \ --extendReads 200 \ --binSize 10 # Generate input-subtracted track bigwigCompare -b1 chip.bw -b2 input.bw -o chip_minus_input.bw --ratio subtract
bash# Strand-specific coverage bamCoverage -b rnaseq.bam -o forward.bw --filterRNAstrand forward bamCoverage -b rnaseq.bam -o reverse.bw --filterRNAstrand reverse
pythonimport pyBigWig import pandas as pd def extract_signal(bw_path, bed_path, stat='mean'): '''Extract bigWig signal for BED regions.''' import pybedtools bw = pyBigWig.open(bw_path) bed = pybedtools.BedTool(bed_path) results = [] for interval in bed: val = bw.stats(interval.chrom, interval.start, interval.end, type=stat)[0] results.append({ 'chrom': interval.chrom, 'start': interval.start, 'end': interval.end, 'name': interval.name if interval.name else '.', 'signal': val if val is not None else 0 }) bw.close() return pd.DataFrame(results) # Usage df = extract_signal('coverage.bw', 'peaks.bed', stat='mean') print(df)
<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 14,285 | 7,045 | -51% | 1 | 1 | 0% | 3,054 | 4,167 | +36% | 0 | 0 | — |
case-02 | fail→fail | 13,107 | 9,169 | -30% | 1 | 1 | 0% | 2,683 | 4,509 | +68% | 0 | 0 | — |
case-03 | pass→pass | 12,105 | 6,694 | -45% | 1 | 1 | 0% | 2,195 | 3,916 | +78% | 0 | 0 | — |
case-04 | pass→pass | 8,017 | 3,784 | -53% | 1 | 1 | 0% | 1,557 | 3,411 | +119% | 0 | 0 | — |
case-05 | pass→pass | 3,579 | 3,266 | -9% | 1 | 1 | 0% | 706 | 3,341 | +373% | 0 | 0 | — |
case-06 | pass→pass | 9,099 | 5,213 | -43% | 1 | 1 | 0% | 1,835 | 3,726 | +103% | 0 | 0 | — |
case-07 | pass→pass | 2,976 | 2,051 | -31% | 1 | 1 | 0% | 527 | 3,009 | +471% | 0 | 0 | — |
case-08 | pass→pass | 6,378 | 4,263 | -33% | 1 | 1 | 0% | 1,091 | 3,467 | +218% | 0 | 0 | — |
case-09 | pass→pass | 6,766 | 4,121 | -39% | 1 | 1 | 0% | 1,328 | 3,524 | +165% | 0 | 0 | — |
case-10 | pass→pass | 5,555 | 3,744 | -33% | 1 | 1 | 0% | 1,157 | 3,529 | +205% | 0 | 0 | — |
case-11 | pass→pass | 11,586 | 2,726 | -76% | 1 | 1 | 0% | 2,283 | 3,161 | +38% | 0 | 0 | — |
case-12 | pass→pass | 7,484 | 4,050 | -46% | 1 | 1 | 0% | 1,537 | 3,437 | +124% | 0 | 0 | — |
case-13 | pass→pass | 5,321 | 3,825 | -28% | 1 | 1 | 0% | 1,020 | 3,406 | +234% | 0 | 0 | — |
case-14 | pass→pass | 6,565 | 4,808 | -27% | 1 | 1 | 0% | 1,378 | 3,683 | +167% | 0 | 0 | — |
case-15 | fail→pass | 13,668 | 6,082 | -56% | 1 | 1 | 0% | 2,585 | 3,902 | +51% | 0 | 0 | — |
case-16 | pass→pass | 7,099 | 3,424 | -52% | 1 | 1 | 0% | 1,325 | 3,352 | +153% | 0 | 0 | — |
case-17 | pass→pass | 4,695 | 3,072 | -35% | 1 | 1 | 0% | 866 | 3,075 | +255% | 0 | 0 | — |
case-18 | pass→pass | 5,036 | 2,754 | -45% | 1 | 1 | 0% | 1,048 | 3,244 | +210% | 0 | 0 | — |
case-19 | fail→fail | 7,590 | 5,551 | -27% | 1 | 1 | 0% | 1,507 | 3,749 | +149% | 0 | 0 | — |
case-20 | pass→pass | 7,835 | 4,942 | -37% | 1 | 1 | 0% | 1,542 | 3,644 | +136% | 0 | 0 | — |
case-21 | pass→pass | 9,160 | 8,769 | -4% | 1 | 1 | 0% | 1,839 | 4,522 | +146% | 0 | 0 | — |
case-22 | pass→pass | 2,766 | 3,349 | +21% | 1 | 1 | 0% | 421 | 3,242 | +670% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 7/24/2026 | +27% |
Other measured skills in the registry, with their headline benchmark lift.