bio-hi-c-analysis-compartment-analysis
Detect A/B compartments from Hi-C data using cooltools and eigenvector decomposition. Identify active (A) and inactive (B) chromatin compartments from contact matrices. Use when identifying A/B compartments from Hi-C data.
npx skills add majiayu000/claude-skill-registry --skill compartment-analysis-gptomics-bioskills --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Compartment Analysis Detect A/B compartments from Hi-C contact matrices. ## Required Imports ```python import cooler import cooltools import cooltools.lib.plotting import numpy as np import pandas as pd import matplotlib.pyplot as plt import bioframe ``` ## Compute Compartment Eigenvectors ```python clr = cooler.Cooler('matrix.mcool::resolutions/100000') # Get reference genome info view_df = bioframe.make_viewframe(clr.chromsizes) # Compute expected values first expected = cooltools.expected_cis(clr, view_df=view_df, ignore_diags=2) # Compute eigenvector decomposition (compartments) eigenvector_track = cooltools.eigs_cis( clr, view_df=view_df, phasing_track=None, # Or provide GC content track n_eigs=3, ) # Results are returned as a tuple (eigenvalues, eigenvectors) eigenvalues, eigenvectors = eigenvector_track print(f'Eigenvalues shape: {eigenvalues.shape}') print(eigenvectors.head()) ``` ## Use GC Content for Phasing ```python # GC content helps orient A/B compartments correctly # (A compartments typically have higher GC) # Fetch GC content gc_track = bioframe.frac_gc( bioframe.make_viewframe(clr.chromsizes), bioframe.load_fasta('genome.fa'), ) # Compute eigenvectors with GC pha
- Required Imports
- Compute Compartment Eigenvectors
- Use GC Content for Phasing
- Extract Compartment Calls
- Compartment Strength (Saddle Plot)
- Plot Saddle
- Compartment Strength Score
- Plot Eigenvector Track
- Export Compartment Calls
- Compare Compartments Between Samples
- Correlate with Gene Expression
- Related Skills
What does the bio-hi-c-analysis-compartment-analysis skill do?
Detect A/B compartments from Hi-C data using cooltools and eigenvector decomposition. Identify active (A) and inactive (B) chromatin compartments from contact matrices. Use when identifying A/B compartments from Hi-C data.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill compartment-analysis-gptomics-bioskills --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
