Claude Cursor Skill

compare-biosamples

Compare ENCODE experiments across different biosamples, tissues, or cell lines to identify tissue-specific regulatory patterns. Use when the user wants cross-tissue comparison, cell-type comparison, tissue-specific elements, differential chromatin, biosample matching, disease vs

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download ammawla-encode-toolkit-plugin_skills_compare-biosamples-36836c8.zip · 14 KB
Part of ammawla/encode-toolkit — 90 skills

Install

skills CLI npx skills add https://github.com/ammawla/encode-toolkit/tree/main/plugin/skills/compare-biosamples
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install ammawla-encode-toolkit@llmmart
Git git clone https://github.com/ammawla/encode-toolkit.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole ammawla/encode-toolkit collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Compare ENCODE Data Across Biosamples

When to Use

  • User wants to compare ENCODE experiments across different tissues, cell lines, or biosamples
  • User asks about "tissue comparison", "cell-type differences", "tissue-specific enhancers", or "cross-tissue"
  • User needs to identify constitutive vs tissue-specific regulatory elements
  • User wants to map data availability across multiple biosamples before integrative analysis
  • Example queries: "compare H3K27ac between liver and pancreas", "what marks are tissue-specific?", "find constitutive promoters across all tissues"

Help the user systematically compare data availability and experiments across different biosamples to identify tissue-specific regulatory patterns, constitutive elements, and cross-tissue differences.

Scientific Rationale

Cross-biosample comparison is the foundation of understanding tissue-specific gene regulation. Regulatory elements -- particularly enhancers -- are the primary drivers of cell-type identity, with promoters being largely shared across tissues. Comparing the same assay across multiple biosamples reveals which regulatory elements are constitutive (shared) versus tissue-specific (unique to one or few cell types).

The core question: "Which regulatory features distinguish tissue A from tissue B, and which are shared?"

This requires careful matching of datasets, awareness of batch effects, and understanding of the biosample hierarchy to avoid confounding biological signal with technical variation.

Literature Foundation

# Reference Key Contribution
1 Roadmap Epigenomics Consortium 2015, Nature, DOI:10.1038/nature14248 (~5,810 cit) Generated 111 reference epigenomes across tissues/cell types; established the framework for cross-tissue epigenomic comparison. Showed that enhancer chromatin states are the most tissue-variable elements.
2 ENCODE Phase 3 2020, Nature, DOI:10.1038/s41586-020-2493-4 (~1,656 cit) Expanded functional annotations to 1.3M candidate cis-regulatory elements (cCREs) across hundreds of biosamples; defined tissue-activity indices for regulatory elements.
3 Andersson et al. 2014, Nature, DOI:10.1038/nature12787 (~1,500 cit) FANTOM5 atlas of active enhancers across 808 samples; demonstrated that only ~5% of enhancers are active across all tissues, with the majority being highly tissue-specific.
4 Heintzman et al. 2009, Nature, DOI:10.1038/nature07917 (~2,200 cit) Showed histone modifications distinguish cell types: H3K4me1/H3K27ac at enhancers are the most discriminating tissue-specific marks, while H3K4me3 at promoters is largely shared.
5 Thurman et al. 2012, Nature, DOI:10.1038/nature11232 (~2,000 cit) Mapped accessible chromatin across 125 cell types; demonstrated that DNase I hypersensitive sites define cell-type identity and that accessibility patterns cluster by tissue of origin.
6 Leek et al. 2010, Nat Rev Genet, DOI:10.1038/nrg2825 (~1,200 cit) Comprehensive review of batch effects in genomic data; showed that lab, platform, and processing date can dominate biological variation if not properly controlled.
7 Forrest et al. 2014, Nature, DOI:10.1038/nature13182 (~1,100 cit) FANTOM5 promoter-level expression atlas across 975 samples; demonstrated that promoter usage (not just gene expression) is tissue-specific and defines cell identity.

Tissue-Specific Regulation Principles

Understanding what varies across tissues and what does not is essential before designing a comparison.

What Is Shared vs Tissue-Specific (Heintzman 2009; Andersson 2014)

Feature Cross-Tissue Behavior Implication for Comparison
Promoters (H3K4me3) Largely shared (~70% active in most tissues) Poor discriminators between tissues
Enhancers (H3K27ac + H3K4me1) Highly tissue-specific (~5% shared across all tissues) Best discriminators; focus comparison here
Chromatin accessibility (ATAC/DNase) Moderate tissue-specificity (~20-30% shared) Good secondary discriminator; clusters by tissue of origin
Polycomb repression (H3K27me3) Tissue-specific (marks silenced developmental genes) Useful for identifying repressed lineage programs
Gene expression (RNA-seq) Moderate tissue-specificity Housekeeping genes shared; tissue-specific TFs are key
CTCF binding Largely constitutive (~70% conserved) Defines structural boundaries; less tissue-variable
DNA methylation Bimodal; enhancers show tissue-variable methylation Hypomethylation at active enhancers is tissue-specific

Key Insight

H3K27ac at enhancers is the single most informative mark for distinguishing tissues (Heintzman et al. 2009, Roadmap 2015). If the user can only compare one mark across tissues, H3K27ac should be the first choice, followed by chromatin accessibility (ATAC-seq or DNase-seq).

ENCODE Biosample Hierarchy

Level Description Biological Relevance Reproducibility Caveats
Tissue Primary tissue from donor (e.g., pancreas, liver) Highest -- in vivo biology preserved Lower -- donor variation, cell-type heterogeneity Mixed cell populations; composition varies by donor age/sex/health
Primary cell Cells isolated from tissue (e.g., hepatocytes, islets) High -- enriched for cell type Moderate -- isolation stress, limited passages Isolation method alters phenotype; culture conditions matter
Cell line Immortalized cells (e.g., K562, HepG2, GM12878) Lower -- transformed phenotype Highest -- clonal, reproducible May not represent normal tissue biology; passage number matters
In vitro differentiated Cells derived from stem cells (e.g., iPSC-derived cardiomyocytes) Moderate -- model system Moderate -- protocol-dependent Differentiation efficiency varies; often immature phenotype
Organoid 3D self-organizing structures Moderate-high -- recapitulates tissue architecture Lower -- heterogeneous Emerging data type in ENCODE; limited coverage

Tier 1 Cell Lines (Most Comprehensive ENCODE Data)

Cell Line Origin Cancer/Normal Best For
K562 Chronic myelogenous leukemia Cancer Hematopoietic chromatin, TF binding, 3D genome
GM12878 Lymphoblastoid (EBV-transformed B cells) Transformed-normal Immune regulation, 3D genome (Rao et al. 2014 Hi-C reference)
H1-hESC Human embryonic stem cells Normal Developmental regulation, bivalent chromatin

These three cell lines have the most complete multi-omic profiling in ENCODE. They are excellent positive controls for verifying comparison pipelines before applying to user-specific tissues.

Biosample Comparability Rules

  • Same biosample type preferred: Compare tissue-to-tissue, cell line-to-cell line
  • Cross-type comparisons require caution: Cell line vs tissue introduces both biological and technical confounders
  • Donor matching: When comparing tissues, match for life_stage, sex, and age when possible
  • Passage number matters for cell lines: Different passages of the same cell line can diverge epigenomically

Step 1: Define the Comparison Design

Clarify the comparison type with the user. Each design has different requirements:

Comparison Design Patterns

Design Description Required Matching Key Tools Best File Types
Cross-tissue (same assay) Same mark/assay in different organs Same assay, same target, same assembly, same biosample_type encode_search_experiments, encode_get_facets IDR thresholded peaks, fold change over control
Multi-omic (same tissue) Multiple assays in one biosample Same biosample_term_name, same assembly encode_get_facets, encode_search_experiments Depends on assay
Disease vs normal Pathological vs healthy tissue Same organ, same assay, matched demographics encode_search_experiments with biosample filter IDR thresholded peaks, gene quantifications
Developmental time course Same tissue at different life stages Same organ, same assay, different life_stage encode_search_experiments with life_stage filter Signal tracks, gene quantifications
Cell line vs primary tissue Transformed vs in vivo Same organ of origin, same assay encode_search_experiments, encode_compare_experiments IDR thresholded peaks
Cross-species Human vs mouse homologous tissues Same organ, same assay, different organism encode_search_experiments with organism filter Requires liftOver; use signal tracks

Ask the user: "What tissues/cell types are you comparing, and what assay are you focusing on?"

Step 2: Map Data Availability Across Biosamples

Use encode_get_facets to build an availability matrix before searching for specific experiments.

2a. Check What Exists for Each Biosample

# For each tissue of interest, discover available assays and targets
encode_get_facets(organ="pancreas")
encode_get_facets(organ="liver")
encode_get_facets(organ="brain")

2b. Check What Exists for a Specific Assay Across Tissues

# See which organs have Histone ChIP-seq data
encode_get_facets(assay_title="Histone ChIP-seq")

# See which organs have ATAC-seq data
encode_get_facets(assay_title="ATAC-seq")

2c. Build the Availability Matrix

Present to the user a matrix like:

Assay / Target Pancreas tissue Liver tissue Brain tissue K562 GM12878
H3K27ac ChIP-seq 3 exp 5 exp 8 exp 12 exp 10 exp
H3K4me3 ChIP-seq 2 exp 4 exp 6 exp 11 exp 9 exp
ATAC-seq 1 exp 3 exp 5 exp 4 exp 3 exp
RNA-seq 4 exp 6 exp 10 exp 15 exp 8 exp
WGBS 0 2 exp 3 exp 2 exp 2 exp

Highlight gaps: "Pancreas has no WGBS data -- comparison of methylation patterns will be limited to liver and brain."

Step 3: Identify Matched Datasets

For a valid cross-tissue comparison, datasets must be matched on technical parameters. Search each tissue:

encode_search_experiments(
    assay_title="Histone ChIP-seq",
    target="H3K27ac",
    organ="pancreas",
    biosample_type="tissue",
    limit=50
)

Matching Criteria Checklist

For each experiment pair across tissues, verify:

Parameter Must Match? How to Check
Assay title Yes Search filter
Target (for ChIP) Yes Search filter
Genome assembly Yes File metadata; use GRCh38
Biosample type Recommended Search filter
Organism Yes Search filter
Life stage Recommended Experiment metadata
Sex Preferred Experiment metadata
Pipeline version Preferred encode_get_experiment
Sequencing depth Comparable (within 2x) File metadata
Read length Preferred File metadata

Step 4: Check Pairwise Compatibility

Track candidate experiments and use encode_compare_experiments for each cross-tissue pair:

# Track experiments from each tissue
encode_track_experiment(accession="ENCSR_pancreas")
encode_track_experiment(accession="ENCSR_liver")

# Check compatibility
encode_compare_experiments(
    accession1="ENCSR_pancreas",
    accession2="ENCSR_liver"
)

The compatibility tool checks:

  • Organism match
  • Assembly match
  • Assay type match
  • Biosample differences (expected for cross-tissue comparison)
  • Target match
  • Replication strategy
  • Lab differences (potential batch effect source)

For cross-tissue comparison: Biosample mismatch is expected -- it is the variable of interest. Focus on ensuring all other parameters match.

Step 5: Assess and Control for Batch Effects (Leek et al. 2010)

Batch effects are the most common confounder in cross-biosample comparisons. When experiments come from different labs, platforms, or processing dates, technical variation can dominate biological signal.

Known Batch Effect Sources

Source Impact Detection Method
Lab of origin High -- different protocols, antibodies, cell handling Check lab field; PCA of signal should not cluster by lab
Sequencing platform Moderate -- read quality, GC bias Not in any encode_* output; read platform from the file's page on encodeproject.org
Library preparation date Moderate -- reagent lots, operator variation Check the experiment's date_released field
Antibody lot High for ChIP-seq -- different enrichment profiles Not in any encode_* output; read the antibody lot reviews on the experiment's ENCODE page
Pipeline version Low-moderate -- different peak calling parameters Check pipelines[].version returned by encode_track_experiment
Read length Low-moderate -- affects mappability Not in any encode_* output; read read_length from the file's page on encodeproject.org

How to Detect Batch Effects

  1. PCA of signal: If the first principal component of signal tracks separates by lab (not by tissue), batch effects dominate
  2. Check housekeeping loci: H3K4me3 at housekeeping promoters should be consistent across tissues. If it varies, suspect technical confounders.
  3. CTCF as control: CTCF binding is ~70% constitutive. If CTCF shows tissue-specific differences that correlate with lab, suspect batch effects.

How to Mitigate

  • Use ENCODE uniform pipeline outputs: All experiments processed through the same pipeline are more comparable than custom-processed data
  • Match pipeline versions: Use files processed by the same pipeline version when possible
  • Use fold-change-over-control signal tracks: Normalized to input, reducing depth and background differences
  • Document all technical differences: In the comparison metadata, record every known technical difference between datasets

Step 6: Select Comparable Files

For each matched experiment, select files that are directly comparable:

# Get the recommended files for each experiment
encode_list_files(
    experiment_accession="ENCSR...",
    preferred_default=True,
    assembly="GRCh38"
)

ENCODE Blacklist filtering (required before comparison): Before any cross-tissue comparison, remove peaks and signal in ENCODE Blacklist regions (Amemiya et al. 2019, Scientific Reports, 1,372 citations). Blacklisted regions produce artifactual signal that appears consistent across tissues, inflating the count of "constitutive" elements. They can also show variable signal due to copy number differences between cell lines, creating false tissue-specific hits. Filter before comparison:

  • Human GRCh38: hg38-blacklist.v2.bed.gz from Boyle-Lab/Blacklist
  • Mouse mm10: mm10-blacklist.v2.bed.gz
  • Filter with: bedtools intersect -v -a peaks.bed -b blacklist.bed > peaks.filtered.bed

File Selection by Comparison Goal

Comparison Goal File Type Output Type Why
Peak overlap / tissue-specific peaks bed narrowPeak IDR thresholded peaks Binary: present or absent in each tissue
Quantitative signal comparison bigWig fold change over control Normalized signal; comparable across experiments
Differential expression tsv gene quantifications TPM/FPKM for cross-tissue expression comparison
Chromatin state annotation bed narrowPeak All histone marks Required for ChromHMM/chromatin state analysis
Visualization / heatmaps bigWig signal of unique reads Raw signal for deepTools or genome browser

Critical: Use Same Output Type Across All Tissues

Do NOT mix IDR thresholded peaks from one tissue with pseudoreplicated peaks from another. This introduces systematic differences in peak number and stringency that confound biological comparison.

Step 7: Build the Comparison Matrix

Assemble a structured metadata table for all experiments in the comparison:

| Biosample | Organ | Type | Assay | Target | Accession | Audit | Depth | Lab | Pipeline |
|-----------|-------|------|-------|--------|-----------|-------|-------|-----|----------|
| Pancreas  | pancreas | tissue | Histone ChIP | H3K27ac | ENCSR... | clean | 22M | Bernstein | v2.1 |
| Liver     | liver | tissue | Histone ChIP | H3K27ac | ENCSR... | warn  | 18M | Snyder | v2.1 |
| Brain     | brain | tissue | Histone ChIP | H3K27ac | ENCSR... | clean | 25M | Bernstein | v2.1 |

Use encode_summarize_collection after tracking all experiments for a bird's-eye view:

# After tracking all experiments
encode_summarize_collection()

Flag potential issues in the matrix:

  • Depth differences >2x between tissues
  • Different labs (batch effect risk)
  • Different pipeline versions
  • WARNING or ERROR audit flags
  • Missing data for some tissues (incomplete comparison)

Step 8: Suggest Analysis Strategies by Comparison Type

Tissue-Specific Elements

Peaks (or signals) present in one tissue but absent in others. The canonical approach:

  1. Download IDR thresholded peaks for each tissue
  2. Use bedtools intersect -v to find peaks unique to each tissue
  3. Annotate tissue-specific peaks with genomic features (promoter, enhancer, intergenic)
  4. Expect: enhancer peaks will be the most tissue-variable (Heintzman 2009, Andersson 2014)

Constitutive Elements

Peaks present across ALL tissues compared:

  1. Use bedtools multiintersect across all tissue peak files
  2. Filter for regions present in all (or N-1) tissues
  3. Expect: promoters and CTCF sites will dominate constitutive elements
  4. Use as positive controls to verify comparison pipeline

Differential Quantitative Analysis

For continuous signal comparison across tissues:

  1. Download fold-change-over-control bigWig files for each tissue
  2. Use deepTools multiBigwigSummary to compute genome-wide signal matrix
  3. PCA and hierarchical clustering to verify tissues separate by biology (not batch)
  4. Use deepTools plotHeatmap at tissue-specific peak sets to visualize differences

Disease vs Normal Comparison

  1. Match disease and normal samples on demographics (age, sex, life_stage)
  2. Use encode_search_experiments with treatment or biosample filters
  3. Be aware that disease samples may have altered cell-type composition
  4. Differential peaks may reflect composition changes, not regulatory rewiring

Developmental Time Course

  1. Use life_stage filter to find experiments at different developmental stages
  2. Order by developmental time (embryonic, child, adult)
  3. Track which elements gain or lose activity over development
  4. Roadmap Epigenomics (2015) provides reference developmental trajectories

Step 9: Document and Track with Provenance

Record the entire comparison design and results:

# Track all experiments in the comparison
encode_track_experiment(accession="ENCSR_tissue1", notes="Cross-tissue H3K27ac comparison - pancreas")
encode_track_experiment(accession="ENCSR_tissue2", notes="Cross-tissue H3K27ac comparison - liver")

# Log any derived comparison files
encode_log_derived_file(
    file_path="/path/to/tissue_specific_peaks.bed",
    source_accessions=["ENCSR_tissue1", "ENCSR_tissue2"],
    description="Pancreas-specific H3K27ac peaks not found in liver",
    file_type="differential_peaks",
    tool_used="bedtools intersect v2.31.0",
    parameters="bedtools intersect -a pancreas.bed -b liver.bed -v"
)

# Link relevant publications
encode_link_reference(
    experiment_accession="ENCSR_tissue1",
    reference_type="doi",
    reference_id="10.1038/nature14248",
    description="Roadmap Epigenomics reference for cross-tissue comparison methodology"
)

Pitfalls and Common Mistakes

  1. Confounding batch with biology: If all pancreas experiments come from Lab A and all liver experiments from Lab B, you cannot distinguish tissue differences from lab effects. Check lab metadata before interpreting any cross-tissue difference. Leek et al. (2010) showed that batch effects can dominate over 50% of total variation.

  2. Mixing biosample types: Comparing K562 (cell line) H3K27ac with primary liver tissue H3K27ac conflates transformation-driven changes with tissue-specific regulation. Always compare within the same biosample type when possible.

  3. Assembly mismatch: ALL files in a comparison must use the same genome assembly. GRCh38 and hg19 coordinates are NOT compatible. Use encode_compare_experiments to catch this.

  4. Ignoring cell-type heterogeneity: Bulk tissue samples contain mixed cell populations. A "pancreas-specific" peak might actually be present in a minority cell type (e.g., delta cells). Single-cell data (scATAC-seq, scRNA-seq) can deconvolve this, but is not available for all tissues in ENCODE.

  5. Depth-driven false differences: A deeply sequenced tissue will have more peaks called than a shallowly sequenced one, even if the underlying biology is identical. Always check sequencing depth and prefer normalized signal (fold change over control) for quantitative comparisons.

  6. Incomplete panel comparison: Comparing 5 histone marks in tissue A but only 3 in tissue B produces a biased view. Document which marks are available in each tissue and restrict comparison to the intersection of available assays.

Walkthrough: Comparing Epigenomic Landscapes Between Normal and Cancer Tissues

Goal: Systematically compare ENCODE epigenomic data between normal tissue and cancer cell lines to identify disease-specific regulatory changes. Context: Comparing biosamples reveals which regulatory elements are gained or lost in disease states.

Step 1: Find experiments for both biosamples

encode_search_experiments(assay_title="Histone ChIP-seq", organ="liver", target="H3K27ac", organism="Homo sapiens")

Expected output (fields abridged):

{
  "results": [
    {"accession": "ENCSR100LIV", "assay_title": "Histone ChIP-seq", "target": "H3K27ac", "biosample_summary": "liver tissue male adult (54 years)", "biosample_type": "tissue", "assembly": ["GRCh38"]},
    {"accession": "ENCSR200HEP", "assay_title": "Histone ChIP-seq", "target": "H3K27ac", "biosample_summary": "HepG2", "biosample_type": "cell line", "assembly": ["GRCh38"]}
  ],
  "total": 8,
  "limit": 25,
  "offset": 0,
  "has_more": false,
  "next_offset": null
}

Step 2: Compare the two experiments

encode_compare_experiments(accession1="ENCSR100LIV", accession2="ENCSR200HEP")

Expected output (both experiments must be tracked first, or the tool returns {"error": "..."}):

{
  "experiment_1": {"accession": "ENCSR100LIV", "assay": "Histone ChIP-seq", "biosample": "liver tissue male adult (54 years)"},
  "experiment_2": {"accession": "ENCSR200HEP", "assay": "Histone ChIP-seq", "biosample": "HepG2"},
  "verdict": "COMPATIBLE_WITH_CAVEATS",
  "recommendation": "These experiments can be compared, but the warnings should be addressed in your analysis.",
  "compatible_aspects": [
    "Same organism: Homo sapiens",
    "Same assembly: GRCh38",
    "Same assay: Histone ChIP-seq",
    "Same target: H3K27ac"
  ],
  "issues": [],
  "warnings": [
    "Different biosample types: tissue vs cell line. Results may reflect sample type differences."
  ]
}

Matching metadata lands in compatible_aspects; differences are split between issues (blocking) and warnings (non-blocking), both as prose strings.

Step 3: Download peak files for both

encode_download_files(file_accessions=["ENCFF100LIV", "ENCFF200HEP"], download_dir="/data/comparison")

Step 4: Identify differential peaks

bedtools intersect -v -a liver_peaks.bed -b hepg2_peaks.bed > liver_specific.bed
bedtools intersect -v -a hepg2_peaks.bed -b liver_peaks.bed > hepg2_specific.bed
bedtools intersect -a liver_peaks.bed -b hepg2_peaks.bed > shared_peaks.bed

Interpretation: HepG2-specific H3K27ac peaks mark cancer-gained enhancers. Liver-specific peaks mark enhancers lost in cancer.

Integration with downstream skills

  • Differential peaks feed into peak-annotation for gene assignment
  • Biosample-specific enhancers connect to disease-research
  • Cell composition differences contextualized by cellxgene-context
  • Expression differences validated via gtex-expression

Code Examples

1. Compare two experiments

encode_compare_experiments(accession1="ENCSR100LIV", accession2="ENCSR200HEP")

Expected output:

{
  "experiment_1": {"accession": "ENCSR100LIV", "assay": "Histone ChIP-seq", "biosample": "liver tissue male adult (54 years)"},
  "experiment_2": {"accession": "ENCSR200HEP", "assay": "Histone ChIP-seq", "biosample": "HepG2"},
  "verdict": "COMPATIBLE_WITH_CAVEATS",
  "recommendation": "These experiments can be compared, but the warnings should be addressed in your analysis.",
  "compatible_aspects": ["Same assay: Histone ChIP-seq", "Same target: H3K27ac"],
  "issues": [],
  "warnings": ["Different biosample types: tissue vs cell line. Results may reflect sample type differences."]
}

2. Find matching experiments across biosamples

encode_search_experiments(assay_title="Histone ChIP-seq", target="H3K27ac", organism="Homo sapiens", limit=100)

Expected output (one entry per experiment; tally the biosample_summary / biosample_type values to see which biosamples are covered, or call encode_get_facets for the counts directly):

{
  "results": [
    {"accession": "ENCSR000AKA", "assay_title": "Histone ChIP-seq", "target": "H3K27ac", "biosample_summary": "K562", "biosample_type": "cell line"}
  ],
  "total": 142,
  "limit": 100,
  "offset": 0,
  "has_more": true,
  "next_offset": 100
}

3. Track compared experiments

encode_track_experiment(accession="ENCSR100LIV", notes="Liver H3K27ac - normal tissue control for HepG2 comparison")

Expected output (notes is stored, not echoed — read it back with encode_list_tracked):

{
  "tracking": {"accession": "ENCSR100LIV", "action": "tracked"},
  "publications_found": 1,
  "publications": [
    {"pmid": "32728249", "doi": "10.1038/s41586-020-2493-4", "title": "Expanded encyclopaedias of DNA elements in the human and mouse genomes", "authors": "Abascal F, Acosta R, Addleman NJ", "journal": "Nature", "year": "2020", "abstract": ""}
  ],
  "pipelines_found": 1,
  "pipelines": [
    {"title": "Histone ChIP-seq 2 (unreplicated)", "version": "1.7.1", "software": [{"name": "bowtie2", "version": "2.3.4.3"}], "status": "released"}
  ]
}

Integration

This skill produces... Feed into... Purpose
Differential peak sets peak-annotation Assign biosample-specific peaks to genes
Biosample-specific enhancers disease-research Identify disease-gained/lost regulatory elements
Shared regulatory elements regulatory-elements Define constitutive vs. tissue-specific cCREs
Cell composition context cellxgene-context Deconvolve tissue heterogeneity effects
Expression differences gtex-expression Validate regulatory changes with expression data
Comparison metadata data-provenance Document biosample comparison analysis
Differential regions variant-annotation Find variants in biosample-specific regulatory elements

Related Skills

  • integrative-analysis: Combine multiple data types (ChIP + RNA-seq + ATAC) within or across biosamples
  • epigenome-profiling: Build comprehensive epigenomic profiles for individual biosamples before comparing them
  • quality-assessment: Evaluate data quality for each experiment BEFORE including it in a cross-tissue comparison
  • histone-aggregation: Aggregate peaks across multiple experiments for the SAME tissue before cross-tissue comparison
  • accessibility-aggregation: Aggregate ATAC-seq/DNase-seq peaks across experiments for the SAME tissue
  • methylation-aggregation: Aggregate DNA methylation data across experiments for cross-tissue methylation comparison
  • regulatory-elements: Use tissue-specific peak sets to discover enhancers, promoters, and other cis-regulatory elements
  • single-cell-encode: Cell type-resolved data can deconvolve bulk cross-tissue comparisons
  • multi-omics-integration: Combine multiple ENCODE assay types for deeper regulatory characterization
  • data-provenance: Document all comparison parameters, tool versions, and results for reproducibility
  • publication-trust: Verify literature claims backing analytical decisions

Presenting Results

  • Present comparison as: metric | biosample_1 | biosample_2 | difference. Highlight significant differences. Include compatibility verdict (COMPATIBLE/WARNING/INCOMPATIBLE). Suggest: "Would you like to download the compatible experiments?"

For the request: "$ARGUMENTS"

Files (encode-toolkit)
  • references
    • literature.md 11 KB
      # Compare Biosamples — Literature References
      
      **Last updated:** 2026-03-07
      **Purpose:** Reference catalog for the compare-biosamples skill — key papers on tissue-specific
      regulatory landscapes, chromatin accessibility atlases, super-enhancer biology, differential
      enhancer analysis, and the comparative epigenomic frameworks for identifying what distinguishes
      one cell type or tissue from another using ENCODE data.
      
      The compare-biosamples skill enables side-by-side comparison of ENCODE experiments from different
      biosamples (tissues, cell lines, primary cells) to identify differential regulatory elements,
      tissue-specific enhancers, and shared vs. unique chromatin features. Biosample comparison is the
      foundation of understanding cell identity — what makes a hepatocyte different from a neuron is
      largely defined by which regulatory elements are active.
      
      These 8 papers are organized into four groups: (1) reference frameworks that establish the
      baseline for cross-tissue comparison, (2) accessibility as the primary comparison metric,
      (3) the biosample hierarchy and its implications for interpretation, and (4) the molecular
      mechanisms of tissue-specific enhancer selection.
      
      ---
      
      ## Reference Frameworks for Cross-Tissue Comparison
      
      Meaningful biosample comparison requires reference data that spans a broad range of tissue
      types profiled with consistent protocols. The three papers below provide the reference
      frameworks — Roadmap Epigenomics (111 epigenomes), single-cell accessibility (30 tissues),
      and ENCODE Phase 3 (>500 biosamples) — that the compare-biosamples skill uses as baselines.
      
      ---
      
      ### Kundaje et al. 2015 — Roadmap Epigenomics: 111 epigenomes as comparison baseline
      
      - **Citation:** Kundaje A, Meuleman W, Ernst J, Bilenky M, Yen A, et al. Integrative analysis
        of 111 reference human epigenomes. *Nature*, 518(7539), 317-330, 2015.
      - **DOI:** [10.1038/nature14248](https://doi.org/10.1038/nature14248)
      - **PMID:** 25693563 | **PMC:** PMC4530010
      - **Citations:** ~4,500
      - **Key findings:** Produced the definitive cross-tissue epigenomic comparison, revealing that
        enhancer usage is the primary axis of variation between tissues while promoter activity is
        largely constitutive. Key findings for biosample comparison:
        - Each tissue has 50,000-100,000 active enhancers defining its regulatory identity
        - Tissue-specific enhancers cluster into modules associated with tissue-specific TFs
        - These modules are enriched for disease variants relevant to the corresponding tissue
        - Promoter states are ~80% shared across tissues; enhancer states are ~80% tissue-specific
      
        The compare-biosamples skill uses these 111 reference epigenomes as the baseline for
        cross-tissue comparison, enabling users to determine whether a given element is
        tissue-specific or constitutive.
      
      ---
      
      ### Corces et al. 2020 — Single-cell chromatin accessibility atlas across tissues
      
      - **Citation:** Corces MR, Shcherbina A, Kundu S, Gloudemans MJ, et al. Single-cell epigenomic
        analyses implicate candidate causal variants at inherited risk loci for Alzheimer's and
        Parkinson's diseases. *Nature Genetics*, 52(11), 1158-1168, 2020.
      - **DOI:** [10.1038/s41588-020-00721-x](https://doi.org/10.1038/s41588-020-00721-x)
      - **PMID:** 33106633 | **PMC:** PMC7887218
      - **Citations:** ~1,500
      - **Key findings:** Generated a single-cell accessibility atlas across 30 adult human tissues,
        resolving cell-type-specific landscapes within complex mixtures. Demonstrated that bulk
        tissue profiles are composites of distinct cell populations, and that cell-type-resolved
        analysis dramatically improves GWAS variant enrichment specificity. For biosample
        comparison, this atlas enables deconvolution of bulk ENCODE data, revealing whether
        differences between tissues arise from changes in cell composition or cell-intrinsic
        regulatory changes. The compare-biosamples skill recommends using single-cell reference
        data when comparing tissues with mixed cell populations.
      
      ---
      
      ### ENCODE Project Consortium 2020 — Phase 3 expanded biosample catalog
      
      - **Citation:** The ENCODE Project Consortium, Moore JE, Purcaro MJ, et al. Expanded
        encyclopaedias of DNA elements in the human and mouse genomes. *Nature*, 583(7818),
        699-710, 2020.
      - **DOI:** [10.1038/s41586-020-2493-4](https://doi.org/10.1038/s41586-020-2493-4)
      - **PMID:** 32728249 | **PMC:** PMC7410828
      - **Citations:** ~1,200
      - **Key findings:** Expanded to >500 biosamples with consistent cCRE annotations enabling
        systematic cross-biosample comparison. Introduced the cell-type activity matrix — binary
        encoding of cCRE activity (high/low signal) across all profiled biosamples. Key statistics:
        - >60% of cCREs show cell-type-restricted activity
        - ~15% active across most cell types (constitutive)
        - ~25% active in a small number of related cell types
      
        The compare-biosamples skill queries this activity matrix to identify differential cCREs
        between user-specified biosamples.
      
      ---
      
      ## Chromatin Accessibility as the Comparison Metric
      
      Chromatin accessibility (DNase-seq or ATAC-seq) is the most direct and unbiased measure of
      regulatory element activity. Unlike histone marks, which require different antibodies for each
      mark, accessibility assays capture the full regulatory landscape in a single experiment.
      
      ---
      
      ### Thurman et al. 2012 — DHS patterns defining cell-type identity
      
      - **Citation:** Thurman RE, Rynes E, Humbert R, Vierstra J, Maurano MT, et al. The accessible
        chromatin landscape of the human genome. *Nature*, 489(7414), 75-82, 2012.
      - **DOI:** [10.1038/nature11232](https://doi.org/10.1038/nature11232)
      - **PMID:** 22955617 | **PMC:** PMC3721348
      - **Citations:** ~2,800
      - **Key findings:** Mapped 2.89 million unique DHSs across 125 cell types and demonstrated that
        DHS patterns alone classify cell types into lineage groups with high accuracy. Key findings:
        - DHSs cluster into "stereotyped modules" of co-accessible sites
        - Modules correspond to known TF networks (PU.1/GATA in blood, HNF in liver)
        - Only ~5% of DHSs are ubiquitous across cell types
        - ~25% are found in a single cell type
      
        For biosample comparison, DHS/ATAC-seq overlap is the most direct similarity measure. The
        compare-biosamples skill uses accessibility overlap as the primary metric, computing Jaccard
        index and overlap coefficients between biosample peak sets.
      
      ---
      
      ## NIH Roadmap and Biosample Hierarchy
      
      The interpretation of biosample comparisons depends on the biological relationship between the
      compared samples. Comparing two tissues (liver vs. brain) reveals organ-level regulatory
      differences. Comparing cell types within a tissue (hepatocyte vs. stellate cell) reveals
      cell-type-specific programs. Comparing a cell line to its tissue of origin reveals culture
      artifacts.
      
      ---
      
      ### Bernstein et al. 2010 — NIH Roadmap establishing the biosample hierarchy
      
      - **Citation:** Bernstein BE, Stamatoyannopoulos JA, Costello JF, et al. The NIH Roadmap
        Epigenomics Mapping Consortium. *Nature Biotechnology*, 28(10), 1045-1048, 2010.
      - **DOI:** [10.1038/nbt1010-1045](https://doi.org/10.1038/nbt1010-1045)
      - **PMID:** 20944595 | **PMC:** PMC3607281
      - **Citations:** ~2,500
      - **Key findings:** Established the biosample hierarchy for systematic comparison:
        - Primary tissues: organ-level regulation (most physiologically relevant)
        - Primary cells: cell-type-specific regulation within a tissue
        - Cell lines: experimentally tractable but may have culture artifacts
        - In vitro differentiated cells: developmental trajectory models
      
        This hierarchy determines biological interpretation of comparisons. The compare-biosamples
        skill applies this framework, warning users when comparing across hierarchy levels
        (e.g., cell line vs. tissue) that differences may reflect culture artifacts rather than
        genuine regulatory variation.
      
      ---
      
      ## Tissue-Specific Enhancer Biology
      
      The molecular mechanisms that create tissue-specific regulatory landscapes involve lineage-
      determining transcription factors, super-enhancer formation, and histone mark dynamics. These
      papers explain why biosamples differ and what the differences mean biologically.
      
      ---
      
      ### Zhu et al. 2016 — H3K27ac-defined tissue-specific enhancers
      
      - **Citation:** Zhu J, Adli M, Zou JY, Verstappen G, et al. Tissue-specific enhancers
        identified by H3K27ac across reference epigenomes. *Genome Biology*, 17, 32, 2016.
      - **DOI:** [10.1186/s13059-016-0974-4](https://doi.org/10.1186/s13059-016-0974-4)
      - **PMID:** 27040513 | **PMC:** PMC4818977
      - **Citations:** ~800
      - **Key findings:** Used H3K27ac across Roadmap reference epigenomes to define tissue-specific
        enhancer catalogs. Each tissue has 10,000-30,000 differentially active enhancers enriched
        for tissue-specific TF motifs. Developed computational methods for predicting enhancer-gene
        linkage from H3K27ac signal correlation across tissues. The compare-biosamples skill uses
        H3K27ac differential analysis as the primary method for identifying tissue-specific elements,
        as H3K27ac shows the strongest tissue-specific variation among histone marks.
      
      ---
      
      ### Hnisz et al. 2013 — Super-enhancers defining cell identity
      
      - **Citation:** Hnisz D, Abraham BJ, Lee TI, et al. Super-enhancers in the control of cell
        identity and disease. *Cell*, 155(4), 934-947, 2013.
      - **DOI:** [10.1016/j.cell.2013.09.053](https://doi.org/10.1016/j.cell.2013.09.053)
      - **PMID:** 24119843 | **PMC:** PMC3841062
      - **Citations:** ~3,500
      - **Key findings:** Defined super-enhancers as large enhancer clusters (>10kb) with exceptionally
        high Mediator/H3K27ac/BRD4 occupancy driving cell-identity genes. Key characteristics:
        - Each cell type has ~200-500 super-enhancers
        - Control master TFs and signature gene programs
        - Highly cell-type-specific (more discriminating than typical enhancers)
        - Disease variants enriched in relevant cell type's super-enhancers
      
        For biosample comparison, super-enhancer catalogs provide the most discriminating features.
        Two cell types may share 80% of typical enhancers but differ in super-enhancers. The
        compare-biosamples skill identifies differential super-enhancers as a key output.
      
      ---
      
      ### Heinz et al. 2015 — TF-driven enhancer selection mechanisms
      
      - **Citation:** Heinz S, Romanoski CE, Benner C, Glass CK. The selection and function of
        cell type-specific enhancers. *Nature Reviews Molecular Cell Biology*, 16(3),
        144-154, 2015.
      - **DOI:** [10.1038/nrm3949](https://doi.org/10.1038/nrm3949)
      - **PMID:** 25650801 | **PMC:** PMC4517609
      - **Citations:** ~1,200
      - **Key findings:** Reviewed how lineage-determining TFs (LDTFs) select cell-type-specific
        enhancers from the genomic complement. LDTFs (PU.1 in macrophages, GATA in erythrocytes)
        bind collaboratively to establish cell-type-specific landscapes, while signal-dependent TFs
        (SDTFs) further modulate activity. This hierarchical model explains why differences
        concentrate at enhancers rather than promoters — enhancer selection is the primary mechanism
        of cell identity. The compare-biosamples skill uses this framework to interpret differential
        elements, linking observed differences to predicted master TF drivers through motif
        enrichment analysis.
      
      ---
      
  • SKILL.md 28.9 KB
    ---
    name: compare-biosamples
    description: Compare ENCODE experiments across different biosamples, tissues, or cell lines to identify tissue-specific regulatory patterns. Use when the user wants cross-tissue comparison, cell-type comparison, tissue-specific elements, differential chromatin, biosample matching, disease vs normal comparison, developmental time course, constitutive vs variable regulation, or multi-tissue data availability mapping. Handles batch effect detection, biosample hierarchy, and comparison design.
    ---
    
    # Compare ENCODE Data Across Biosamples
    
    ## When to Use
    
    - User wants to compare ENCODE experiments across different tissues, cell lines, or biosamples
    - User asks about "tissue comparison", "cell-type differences", "tissue-specific enhancers", or "cross-tissue"
    - User needs to identify constitutive vs tissue-specific regulatory elements
    - User wants to map data availability across multiple biosamples before integrative analysis
    - Example queries: "compare H3K27ac between liver and pancreas", "what marks are tissue-specific?", "find constitutive promoters across all tissues"
    
    Help the user systematically compare data availability and experiments across different biosamples to identify tissue-specific regulatory patterns, constitutive elements, and cross-tissue differences.
    
    ## Scientific Rationale
    
    Cross-biosample comparison is the foundation of understanding tissue-specific gene regulation. Regulatory elements -- particularly enhancers -- are the primary drivers of cell-type identity, with promoters being largely shared across tissues. Comparing the same assay across multiple biosamples reveals which regulatory elements are constitutive (shared) versus tissue-specific (unique to one or few cell types).
    
    **The core question**: "Which regulatory features distinguish tissue A from tissue B, and which are shared?"
    
    This requires careful matching of datasets, awareness of batch effects, and understanding of the biosample hierarchy to avoid confounding biological signal with technical variation.
    
    ## Literature Foundation
    
    | # | Reference | Key Contribution |
    |---|-----------|-----------------|
    | 1 | Roadmap Epigenomics Consortium 2015, Nature, DOI:10.1038/nature14248 (~5,810 cit) | Generated 111 reference epigenomes across tissues/cell types; established the framework for cross-tissue epigenomic comparison. Showed that enhancer chromatin states are the most tissue-variable elements. |
    | 2 | ENCODE Phase 3 2020, Nature, DOI:10.1038/s41586-020-2493-4 (~1,656 cit) | Expanded functional annotations to 1.3M candidate cis-regulatory elements (cCREs) across hundreds of biosamples; defined tissue-activity indices for regulatory elements. |
    | 3 | Andersson et al. 2014, Nature, DOI:10.1038/nature12787 (~1,500 cit) | FANTOM5 atlas of active enhancers across 808 samples; demonstrated that only ~5% of enhancers are active across all tissues, with the majority being highly tissue-specific. |
    | 4 | Heintzman et al. 2009, Nature, DOI:10.1038/nature07917 (~2,200 cit) | Showed histone modifications distinguish cell types: H3K4me1/H3K27ac at enhancers are the most discriminating tissue-specific marks, while H3K4me3 at promoters is largely shared. |
    | 5 | Thurman et al. 2012, Nature, DOI:10.1038/nature11232 (~2,000 cit) | Mapped accessible chromatin across 125 cell types; demonstrated that DNase I hypersensitive sites define cell-type identity and that accessibility patterns cluster by tissue of origin. |
    | 6 | Leek et al. 2010, Nat Rev Genet, DOI:10.1038/nrg2825 (~1,200 cit) | Comprehensive review of batch effects in genomic data; showed that lab, platform, and processing date can dominate biological variation if not properly controlled. |
    | 7 | Forrest et al. 2014, Nature, DOI:10.1038/nature13182 (~1,100 cit) | FANTOM5 promoter-level expression atlas across 975 samples; demonstrated that promoter usage (not just gene expression) is tissue-specific and defines cell identity. |
    
    ## Tissue-Specific Regulation Principles
    
    Understanding what varies across tissues and what does not is essential before designing a comparison.
    
    ### What Is Shared vs Tissue-Specific (Heintzman 2009; Andersson 2014)
    
    | Feature | Cross-Tissue Behavior | Implication for Comparison |
    |---------|----------------------|---------------------------|
    | **Promoters (H3K4me3)** | Largely shared (~70% active in most tissues) | Poor discriminators between tissues |
    | **Enhancers (H3K27ac + H3K4me1)** | Highly tissue-specific (~5% shared across all tissues) | Best discriminators; focus comparison here |
    | **Chromatin accessibility (ATAC/DNase)** | Moderate tissue-specificity (~20-30% shared) | Good secondary discriminator; clusters by tissue of origin |
    | **Polycomb repression (H3K27me3)** | Tissue-specific (marks silenced developmental genes) | Useful for identifying repressed lineage programs |
    | **Gene expression (RNA-seq)** | Moderate tissue-specificity | Housekeeping genes shared; tissue-specific TFs are key |
    | **CTCF binding** | Largely constitutive (~70% conserved) | Defines structural boundaries; less tissue-variable |
    | **DNA methylation** | Bimodal; enhancers show tissue-variable methylation | Hypomethylation at active enhancers is tissue-specific |
    
    ### Key Insight
    
    H3K27ac at enhancers is the single most informative mark for distinguishing tissues (Heintzman et al. 2009, Roadmap 2015). If the user can only compare one mark across tissues, H3K27ac should be the first choice, followed by chromatin accessibility (ATAC-seq or DNase-seq).
    
    ## ENCODE Biosample Hierarchy
    
    | Level | Description | Biological Relevance | Reproducibility | Caveats |
    |-------|-------------|---------------------|-----------------|---------|
    | **Tissue** | Primary tissue from donor (e.g., pancreas, liver) | Highest -- in vivo biology preserved | Lower -- donor variation, cell-type heterogeneity | Mixed cell populations; composition varies by donor age/sex/health |
    | **Primary cell** | Cells isolated from tissue (e.g., hepatocytes, islets) | High -- enriched for cell type | Moderate -- isolation stress, limited passages | Isolation method alters phenotype; culture conditions matter |
    | **Cell line** | Immortalized cells (e.g., K562, HepG2, GM12878) | Lower -- transformed phenotype | Highest -- clonal, reproducible | May not represent normal tissue biology; passage number matters |
    | **In vitro differentiated** | Cells derived from stem cells (e.g., iPSC-derived cardiomyocytes) | Moderate -- model system | Moderate -- protocol-dependent | Differentiation efficiency varies; often immature phenotype |
    | **Organoid** | 3D self-organizing structures | Moderate-high -- recapitulates tissue architecture | Lower -- heterogeneous | Emerging data type in ENCODE; limited coverage |
    
    ### Tier 1 Cell Lines (Most Comprehensive ENCODE Data)
    
    | Cell Line | Origin | Cancer/Normal | Best For |
    |-----------|--------|--------------|----------|
    | **K562** | Chronic myelogenous leukemia | Cancer | Hematopoietic chromatin, TF binding, 3D genome |
    | **GM12878** | Lymphoblastoid (EBV-transformed B cells) | Transformed-normal | Immune regulation, 3D genome (Rao et al. 2014 Hi-C reference) |
    | **H1-hESC** | Human embryonic stem cells | Normal | Developmental regulation, bivalent chromatin |
    
    These three cell lines have the most complete multi-omic profiling in ENCODE. They are excellent positive controls for verifying comparison pipelines before applying to user-specific tissues.
    
    ### Biosample Comparability Rules
    
    - **Same biosample type preferred**: Compare tissue-to-tissue, cell line-to-cell line
    - **Cross-type comparisons require caution**: Cell line vs tissue introduces both biological and technical confounders
    - **Donor matching**: When comparing tissues, match for life_stage, sex, and age when possible
    - **Passage number matters for cell lines**: Different passages of the same cell line can diverge epigenomically
    
    ## Step 1: Define the Comparison Design
    
    Clarify the comparison type with the user. Each design has different requirements:
    
    ### Comparison Design Patterns
    
    | Design | Description | Required Matching | Key Tools | Best File Types |
    |--------|-------------|-------------------|-----------|----------------|
    | **Cross-tissue (same assay)** | Same mark/assay in different organs | Same assay, same target, same assembly, same biosample_type | `encode_search_experiments`, `encode_get_facets` | IDR thresholded peaks, fold change over control |
    | **Multi-omic (same tissue)** | Multiple assays in one biosample | Same biosample_term_name, same assembly | `encode_get_facets`, `encode_search_experiments` | Depends on assay |
    | **Disease vs normal** | Pathological vs healthy tissue | Same organ, same assay, matched demographics | `encode_search_experiments` with biosample filter | IDR thresholded peaks, gene quantifications |
    | **Developmental time course** | Same tissue at different life stages | Same organ, same assay, different life_stage | `encode_search_experiments` with life_stage filter | Signal tracks, gene quantifications |
    | **Cell line vs primary tissue** | Transformed vs in vivo | Same organ of origin, same assay | `encode_search_experiments`, `encode_compare_experiments` | IDR thresholded peaks |
    | **Cross-species** | Human vs mouse homologous tissues | Same organ, same assay, different organism | `encode_search_experiments` with organism filter | Requires liftOver; use signal tracks |
    
    Ask the user: "What tissues/cell types are you comparing, and what assay are you focusing on?"
    
    ## Step 2: Map Data Availability Across Biosamples
    
    Use `encode_get_facets` to build an availability matrix before searching for specific experiments.
    
    ### 2a. Check What Exists for Each Biosample
    
    ```
    # For each tissue of interest, discover available assays and targets
    encode_get_facets(organ="pancreas")
    encode_get_facets(organ="liver")
    encode_get_facets(organ="brain")
    ```
    
    ### 2b. Check What Exists for a Specific Assay Across Tissues
    
    ```
    # See which organs have Histone ChIP-seq data
    encode_get_facets(assay_title="Histone ChIP-seq")
    
    # See which organs have ATAC-seq data
    encode_get_facets(assay_title="ATAC-seq")
    ```
    
    ### 2c. Build the Availability Matrix
    
    Present to the user a matrix like:
    
    | Assay / Target | Pancreas tissue | Liver tissue | Brain tissue | K562 | GM12878 |
    |---------------|:-:|:-:|:-:|:-:|:-:|
    | H3K27ac ChIP-seq | 3 exp | 5 exp | 8 exp | 12 exp | 10 exp |
    | H3K4me3 ChIP-seq | 2 exp | 4 exp | 6 exp | 11 exp | 9 exp |
    | ATAC-seq | 1 exp | 3 exp | 5 exp | 4 exp | 3 exp |
    | RNA-seq | 4 exp | 6 exp | 10 exp | 15 exp | 8 exp |
    | WGBS | 0 | 2 exp | 3 exp | 2 exp | 2 exp |
    
    Highlight gaps: "Pancreas has no WGBS data -- comparison of methylation patterns will be limited to liver and brain."
    
    ## Step 3: Identify Matched Datasets
    
    For a valid cross-tissue comparison, datasets must be matched on technical parameters. Search each tissue:
    
    ```
    encode_search_experiments(
        assay_title="Histone ChIP-seq",
        target="H3K27ac",
        organ="pancreas",
        biosample_type="tissue",
        limit=50
    )
    ```
    
    ### Matching Criteria Checklist
    
    For each experiment pair across tissues, verify:
    
    | Parameter | Must Match? | How to Check |
    |-----------|:-:|-------------|
    | Assay title | Yes | Search filter |
    | Target (for ChIP) | Yes | Search filter |
    | Genome assembly | Yes | File metadata; use GRCh38 |
    | Biosample type | Recommended | Search filter |
    | Organism | Yes | Search filter |
    | Life stage | Recommended | Experiment metadata |
    | Sex | Preferred | Experiment metadata |
    | Pipeline version | Preferred | `encode_get_experiment` |
    | Sequencing depth | Comparable (within 2x) | File metadata |
    | Read length | Preferred | File metadata |
    
    ## Step 4: Check Pairwise Compatibility
    
    Track candidate experiments and use `encode_compare_experiments` for each cross-tissue pair:
    
    ```
    # Track experiments from each tissue
    encode_track_experiment(accession="ENCSR_pancreas")
    encode_track_experiment(accession="ENCSR_liver")
    
    # Check compatibility
    encode_compare_experiments(
        accession1="ENCSR_pancreas",
        accession2="ENCSR_liver"
    )
    ```
    
    The compatibility tool checks:
    - Organism match
    - Assembly match
    - Assay type match
    - Biosample differences (expected for cross-tissue comparison)
    - Target match
    - Replication strategy
    - Lab differences (potential batch effect source)
    
    **For cross-tissue comparison**: Biosample mismatch is *expected* -- it is the variable of interest. Focus on ensuring all other parameters match.
    
    ## Step 5: Assess and Control for Batch Effects (Leek et al. 2010)
    
    Batch effects are the most common confounder in cross-biosample comparisons. When experiments come from different labs, platforms, or processing dates, technical variation can dominate biological signal.
    
    ### Known Batch Effect Sources
    
    | Source | Impact | Detection Method |
    |--------|--------|-----------------|
    | **Lab of origin** | High -- different protocols, antibodies, cell handling | Check `lab` field; PCA of signal should not cluster by lab |
    | **Sequencing platform** | Moderate -- read quality, GC bias | Not in any `encode_*` output; read `platform` from the file's page on encodeproject.org |
    | **Library preparation date** | Moderate -- reagent lots, operator variation | Check the experiment's `date_released` field |
    | **Antibody lot** | High for ChIP-seq -- different enrichment profiles | Not in any `encode_*` output; read the antibody lot reviews on the experiment's ENCODE page |
    | **Pipeline version** | Low-moderate -- different peak calling parameters | Check `pipelines[].version` returned by `encode_track_experiment` |
    | **Read length** | Low-moderate -- affects mappability | Not in any `encode_*` output; read `read_length` from the file's page on encodeproject.org |
    
    ### How to Detect Batch Effects
    
    1. **PCA of signal**: If the first principal component of signal tracks separates by lab (not by tissue), batch effects dominate
    2. **Check housekeeping loci**: H3K4me3 at housekeeping promoters should be consistent across tissues. If it varies, suspect technical confounders.
    3. **CTCF as control**: CTCF binding is ~70% constitutive. If CTCF shows tissue-specific differences that correlate with lab, suspect batch effects.
    
    ### How to Mitigate
    
    - **Use ENCODE uniform pipeline outputs**: All experiments processed through the same pipeline are more comparable than custom-processed data
    - **Match pipeline versions**: Use files processed by the same pipeline version when possible
    - **Use fold-change-over-control signal tracks**: Normalized to input, reducing depth and background differences
    - **Document all technical differences**: In the comparison metadata, record every known technical difference between datasets
    
    ## Step 6: Select Comparable Files
    
    For each matched experiment, select files that are directly comparable:
    
    ```
    # Get the recommended files for each experiment
    encode_list_files(
        experiment_accession="ENCSR...",
        preferred_default=True,
        assembly="GRCh38"
    )
    ```
    
    **ENCODE Blacklist filtering (required before comparison)**: Before any cross-tissue comparison, remove peaks and signal in ENCODE Blacklist regions (Amemiya et al. 2019, Scientific Reports, 1,372 citations). Blacklisted regions produce artifactual signal that appears consistent across tissues, inflating the count of "constitutive" elements. They can also show variable signal due to copy number differences between cell lines, creating false tissue-specific hits. Filter before comparison:
    - Human GRCh38: `hg38-blacklist.v2.bed.gz` from [Boyle-Lab/Blacklist](https://github.com/Boyle-Lab/Blacklist)
    - Mouse mm10: `mm10-blacklist.v2.bed.gz`
    - Filter with: `bedtools intersect -v -a peaks.bed -b blacklist.bed > peaks.filtered.bed`
    
    ### File Selection by Comparison Goal
    
    | Comparison Goal | File Type | Output Type | Why |
    |----------------|-----------|-------------|-----|
    | Peak overlap / tissue-specific peaks | bed narrowPeak | IDR thresholded peaks | Binary: present or absent in each tissue |
    | Quantitative signal comparison | bigWig | fold change over control | Normalized signal; comparable across experiments |
    | Differential expression | tsv | gene quantifications | TPM/FPKM for cross-tissue expression comparison |
    | Chromatin state annotation | bed narrowPeak | All histone marks | Required for ChromHMM/chromatin state analysis |
    | Visualization / heatmaps | bigWig | signal of unique reads | Raw signal for deepTools or genome browser |
    
    ### Critical: Use Same Output Type Across All Tissues
    
    Do NOT mix IDR thresholded peaks from one tissue with pseudoreplicated peaks from another. This introduces systematic differences in peak number and stringency that confound biological comparison.
    
    ## Step 7: Build the Comparison Matrix
    
    Assemble a structured metadata table for all experiments in the comparison:
    
    ```
    | Biosample | Organ | Type | Assay | Target | Accession | Audit | Depth | Lab | Pipeline |
    |-----------|-------|------|-------|--------|-----------|-------|-------|-----|----------|
    | Pancreas  | pancreas | tissue | Histone ChIP | H3K27ac | ENCSR... | clean | 22M | Bernstein | v2.1 |
    | Liver     | liver | tissue | Histone ChIP | H3K27ac | ENCSR... | warn  | 18M | Snyder | v2.1 |
    | Brain     | brain | tissue | Histone ChIP | H3K27ac | ENCSR... | clean | 25M | Bernstein | v2.1 |
    ```
    
    Use `encode_summarize_collection` after tracking all experiments for a bird's-eye view:
    
    ```
    # After tracking all experiments
    encode_summarize_collection()
    ```
    
    Flag potential issues in the matrix:
    - Depth differences >2x between tissues
    - Different labs (batch effect risk)
    - Different pipeline versions
    - WARNING or ERROR audit flags
    - Missing data for some tissues (incomplete comparison)
    
    ## Step 8: Suggest Analysis Strategies by Comparison Type
    
    ### Tissue-Specific Elements
    
    Peaks (or signals) present in one tissue but absent in others. The canonical approach:
    
    1. Download IDR thresholded peaks for each tissue
    2. Use `bedtools intersect -v` to find peaks unique to each tissue
    3. Annotate tissue-specific peaks with genomic features (promoter, enhancer, intergenic)
    4. Expect: enhancer peaks will be the most tissue-variable (Heintzman 2009, Andersson 2014)
    
    ### Constitutive Elements
    
    Peaks present across ALL tissues compared:
    
    1. Use `bedtools multiintersect` across all tissue peak files
    2. Filter for regions present in all (or N-1) tissues
    3. Expect: promoters and CTCF sites will dominate constitutive elements
    4. Use as positive controls to verify comparison pipeline
    
    ### Differential Quantitative Analysis
    
    For continuous signal comparison across tissues:
    
    1. Download fold-change-over-control bigWig files for each tissue
    2. Use deepTools `multiBigwigSummary` to compute genome-wide signal matrix
    3. PCA and hierarchical clustering to verify tissues separate by biology (not batch)
    4. Use deepTools `plotHeatmap` at tissue-specific peak sets to visualize differences
    
    ### Disease vs Normal Comparison
    
    1. Match disease and normal samples on demographics (age, sex, life_stage)
    2. Use `encode_search_experiments` with treatment or biosample filters
    3. Be aware that disease samples may have altered cell-type composition
    4. Differential peaks may reflect composition changes, not regulatory rewiring
    
    ### Developmental Time Course
    
    1. Use life_stage filter to find experiments at different developmental stages
    2. Order by developmental time (embryonic, child, adult)
    3. Track which elements gain or lose activity over development
    4. Roadmap Epigenomics (2015) provides reference developmental trajectories
    
    ## Step 9: Document and Track with Provenance
    
    Record the entire comparison design and results:
    
    ```
    # Track all experiments in the comparison
    encode_track_experiment(accession="ENCSR_tissue1", notes="Cross-tissue H3K27ac comparison - pancreas")
    encode_track_experiment(accession="ENCSR_tissue2", notes="Cross-tissue H3K27ac comparison - liver")
    
    # Log any derived comparison files
    encode_log_derived_file(
        file_path="/path/to/tissue_specific_peaks.bed",
        source_accessions=["ENCSR_tissue1", "ENCSR_tissue2"],
        description="Pancreas-specific H3K27ac peaks not found in liver",
        file_type="differential_peaks",
        tool_used="bedtools intersect v2.31.0",
        parameters="bedtools intersect -a pancreas.bed -b liver.bed -v"
    )
    
    # Link relevant publications
    encode_link_reference(
        experiment_accession="ENCSR_tissue1",
        reference_type="doi",
        reference_id="10.1038/nature14248",
        description="Roadmap Epigenomics reference for cross-tissue comparison methodology"
    )
    ```
    
    ## Pitfalls and Common Mistakes
    
    1. **Confounding batch with biology**: If all pancreas experiments come from Lab A and all liver experiments from Lab B, you cannot distinguish tissue differences from lab effects. Check lab metadata before interpreting any cross-tissue difference. Leek et al. (2010) showed that batch effects can dominate over 50% of total variation.
    
    2. **Mixing biosample types**: Comparing K562 (cell line) H3K27ac with primary liver tissue H3K27ac conflates transformation-driven changes with tissue-specific regulation. Always compare within the same biosample type when possible.
    
    3. **Assembly mismatch**: ALL files in a comparison must use the same genome assembly. GRCh38 and hg19 coordinates are NOT compatible. Use `encode_compare_experiments` to catch this.
    
    4. **Ignoring cell-type heterogeneity**: Bulk tissue samples contain mixed cell populations. A "pancreas-specific" peak might actually be present in a minority cell type (e.g., delta cells). Single-cell data (scATAC-seq, scRNA-seq) can deconvolve this, but is not available for all tissues in ENCODE.
    
    5. **Depth-driven false differences**: A deeply sequenced tissue will have more peaks called than a shallowly sequenced one, even if the underlying biology is identical. Always check sequencing depth and prefer normalized signal (fold change over control) for quantitative comparisons.
    
    6. **Incomplete panel comparison**: Comparing 5 histone marks in tissue A but only 3 in tissue B produces a biased view. Document which marks are available in each tissue and restrict comparison to the intersection of available assays.
    
    ## Walkthrough: Comparing Epigenomic Landscapes Between Normal and Cancer Tissues
    
    **Goal**: Systematically compare ENCODE epigenomic data between normal tissue and cancer cell lines to identify disease-specific regulatory changes.
    **Context**: Comparing biosamples reveals which regulatory elements are gained or lost in disease states.
    
    ### Step 1: Find experiments for both biosamples
    
    ```
    encode_search_experiments(assay_title="Histone ChIP-seq", organ="liver", target="H3K27ac", organism="Homo sapiens")
    ```
    
    Expected output (fields abridged):
    ```json
    {
      "results": [
        {"accession": "ENCSR100LIV", "assay_title": "Histone ChIP-seq", "target": "H3K27ac", "biosample_summary": "liver tissue male adult (54 years)", "biosample_type": "tissue", "assembly": ["GRCh38"]},
        {"accession": "ENCSR200HEP", "assay_title": "Histone ChIP-seq", "target": "H3K27ac", "biosample_summary": "HepG2", "biosample_type": "cell line", "assembly": ["GRCh38"]}
      ],
      "total": 8,
      "limit": 25,
      "offset": 0,
      "has_more": false,
      "next_offset": null
    }
    ```
    
    ### Step 2: Compare the two experiments
    
    ```
    encode_compare_experiments(accession1="ENCSR100LIV", accession2="ENCSR200HEP")
    ```
    
    Expected output (both experiments must be tracked first, or the tool returns `{"error": "..."}`):
    ```json
    {
      "experiment_1": {"accession": "ENCSR100LIV", "assay": "Histone ChIP-seq", "biosample": "liver tissue male adult (54 years)"},
      "experiment_2": {"accession": "ENCSR200HEP", "assay": "Histone ChIP-seq", "biosample": "HepG2"},
      "verdict": "COMPATIBLE_WITH_CAVEATS",
      "recommendation": "These experiments can be compared, but the warnings should be addressed in your analysis.",
      "compatible_aspects": [
        "Same organism: Homo sapiens",
        "Same assembly: GRCh38",
        "Same assay: Histone ChIP-seq",
        "Same target: H3K27ac"
      ],
      "issues": [],
      "warnings": [
        "Different biosample types: tissue vs cell line. Results may reflect sample type differences."
      ]
    }
    ```
    
    Matching metadata lands in `compatible_aspects`; differences are split between `issues` (blocking) and `warnings` (non-blocking), both as prose strings.
    
    ### Step 3: Download peak files for both
    
    ```
    encode_download_files(file_accessions=["ENCFF100LIV", "ENCFF200HEP"], download_dir="/data/comparison")
    ```
    
    ### Step 4: Identify differential peaks
    
    ```bash
    bedtools intersect -v -a liver_peaks.bed -b hepg2_peaks.bed > liver_specific.bed
    bedtools intersect -v -a hepg2_peaks.bed -b liver_peaks.bed > hepg2_specific.bed
    bedtools intersect -a liver_peaks.bed -b hepg2_peaks.bed > shared_peaks.bed
    ```
    
    **Interpretation**: HepG2-specific H3K27ac peaks mark cancer-gained enhancers. Liver-specific peaks mark enhancers lost in cancer.
    
    ### Integration with downstream skills
    - Differential peaks feed into **peak-annotation** for gene assignment
    - Biosample-specific enhancers connect to **disease-research**
    - Cell composition differences contextualized by **cellxgene-context**
    - Expression differences validated via **gtex-expression**
    
    ## Code Examples
    
    ### 1. Compare two experiments
    ```
    encode_compare_experiments(accession1="ENCSR100LIV", accession2="ENCSR200HEP")
    ```
    
    Expected output:
    ```json
    {
      "experiment_1": {"accession": "ENCSR100LIV", "assay": "Histone ChIP-seq", "biosample": "liver tissue male adult (54 years)"},
      "experiment_2": {"accession": "ENCSR200HEP", "assay": "Histone ChIP-seq", "biosample": "HepG2"},
      "verdict": "COMPATIBLE_WITH_CAVEATS",
      "recommendation": "These experiments can be compared, but the warnings should be addressed in your analysis.",
      "compatible_aspects": ["Same assay: Histone ChIP-seq", "Same target: H3K27ac"],
      "issues": [],
      "warnings": ["Different biosample types: tissue vs cell line. Results may reflect sample type differences."]
    }
    ```
    
    ### 2. Find matching experiments across biosamples
    ```
    encode_search_experiments(assay_title="Histone ChIP-seq", target="H3K27ac", organism="Homo sapiens", limit=100)
    ```
    
    Expected output (one entry per experiment; tally the `biosample_summary` / `biosample_type` values to see which biosamples are covered, or call `encode_get_facets` for the counts directly):
    ```json
    {
      "results": [
        {"accession": "ENCSR000AKA", "assay_title": "Histone ChIP-seq", "target": "H3K27ac", "biosample_summary": "K562", "biosample_type": "cell line"}
      ],
      "total": 142,
      "limit": 100,
      "offset": 0,
      "has_more": true,
      "next_offset": 100
    }
    ```
    
    ### 3. Track compared experiments
    ```
    encode_track_experiment(accession="ENCSR100LIV", notes="Liver H3K27ac - normal tissue control for HepG2 comparison")
    ```
    
    Expected output (`notes` is stored, not echoed — read it back with `encode_list_tracked`):
    ```json
    {
      "tracking": {"accession": "ENCSR100LIV", "action": "tracked"},
      "publications_found": 1,
      "publications": [
        {"pmid": "32728249", "doi": "10.1038/s41586-020-2493-4", "title": "Expanded encyclopaedias of DNA elements in the human and mouse genomes", "authors": "Abascal F, Acosta R, Addleman NJ", "journal": "Nature", "year": "2020", "abstract": ""}
      ],
      "pipelines_found": 1,
      "pipelines": [
        {"title": "Histone ChIP-seq 2 (unreplicated)", "version": "1.7.1", "software": [{"name": "bowtie2", "version": "2.3.4.3"}], "status": "released"}
      ]
    }
    ```
    
    ## Integration
    
    | This skill produces... | Feed into... | Purpose |
    |---|---|---|
    | Differential peak sets | **peak-annotation** | Assign biosample-specific peaks to genes |
    | Biosample-specific enhancers | **disease-research** | Identify disease-gained/lost regulatory elements |
    | Shared regulatory elements | **regulatory-elements** | Define constitutive vs. tissue-specific cCREs |
    | Cell composition context | **cellxgene-context** | Deconvolve tissue heterogeneity effects |
    | Expression differences | **gtex-expression** | Validate regulatory changes with expression data |
    | Comparison metadata | **data-provenance** | Document biosample comparison analysis |
    | Differential regions | **variant-annotation** | Find variants in biosample-specific regulatory elements |
    
    ## Related Skills
    
    - **integrative-analysis**: Combine multiple data types (ChIP + RNA-seq + ATAC) within or across biosamples
    - **epigenome-profiling**: Build comprehensive epigenomic profiles for individual biosamples before comparing them
    - **quality-assessment**: Evaluate data quality for each experiment BEFORE including it in a cross-tissue comparison
    - **histone-aggregation**: Aggregate peaks across multiple experiments for the SAME tissue before cross-tissue comparison
    - **accessibility-aggregation**: Aggregate ATAC-seq/DNase-seq peaks across experiments for the SAME tissue
    - **methylation-aggregation**: Aggregate DNA methylation data across experiments for cross-tissue methylation comparison
    - **regulatory-elements**: Use tissue-specific peak sets to discover enhancers, promoters, and other cis-regulatory elements
    - **single-cell-encode**: Cell type-resolved data can deconvolve bulk cross-tissue comparisons
    - **multi-omics-integration**: Combine multiple ENCODE assay types for deeper regulatory characterization
    - **data-provenance**: Document all comparison parameters, tool versions, and results for reproducibility
    - **publication-trust**: Verify literature claims backing analytical decisions
    
    ## Presenting Results
    
    - Present comparison as: metric | biosample_1 | biosample_2 | difference. Highlight significant differences. Include compatibility verdict (COMPATIBLE/WARNING/INCOMPATIBLE). Suggest: "Would you like to download the compatible experiments?"
    
    ## For the request: "$ARGUMENTS"
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related