Skip to main content

Generate BED files for Oxford Nanopore adaptive sampling from a gene list and a RefSeq GFF3.

Project description

CI

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

  1. 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 bare Gene line (no extensions) is valid and gets only the default flank. Symbols must be official HGNC symbols (check them with the multi-symbol checker).
  2. GFF3 — a RefSeq GFF3 whose gene features carry Name= and Dbxref=GeneID:. The full NCBI annotation works as-is: the tool reads only gene features 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
    
  3. genome sizeschrom<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 merge on genome-order-sorted input without -g). This tool performs the correct merge.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ont_bed_generator-0.4.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ont_bed_generator-0.4.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

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

Hashes for ont_bed_generator-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1daed635513cf4a674271d50b6bc19b921278a5afcf52b5a25192240d95330c6
MD5 24bed8da76a678cbab0fb299871269a1
BLAKE2b-256 5c34f5b1a321e81c4549a9c25e2613d23f21ecfd91d8d993b4e3eeea6d3fbb95

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ont_bed_generator-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ont_bed_generator-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 522422b52925071f588ddd12b145e2f1f36474f00650785e7e2543e0aad1f19e
MD5 4e1b1436f9fda3933c0933e1076bbc1c
BLAKE2b-256 6b1f199f1a8df81137e2e6ddbec3e81d72573d0cea76051aad478666d682df09

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page