CpG island analysis toolkit written in Rust. Accepts FASTA input and provides three subcommands: island detection, sequence statistics, and sliding-window profiling.
Download the binary for your system from the latest release:
Linux
curl -LO https://github.com/marceelrf/cpg/releases/latest/download/cpg-linux-x86_64
chmod +x cpg-linux-x86_64
mv cpg-linux-x86_64 ~/.local/bin/cpgmacOS
curl -LO https://github.com/marceelrf/cpg/releases/latest/download/cpg-macos-aarch64
chmod +x cpg-macos-aarch64
mv cpg-macos-aarch64 ~/.local/bin/cpgWindows — download cpg-windows-x86_64.exe from the releases page.
# Built-in preset (default: Gardiner-Garden & Frommer 1987)
# Default: Gardiner-Garden & Frommer 1987
# The thread number default is 4
cpg finder -i genome.fa --threads 3
# Takai & Jones 2002
cpg finder -i genome.fa --criteria takai
# Fully custom thresholds
cpg finder -i genome.fa --min-length 300 --min-gc 0.52 --min-obs-exp 0.62
# Mix: start from a preset and override one threshold
cpg finder -i genome.fa --criteria takai --min-length 300
# BED output — open directly in IGV or bedtools
cpg finder -i genome.fa --output bed > islands.bedBuilt-in presets:
| Preset | Length | GC% | Obs/Exp |
|---|---|---|---|
gardiner |
≥ 200 | ≥ 50 | ≥ 0.60 |
takai |
≥ 500 | ≥ 55 | ≥ 0.65 |
cpg stats -i sequences.fa
cpg stats -i sequences.fa --output tsv
cpg stats -i sequences.fa --output jsonOutputs: ID, Length, CG_count, GC%, Obs/Exp.
# Obs/Exp in 200 bp windows stepping 50 bp (default)
cpg profiler -i genome.fa --window 200 --step 50 --metric obs_exp
# GC% — TSV output, easy to pipe into R or Python
cpg profiler -i genome.fa -w 100 -s 10 -m gc_percent --output tsv
# BEDGRAPH output — load directly into IGV or UCSC Genome Browser
cpg profiler -i genome.fa -w 200 -s 50 -m obs_exp --output bedgraph > profile.bedgraphMetrics: cg_count, gc_percent, obs_exp.
| Format | Available in | Use case |
|---|---|---|
table |
all | terminal / quick inspection |
tsv |
all | R, Python, Excel |
json |
all | downstream scripts |
bed |
finder | IGV, bedtools, UCSC |
bedgraph |
profiler | IGV, UCSC Genome Browser |
All subcommands accept --output as a global flag.
We thank FAPESP(2025/28063-3) and CAPES(PIPD 88887.114278/2025-00) for the financial support.