CoverageLens
Targeted sequencing coverage reporter that turns a BAM/CRAM and a BED of target regions into a concise HTML dashboard plus optional TSV/JSON exports.
Features
- Per-region coverage metrics: mean, min, max depth and percent of bases ≥ configurable thresholds.
- PASS/FAIL call per region based on primary threshold and breadth requirement.
- Summary stats: fraction of targets meeting coverage requirements and overall mean depth.
- Static HTML report with interactive charts and a searchable table (filter by gene/region).
- Optional TSV and JSON exports for downstream QC pipelines.
- CRAM support (with external reference) and configurable BED column mappings.
Installation
pip install coveragelens
Or from source:
python -m venv .venv && source .venv/bin/activate
pip install -e .
Quick start
# Generate HTML report
coveragelens sample.bam targets.bed \
--threshold 10 --threshold 20 --threshold 50 \
--html-output coverage_report.html
Open coverage_report.html in your browser to explore summary metrics, charts, and a searchable table by gene or region name.
CLI
coveragelens BAM_OR_CRAM BED \
[--threshold 10 --threshold 20 ...] \
[--primary-threshold 20] \
[--breadth-requirement 0.95] \
[--gene-column 3 --name-column 3] \
[--config config.yaml] \
[--reference reference.fa] \
[--chunk-size 50000] \
[--html-output report.html] \
[--json-output metrics.json] \
[--tsv-output metrics.tsv]
- Coverage breadth is reported as the percent of bases in a region meeting each threshold.
- Regions are considered passing if breadth at the primary threshold is at least the breadth requirement (default 95%); this is shown as a PASS/FAIL pill per region and summarized in the donut chart.
- JSON output includes both per-region metrics and a summary block with
regions_meeting,regions_failing, andfraction_meeting. - Provide
--referencewhen reading CRAM files that do not embed reference sequences.
Example commands
- Panel with typical thresholds:
coveragelens tumor.bam panel.bed \ --threshold 10 20 50 \ --primary-threshold 20 \ --breadth-requirement 0.95 \ --html-output tumor_panel_coverage.html
- CRAM with external reference and JSON export:
coveragelens sample.cram exome_targets.bed \ --reference GRCh38.fa \ --threshold 20 50 \ --json-output sample_coverage.json
Testing
python -m venv .venv && source .venv/bin/activate
pip install -e .[dev]
pytest
Config file
YAML/JSON config to set defaults:
thresholds: [10, 20, 50]
primary_threshold: 20 # default uses the highest threshold
breadth_requirement: 0.95 # fraction of bases
chunk_size: 50000 # bases per count_coverage call
bed_delimiter: "\t"
bed_columns:
chrom: 0
start: 1
end: 2
name: 3
gene: 3
sample_name: "Patient_01"
JSON output schema (high level)
{
"summary": {
"total_regions": 1234,
"primary_threshold": 20,
"breadth_requirement": 0.95,
"regions_meeting": 1200,
"regions_failing": 34,
"fraction_meeting": 0.972,
"mean_depth_overall": 142.3,
"sample_name": "Patient_01"
},
"regions": [
{
"chrom": "chr1",
"start": 100000,
"end": 100150,
"length": 150,
"name": "EXON1",
"gene": "GENE1",
"mean_depth": 135.2,
"min_depth": 52,
"max_depth": 212,
"status": "PASS",
"pct_ge_10": 100.0,
"pct_ge_20": 100.0,
"pct_ge_50": 97.3
}
]
}
Notes
- Coverage is computed with
pysam.count_coveragein chunks to handle large panels efficiently. - BED parsing is tolerant of comments/blank lines and lets you remap gene/region columns via CLI flags or config.
- The HTML report is fully static; no server is required.
Metadata
Release files for coveragelens 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| coveragelens-0.1.0.tar.gz | 15.7 kB | With provenance | Details for coveragelens-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| coveragelens-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for coveragelens-0.1.0-py3-none-any.whl |
Total release size: 33.5 kB
Release files / coveragelens-0.1.0.tar.gz
| Download URL | coveragelens-0.1.0.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c3cfd7af46646ce333de3d532e96823532d742bc91b4f18e93a553682b11280
|
|
BLAKE2b-256 checksum How to use checksums |
7023de2ca91337aa1fa73c3baa3c8300b376b5aa182229dfb49473ebae7a024c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2025.
Transparency logRelease files / coveragelens-0.1.0-py3-none-any.whl
| Download URL | coveragelens-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b2c048c7a4340e929bbecc95f09bfe2624c53092045c4d2899076d19a66abef
|
|
BLAKE2b-256 checksum How to use checksums |
0d783f5a80dd404285f1904852277b07c80a281b6d25f79adbbd08eb5aafbb02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2025.
Transparency logSecurity for coveragelens 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for coveragelens-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.