sjcab_peak2anno
sjcab_peak2anno annotates genomic peaks to genes, genomic features, and
chromatin states. It provides the peak2anno and sjcab-peak2anno command
line interfaces.
Documentation
Read the full documentation at sjcab-peak2anno.readthedocs.io.
Install
Pip version does not require bedtools; auto uses the Python interval
backend. To use native bedtools and create a reviewable script, set
SJCAB_PEAK2ANNO_BACKEND=bedtools with bedtools available in PATH.
The generated bedtools-peak2anno.sh supports mode 1 (one wide window) and
mode 2 (promoter-first, enhancer-second).
pip install sjcab_peak2anno
The conda package does not require external interval tools.
conda install stjudecab::sjcab_peak2anno
Quick start
# it would automatic sjcab_peak2anno_db install hg38 v31 and annotate peaks.bed
wget https://github.com/stjudecab/sjcab_peak2anno/raw/refs/heads/master/tests_data/peaks.bed
peak2anno peak2gene peaks.bed
Command examples
Annotate a BED peak to nearby genes. Omitting -o writes the table to stdout:
peak2anno peak2gene tests_data/peaks.bed \
--tss-bed tests_data/tss.bed \
--prom-enha-cutoffs 2000,50k
Example output (tab-delimited):
chr1 50 150 peak1 GeneA ENSGA . . GeneA ENSGA 0
Run multiple annotations in one table with the combined command syntax using default hg38 v31:
peak2anno peak2gene narrow2feature tests_data/peaks.bed \
--workers 2 -o combined.tsv
Representative combined output columns look like this:
chr start end peak Closest_Gene FeatureAssignment
chr1 100000 101000 peak1 GeneA Promoter
Annotate both anchors of a BEDPE loop with loop2gene, loop2feature, or
loop2state:
peak2anno loop2gene loops.bedpe --tss-bed annotations/hg38/tss.bed -o loops.tsv
Representative loop output contains separate anchor columns:
chr1 100000 101000 chr1 200000 201000 anchor1_Closest_Gene anchor2_Closest_Gene
chr1 100000 101000 chr1 200000 201000 GeneA GeneC
Loop operations
Loop files use BEDPE coordinates: columns 1--3 are the source anchor and
columns 4--6 are the target anchor. The operations inter1d, inter, and
merge write bedpe, txt (with a header), or txtnohead output.
# Intersect either selected anchor with a BED file
peak2anno inter1d -i tests_data/loops.bedpe -b tests_data/loop_regions.bed \
--direction source -f txt
# Same direction: source-source and target-target
peak2anno inter -i tests_data/loops.bedpe -b tests_data/loops_reverse.bedpe \
--direction direction -f bedpe -o same-direction.bedpe
# Reverse direction: source-target and target-source
peak2anno inter -i tests_data/loops.bedpe -b tests_data/loops_reverse.bedpe \
--direction reverse -f txtnohead -o reverse-direction.txt
# Merge source anchors while retaining every loop's original target anchor
peak2anno merge -i tests_data/loops.bedpe --direction source \
-f bedpe -o merged-source.bedpe
For example, source merging turns two overlapping source anchors into two rows with the same merged source while retaining their separate targets:
chr1 0 15 chr1 100 110 A
chr1 0 15 chr1 105 115 B
The included fixtures tests_data/loops.bedpe,
tests_data/loops_direction.bedpe, and tests_data/loops_reverse.bedpe can
be used to test same-direction, reverse-direction, and one-anchor merge
behavior. Use peak2anno <command> --help to see all defaults.
Metadata
Release files for sjcab-peak2anno 0.4
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 |
|---|---|---|---|---|
| sjcab_peak2anno-0.4.tar.gz | 56.9 kB | With provenance | Details for sjcab_peak2anno-0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sjcab_peak2anno-0.4-py3-none-any.whl | Python 3 | none | any | Details for sjcab_peak2anno-0.4-py3-none-any.whl |
Total release size: 110.6 kB
Release files / sjcab_peak2anno-0.4.tar.gz
| Download URL | sjcab_peak2anno-0.4.tar.gz |
|---|---|
| Size | 56.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58aebd0b4e871929f1812d7c649f418c9d5ca6e52241b4dff6153d213d2d9aef
|
|
BLAKE2b-256 checksum How to use checksums |
c709e45bea973e83f409a67e3014d3ca20edeef356dbb9978f05574ee27ea108
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 4, 2026.
Transparency logRelease files / sjcab_peak2anno-0.4-py3-none-any.whl
| Download URL | sjcab_peak2anno-0.4-py3-none-any.whl |
|---|---|
| Size | 53.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8181cd19572ba218d5cedc91e6a82fa3003b9dbc932bbc39e511576f1b5a5632
|
|
BLAKE2b-256 checksum How to use checksums |
9d6b06323107327476f519e0d64e34ba21173747eff196a4cc0dfdb336cf496f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 4, 2026.
Transparency logSecurity for sjcab-peak2anno 0.4
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
Both files in this release have been uploaded with provenance metadata.
Attestation for sjcab_peak2anno-0.4.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 4, 2026.
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.