Generate BED files for Oxford Nanopore adaptive sampling from a gene list and a RefSeq GFF3.
Project description
ont-bed-generator
Generate BED files for Oxford Nanopore adaptive sampling from a gene list and a RefSeq GFF3. Standalone reimplementation (Python standard library only, no runtime dependencies) of the Galaxy workflow "Adaptative ONT BED file generation" (which replaced BED-Craft).
Given a list of target genes and a GFF3 annotation, the tool produces:
targets.bed— the raw locus of each gene (BED6);merged-extended.bed— two intervals per locus (+/-strands), extended, clamped to chromosome bounds, then merged per strand.
Installation
# from source
git clone https://github.com/CHANGE-ME/ont-bed-generator.git
cd ont-bed-generator
pip install .
Conda development environment (includes bedtools, used only by the parity
test):
conda env create -f environment.yml # or: mamba/micromamba env create -f environment.yml
conda activate ont-bed-generator
Usage
ont-bed-generator \
--genelist genelist.tsv \
--gff annotation.genes.gff3 \
--genome hs1.len \
--out-targets targets.bed \
--out-merged merged-extended.bed
# or: python -m ont_bed_generator --genelist ... --gff ... --genome ...
Inputs
- genelist TSV — columns
Gene | Left_extension_bp | Right_extension_bp, with an (auto-detected) header row. Coordinates come from the GFF, so no chromosome column is needed; a gene is treated as an extended region when Left or Right is non-zero (no separate flag). A bareGeneline (no extensions) is valid and gets only the default flank. Symbols must be official HGNC symbols (check them with the multi-symbol checker). - GFF3 — a RefSeq GFF3 whose
genefeatures carryName=andDbxref=GeneID:. The full NCBI annotation works as-is: the tool reads onlygenefeatures and ignores everything else, so pre-extracting them is just an optional speed-up. Gzip-compressed (.gz) input is read transparently (this applies to every input file). Example (T2T-CHM13v2.0 / hs1):curl -sO https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/009/914/755/GCF_009914755.1_T2T-CHM13v2.0/GCF_009914755.1_T2T-CHM13v2.0_genomic.gff.gz
- genome sizes —
chrom<TAB>size, one line per chromosome. Used for telomere clamping only; the line order does not matter (output BEDs are sorted in canonical karyotypic order).curl -sO https://hgdownload.soe.ucsc.edu/goldenPath/hs1/bigZips/hs1.chrom.sizes
Symbol resolution
Official symbol → GeneID (GFF Name=, or external --entrez-map) → collect
all loci carrying that GeneID. The Entrez key handles pseudoautosomal
regions (one GeneID on chrX and chrY yields two loci) and IG/TCR loci. A symbol
that is not found, or that maps to several GeneIDs, is reported (on stderr),
never guessed. --strict returns a non-zero exit code if any symbol is invalid
or ambiguous.
Development
pip install -e '.[dev]'
pytest # unit tests (+ bedtools parity if bedtools is present)
ruff check .
mypy
Versioning is driven by git tags (hatch-vcs): a release is
git tag vX.Y.Z && git push --tags.
Intentional differences from the original Galaxy workflow
- The workflow patched non-official symbols (
MKL1→MKLN1, a bug — MKLN1 is a different gene;LYL→LYL1). Here no patching: such symbols are reported for correction at the source. - The Galaxy output contained a missing merge (
bedtools mergeon genome-order-sorted input without-g). This tool performs the correct merge.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ont_bed_generator-0.4.0.tar.gz.
File metadata
- Download URL: ont_bed_generator-0.4.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1daed635513cf4a674271d50b6bc19b921278a5afcf52b5a25192240d95330c6
|
|
| MD5 |
24bed8da76a678cbab0fb299871269a1
|
|
| BLAKE2b-256 |
5c34f5b1a321e81c4549a9c25e2613d23f21ecfd91d8d993b4e3eeea6d3fbb95
|
Provenance
The following attestation bundles were made for ont_bed_generator-0.4.0.tar.gz:
Publisher:
release.yml on Institut-Leucemie/ont-bed-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ont_bed_generator-0.4.0.tar.gz -
Subject digest:
1daed635513cf4a674271d50b6bc19b921278a5afcf52b5a25192240d95330c6 - Sigstore transparency entry: 2169009804
- Sigstore integration time:
-
Permalink:
Institut-Leucemie/ont-bed-generator@a899da06d8dbb8b90c99f708a6b3a24f55066331 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Institut-Leucemie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a899da06d8dbb8b90c99f708a6b3a24f55066331 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ont_bed_generator-0.4.0-py3-none-any.whl.
File metadata
- Download URL: ont_bed_generator-0.4.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
522422b52925071f588ddd12b145e2f1f36474f00650785e7e2543e0aad1f19e
|
|
| MD5 |
4e1b1436f9fda3933c0933e1076bbc1c
|
|
| BLAKE2b-256 |
6b1f199f1a8df81137e2e6ddbec3e81d72573d0cea76051aad478666d682df09
|
Provenance
The following attestation bundles were made for ont_bed_generator-0.4.0-py3-none-any.whl:
Publisher:
release.yml on Institut-Leucemie/ont-bed-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ont_bed_generator-0.4.0-py3-none-any.whl -
Subject digest:
522422b52925071f588ddd12b145e2f1f36474f00650785e7e2543e0aad1f19e - Sigstore transparency entry: 2169009819
- Sigstore integration time:
-
Permalink:
Institut-Leucemie/ont-bed-generator@a899da06d8dbb8b90c99f708a6b3a24f55066331 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Institut-Leucemie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a899da06d8dbb8b90c99f708a6b3a24f55066331 -
Trigger Event:
release
-
Statement type: