Bin level sequencing depth calculation
Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder
npx -y skills add HolobiomicsLab/asb-skill-collections --skill bin-level-sequencing-depth-calculationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when you have a cooler file (.cool or .mcool) from a Hi-C or micro-C experiment and need to quantify the total number of sequencing reads assigned to each genomic bin to assess coverage uniformity, identify poorly-sequenced regions, or prepare bin-level weights for downstream normalization.
The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
6.3 KB, as published. Nobody here has run it
bin-level-sequencing-depth-calculation
Summary
Compute per-bin sequencing depth (coverage) from a cooler Hi-C contact matrix using cooltools.coverage(), producing a bedGraph or tabular track of read counts per genomic bin. This enables quality assessment and normalization of high-resolution chromosome conformation capture datasets.
When to use
You have a cooler file (.cool or .mcool) from a Hi-C or micro-C experiment and need to quantify the total number of sequencing reads assigned to each genomic bin to assess coverage uniformity, identify poorly-sequenced regions, or prepare bin-level weights for downstream normalization. Specifically useful when the cooler object is already loaded in memory and you want to export coverage as a track file (bedGraph or tabular CSV/TSV).
When NOT to use
- Input data is already a normalized or log-transformed contact matrix (coverage calculation assumes raw counts).
- You need trans (inter-chromosomal) coverage only; cooltools.coverage() by default computes cis (intra-chromosomal) counts.
- The cooler file has no valid bin or contact data (e.g., empty or corrupted cooler).
Inputs
- cooler contact matrix object (loaded via cooler.Cooler() or cooler.open_cooler())
- Hi-C or micro-C cooler file (.cool or .mcool format)
Outputs
- bedGraph file or tabular track (CSV/TSV) with columns: chromosome, start, end, coverage
- optionally, cis count column stored in cooler HDF5 metadata
How to apply
Load a cooler contact matrix object using the cooler library, then call cooltools.coverage() on it to compute per-bin sequencing depth. The function signature permits optionally storing total cis counts as a new column in the cooler HDF5 file. After computation, export the resulting coverage array (bin coordinates + coverage values) to bedGraph or tabular format (CSV/TSV). Validate the output by checking that the number of rows matches the total bin count in the cooler object's bins table, and that coverage values are non-negative integers or floats reflecting read accumulation per bin.
Related tools
- cooltools (Primary library providing the coverage() function to compute per-bin sequencing depth from cooler contact matrices) — https://github.com/open2c/cooltools
- cooler (HDF5-backed format and library for storing and loading high-resolution Hi-C contact matrices and bin tables) — https://github.com/open2c/cooler
- Python (Programming language environment for executing cooltools and cooler function calls)
Examples
from cooler import Cooler; import cooltools.coverage as cov; c = Cooler('test.cool'); depth = cov.coverage(c); depth.to_csv('coverage.bedGraph', sep='\t', header=False, index=False)
Evaluation signals
- Output file has exactly N rows, where N equals the total number of bins in the cooler.bins table (cooler.nbins).
- All coverage values are non-negative and match the sum of read counts per bin across all contacts involving that bin.
- bedGraph output has valid format: tab-delimited, 4 columns (chrom, chromStart, chromEnd, value), with coordinates consistent with the cooler bin table.
- Coverage values for bins with zero reads are 0 (or NaN if filtered), not missing or negative.
- If cis counts are stored in the cooler, they match the exported coverage values and can be retrieved via cooler object column access (e.g., cooler['cis_count']).
Limitations
- cooltools.coverage() computes cis (intra-chromosomal) coverage by default; trans (inter-chromosomal) coverage requires separate handling or manual aggregation.
- Output format and API stability are not yet fully documented in the article; refer to function docstrings and inline examples in the cooltools repository.
- Memory usage scales with the number of bins and contact matrix density; very large cooler files (>10 billion contacts) may require chunked or out-of-core processing.
- Coverage calculation assumes all contacts in the cooler have equal weight; if the cooler was pre-normalized (e.g., by ICE or other methods), the reported coverage will reflect weighted counts, not raw sequencing depth.
Evidence
- [intro] Larger datasets increase the challenges at each step of computational analysis, from storage, to memory, to researchers' time.: "Larger datasets increase the challenges at each step of computational analysis, from storage, to memory, to researchers' time."
- [other] Install in editable development mode using pip install -e . to enable access to bundled test datasets.: "install in "editable" (i.e. development) mode using the
-eoption" - [methods] Call cooltools.coverage() on the loaded cooler object to compute per-bin sequencing depth, optionally specifying whether to store total cis counts in the cooler as indicated in the function signature.: "Call cooltools.coverage() on the loaded cooler object to compute per-bin sequencing depth, optionally specifying whether to store total cis counts in the cooler as indicated in the function signature."
- [intro] The recently-introduced cooler format readily handles storage of high-resolution datasets.: "The recently-introduced cooler format readily handles storage of high-resolution datasets"