Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
mims-harvard avatar

Tooluniverse Epigenomics

  • 374 installs
  • 1.6k repo stars
  • Updated August 4, 2026
  • mims-harvard/tooluniverse

tooluniverse-epigenomics is a ToolUniverse skill that analyzes DNA methylation, ChIP-seq, and ATAC-seq data for developers who need genome-wide epigenomic statistics, chromatin integration, and multi-omics interpretation

About

tooluniverse-epigenomics is a genomics skill in mims-harvard/tooluniverse combining Python computation with database annotation for methylation, ChIP-seq, ATAC-seq, and multi-omics integration. It runs a 7-phase workflow from question parsing through methylation processing, peak analysis, ToolUniverse ENCODE and GTEx lookups, and genome-wide statistics, with a bundled methylation_density.py script for CpG density metrics. The skill enforces row-versus-unique-site counting rules that prevent silent wrong answers on long-format methylation CSVs. Developers reach for tooluniverse-epigenomics when analyzing CpG methylation, histone marks, chromatin accessibility, or integrating epigenomic data with expression.

  • Regulatory mark and locus lookup
  • Chromatin context enrichment
  • Cross-cohort epigenomic comparison
  • ToolUniverse genomics APIs
  • Agent-driven regulatory interpretation

Tooluniverse Epigenomics by the numbers

  • 374 all-time installs (skills.sh)
  • +5 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #525 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/mims-harvard/tooluniverse --skill tooluniverse-epigenomics

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs374
repo stars1.6k
Last updatedAugust 4, 2026
Repositorymims-harvard/tooluniverse

How do you analyze DNA methylation and ChIP-seq data?

Investigate methylation, chromatin marks, and regulatory context with ToolUniverse epigenomic resources to interpret expression changes and disease associations.

Who is it for?

Computational biologists analyzing Illumina methylation arrays, ChIP-seq peaks, or ATAC-seq with Python and ToolUniverse APIs.

Skip if: RNA-seq differential expression, variant calling, or protein structure workflows outside epigenomics.

When should I use this skill?

A developer asks about CpG methylation density, ChIP-seq peak annotation, ATAC-seq NFR detection, or epigenomic multi-omics integration.

What you get

Epigenomic statistics, filtered methylation metrics, peak annotations, and database-backed regulatory context.

  • Methylation density and filter statistics
  • Peak annotation results
  • Database-backed regulatory context

By the numbers

  • 7-phase analysis workflow from question parsing through genome-wide statistics
  • 4 bundled reference files plus methylation_density.py script
  • Supports Illumina 450K and EPIC methylation array analysis

Files

SKILL.mdMarkdownGitHub ↗

Genomics and Epigenomics Data Processing

⚠️ TOP-OF-MIND RULE: long-format methylation CSV — count ROWS, not unique positions

When the input is a long-format methylation CSV (one row per (sample, CpG_position) e.g. columns Pos, Chromosome, MethylationPercentage), "how many sites are removed when filtering" almost always means rows removed, NOT unique-position removals. The two answers differ by a factor of ≈ n_samples.

Question phrasingWhat it means
"how many sites are removed when filtering …"rows removed (= samples × positions failing the filter)
"how many unique CpG sites pass filter"unique positions (dedupe by Pos then filter)

❌ WRONG: df.drop_duplicates(["Pos"]).query("MethylationPercentage<10 or >90") then len(filtered) → counts unique positions (typically 100–1500)

✅ RIGHT: df.query("MethylationPercentage<10 or MethylationPercentage>90") then len(df) - len(filtered) → counts rows (typically 10k–30k)

If your answer is < 2000 when the data has 1000+ positions × 20+ samples, you deduplicated too early. Re-read the question's noun before reporting.

---

RULE ZERO — Check for pre-computed results FIRST

Before following any instruction below, scan the data folder for:

  • *_executed.ipynb → read with tu run read_executed_notebook '{"data_folder":"<path>","search":"<keyword>"}' and cite its cell outputs as the authoritative answer
  • Pre-computed result files (CSV/TSV with names like *results*, *deseq*, *enrich*, *stats*, *_simplified.csv) → read directly and report the requested value
  • Canonical analysis scripts (analysis.R, run_*.py, find_*.R, *.Rmd) → execute as-is and read the output

Only follow this skill's re-analysis recipe below if none of the above exist. Re-running from raw data produces different numbers than the published answer and is much slower (often 5-10× turn count).

---

Production-ready skill combining Python computation (pandas, scipy, numpy, pysam, statsmodels) with ToolUniverse annotation tools for epigenomics analysis.

LOOK UP, DON'T GUESS

When uncertain about any scientific fact, SEARCH databases first.

When to Use

Methylation data, ChIP-seq peaks, ATAC-seq, multi-omics integration, genome-wide epigenomic statistics. Keywords: methylation, CpG, ChIP-seq, ATAC-seq, histone, chromatin, epigenetic.

NOT for: RNA-seq DEG, variant calling, gene enrichment, protein structure.

---

Key Principles

1. Data-first - Load/inspect before analysis 2. Question-driven - Extract specific numeric answer 3. Coordinate system awareness - Track genome build (hg19/hg38/mm10), chr prefix 4. Statistical rigor - FDR correction, effect size filtering 5. CpG identification - Parse Illumina probe IDs, genomic coordinates

PRIMARY SCRIPT — methylation_density.py (use FIRST for CpG-density questions)

For long-format methylation CSVs (Pos, Chromosome, MethylationPercentage) paired with chromosome-length CSVs, ALWAYS run the bundled script before hand-rolling pandas. It deterministically computes every common metric in one pass and avoids the rows-vs-sites pitfall that produces silently-wrong answers.

python skills/tooluniverse-epigenomics/scripts/methylation_density.py \
  --cpg <CpG csv> --chr-lengths <chr lengths csv> \
  --filter-meth-extremes 90 10

The full JSON output contains every metric. Pick the one that matches the question's wording (NOT a similar-looking one):

Question phrasingScript field
"how many sites are removed when filtering …"rows_removed
"how many unique CpG sites pass filter"unique_pos_after_filter
"genome-wide AVERAGE chromosomal density"density_avg_per_chr
"density on chromosome X"density_chromosome (pass --chromosome X)
"total density across the genome"density_total_over_genome

The two density numbers (density_avg_per_chr vs density_total_over_genome) typically differ by ~2× because CpGs are not uniformly distributed across chromosomes; reporting one when the question asks for the other is the most common failure mode here.

For "sites removed" questions, the long-format CSV has multiple rows per CpG position (one per sample), so rows_removed is in the tens of thousands while unique_pos_removed is in the hundreds. Match the granularity to the question.

Distinguish "rows" vs "unique sites" — methylation CSVs are usually long-format

CpG methylation CSVs typically have ONE ROW PER (sample × CpG site) — so len(df) >> n_unique_sites. Before computing anything, decide which axis the question is asking about:

Question phrasingAxisOperation
"how many sites are removed when filtering"sample-rowsfilter then count rows; do NOT dedupe by Pos. The CSV is in long format; "sites" here is row-shaped. Subtract len(df_filtered) from len(df).
"how many unique CpG sites pass filter"unique positionsdedupe by position (or Pos column), then filter
"genome-wide average chromosomal density"per-chromosome densityMEAN of per-chromosome densities: (n_unique_per_chr / chr_length).mean(). NOT total_unique / total_genome — that gives a different answer (typically ≈ ½ of the per-chr mean for unevenly distributed CpGs).
"density on chromosome X"single chromosomeunique positions on X / length(X). Be careful which species — check the question text for "Zebra Finch" vs "Jackdaw".
"chi-square for uniform distribution across chromosomes"unique positions per chromosomefilter rows first, then dedupe by (Chromosome, Pos), then count per-chromosome unique positions for chi-square against expected = chr_length / total_length × n_unique_filtered

Sanity check: if your filtered count is two orders of magnitude smaller than the GT range, you likely deduped when the question wanted row-level counts (or vice versa). Re-run with the other axis and compare.

For the chi-square uniformity test: expected counts = chromosome_length / total_genome_length × n_unique_sites. The chi-square statistic depends on the count granularity (rows vs unique sites) — a row-level chi-square gives a much higher chi-square than a unique-position chi-square because n is larger.

Precedence: when an *_executed.ipynb exists, read its filtering code verbatim — df[(df.MethylationPercentage > 90) | (df.MethylationPercentage < 10)] (no dedup) and df.drop_duplicates('Pos') (with dedup) yield wildly different counts on the same dataset.

---

Workflow

Phase 0: Question Parsing

Identify data files, specific statistic, thresholds, genome build. Categorize by keywords. See ANALYSIS_PROCEDURES.md for decision tree.

Phase 1: Methylation Processing

  • Load beta/M-value matrix (CSV/TSV/parquet/HDF5)
  • Filter by variance, missing rate, probe type, chromosome, CpG island relation
  • Differential methylation: T-test/Wilcoxon between groups + FDR
  • Age-related CpG: Pearson/Spearman correlation + FDR
  • Chromosome density: CpG count / chromosome length

Phase 2: ChIP-seq Peak Analysis

  • Load BED/narrowPeak/broadPeak, normalize chromosomes
  • Peak stats, annotation to genes, overlap analysis (Jaccard)

Phase 3: ATAC-seq

  • NFR detection (<150bp peaks), region classification

Phase 4: Multi-Omics Integration

  • Methylation-expression correlation per probe-gene (Pearson/Spearman + FDR)
  • ChIP-seq + expression: promoter peaks vs expression levels

Phase 5: Clinical Data

  • Missing data analysis across modalities, complete case identification

Phase 6: ToolUniverse Annotation

ENCODE tools:

  • ENCODE_search_rnaseq_experiments: assay_type ("total RNA-seq" default; fall back to "polyA plus RNA-seq"), biosample, limit
  • ENCODE_search_histone_experiments: target (e.g., "H3K27ac"), cell_type/tissue/biosample, limit

GEO tools: GEO_search_rnaseq_datasets, GEO_search_atacseq_datasets -- both accept limit or max_results

GTEx tools:

  • GTEx_get_median_gene_expression: gene_symbol (NOT Ensembl ID)
  • GTEx_query_eqtl: gene_symbol, tissue_id (case-sensitive exact, e.g., "Whole_Blood")

Other: ensembl_lookup_gene (requires species='homo_sapiens'), ensembl_get_regulatory_features (NO "chr" prefix), SCREEN_get_regulatory_elements, ChIPAtlas_* (requires operation param), SRA_search_experiments (library_strategy: "ChIP-Seq"/"Bisulfite-Seq"/"ATAC-seq")

Phase 7: Genome-Wide Statistics

Global mean/median beta, probe variance, chromosome density, DMP counts.

See CODE_REFERENCE.md for full implementations.

---

Common Patterns

PatternKey Steps
Differential methylationFilter probes → groups → t-test → FDR → threshold
Age-related CpG densityCorrelate with age → FDR → map to chr → density ratio
Multi-omics missing dataExtract IDs → intersect → check NaN → complete case count
ChIP-seq annotationLoad peaks → annotate genes → classify regions
Methylation-expressionAlign samples → correlate → FDR → anti-correlations

---

GTEx Tissue IDs

Whole_Blood, Liver, Lung, Breast_Mammary_Tissue, Brain_Cortex, Heart_Left_Ventricle, Kidney_Cortex, Thyroid, Adipose_Subcutaneous, Muscle_Skeletal

---

Evidence Grading

GradeCriteria
Strongpadj < 0.01 AND abs(delta-beta) >= 0.2, replicated
Moderatepadj < 0.05 AND abs(delta-beta) >= 0.1
Weakpadj < 0.05 but delta-beta < 0.1
Insufficientpadj >= 0.05 or no replication

Delta-beta >= 0.2 = strong effect. ChIP-seq: q < 0.01, FE >= 2 for confidence. ATAC-seq NFR < 150bp = active regulatory. Always apply BH FDR. Verify genome build consistency.

---

Limitations

  • No pybedtools/pyBigWig: pure Python intervals
  • Illumina-centric (450K/EPIC); uses t-test/Wilcoxon (not limma)
  • No peak calling (assumes pre-called)
  • API rate limits: ~20 genes per batch

Reference Files

CODE_REFERENCE.md, TOOLS_REFERENCE.md, ANALYSIS_PROCEDURES.md, QUICK_START.md

Related skills

How it compares

Pick tooluniverse-epigenomics for methylation and chromatin analysis rather than tooluniverse-chemical-compound-retrieval for small-molecule lookup.

FAQ

What data types does tooluniverse-epigenomics handle?

tooluniverse-epigenomics handles DNA methylation beta matrices, long-format CpG CSVs, ChIP-seq BED and narrowPeak files, ATAC-seq peaks, and multi-omics missing-data integration. It uses pandas, scipy, and pysam plus ENCODE, GTEx, and GEO ToolUniverse annotation.

What is the rows versus sites rule?

tooluniverse-epigenomics distinguishes row counts from unique CpG positions in long-format methylation CSVs with one row per sample and site. Filtering questions about sites removed usually mean rows removed, which can differ by orders of magnitude from unique-position counts.

Data Science & MLagentsresearchautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.