Skip to main content

An advanced version for TelomereHunter in Python 3 with new features

Project description

TelomereHunter2

PyPI version License: GPL v3 Build Status Python Versions DOI Last Commit Docker Pulls

TelomereHunter2 is a Python-based tool for estimating telomere content and analyzing telomeric variant repeats (TVRs) from genome sequencing data. It supports BAM/CRAM files, flexible telomere repeat and reference genome inputs, and provides outputs for bulk and single-cell genome sequencing data.


Release Notes

See RELEASE_NOTES.md for the latest changes and version history.


Features

  • Fast, container-friendly Python 3 implementation
  • Parallelization and algorithmic steps for drastic speedup
  • Supports BAM/CRAM, custom telomeric repeats, and now also non-human genomes
  • Static and interactive HTML reports (Plotly)
  • Docker and Apptainer/Singularity containers
  • Single cell sequencing support (e.g. scATAC-seq; barcode splitting and per-cell analysis)
  • Robust input handling and exception management
  • Fast mode for quick overview of unmapped reads

Installation

Classic setup:

pip install telomerehunter2

From source:

# With pip:
git clone https://github.com/ferdinand-popp/telomerehunter2.git
cd telomerehunter2
python -m venv venv
source venv/bin/activate
pip install -e . --no-cache-dir

# With uv:
git clone https://github.com/ferdinand-popp/telomerehunter2.git
cd telomerehunter2
uv pip install -e . --no-cache-dir

Container usage:
See Container Usage for Docker/Apptainer instructions.

Quickstart

Bulk Analysis

telomerehunter2 -ibt sample.bam -o results/ -p SampleID -b telomerehunter2/cytoband_files/hg19_cytoBand.txt

For all options:

telomerehunter2 --help

Single Cell Analysis

telomerehunter2_sc -ibt sample.bam -o results/ -p SampleID -b telomerehunter2/cytoband_files/cytoband.txt --min-reads-per-barcode 10000

See Bulk Analysis and Single cell sequencing Analysis below for more details.

Usage

Bulk Analysis

  • Single sample:
    telomerehunter2 -ibt tumor.bam -o out/ -p TumorID -b cytoband.txt
  • Tumor vs Control:
    telomerehunter2 -ibt tumor.bam -ibc control.bam -o out/ -p PairID -b cytoband.txt
  • Custom repeats/species:
    telomerehunter2 ... --repeats TTTAGGG TTAAGGG --repeatsContext TTAAGGG
  • Fast mode (quick overview of unmapped reads generating summary with overview):
    telomerehunter2 -ibt sample.bam -o out/ -p SampleID --fast_mode

Single cell sequencing Analysis

TelomereHunter2 now supports direct single-cell BAM analysis (with CB barcode tag). Simply run:

telomerehunter2_sc -ibt sample.bam -o results/ -p SampleID -b telomerehunter2/cytoband_files/cytoband.txt --min-reads-per-barcode 10000

This will perform barcode-aware telomere analysis and output per-cell results in a summary file. The minimum reads per barcode threshold can be set with --min-reads-per-barcode.

See tests/test_telomerehunter2_sc.py for example usage and validation.

Input & Output

Input:

  • BAM/CRAM files (aligned reads)
  • Cytoband file (tab-delimited, e.g. hg19_cytoBand.txt)
  • Optional: custom telomeric repeats

Output:

  • summary.tsv, TVR_top_contexts.tsv, singletons.tsv
  • Plots (plots/ directory, PNG/HTML)
  • Logs (run status/errors)
  • For sc-seq: Additionally to the complete bulk run you get per-cell results in sc_summary.tsv and barcode_counts.tsv with reads counts per barcode

Dependencies

  • Python >=3.6
  • pysam, numpy, pandas, plotly, PyPDF2
  • For static image export: kaleido (requires chrome/chromium)
  • Docker/Apptainer (optional)

Install all dependencies:

pip install -r requirements.txt

Container Usage

Docker (recommended):

Build locally:

docker build -t telomerehunter2 .
docker run --rm -it -v /data:/data telomerehunter2 telomerehunter2 -ibt /data/sample.bam -o /data/results -p SampleID -b /data/hg19_cytoBand.txt

Pull from Docker Hub:

docker pull fpopp22/telomerehunter2

Run from Docker Hub:

docker run --rm -it -v /data:/data fpopp22/telomerehunter2 telomerehunter2 -ibt /data/sample.bam -o /data/results -p SampleID -b /data/hg19_cytoBand.txt

Apptainer/Singularity:

Build locally:

apptainer build telomerehunter2.sif Apptainer_TH2.def
# mount data needed
apptainer run telomerehunter2.sif telomerehunter2 -ibt /data/sample.bam -o /data/results -p SampleID -b /data/hg19_cytoBand.txt

Pull from Docker Hub (as Apptainer image):

apptainer pull docker://fpopp22/telomerehunter2:latest
apptainer run telomerehunter2_latest.sif telomerehunter2 ...

Troubleshooting

  • Memory errors: Use more RAM or limit cores used with -c flag.
  • Missing dependencies: Check requirements.txt.
  • Banding file missing: Needs reference genome banding file -b otherwise analysis will run without reads mapped to subtelomeres.
  • Plotting: Try disabling with --plotNone or use plotting only mode with --plotNone.
  • Minor changes to TH1: Skipping the tvrs normalization per 100 bp, improved detection of GXXGGG TVRs, read lengths are estimated from first 1000 reads, added TRPM

For help: GitHub Issues or our FAQ.

Documentation & Resources

Citation

If you use TelomereHunter2, please cite:

  • Feuerbach, L., et al. "TelomereHunter – in silico estimation of telomere content and composition from cancer genomes." BMC Bioinformatics 20, 272 (2019). https://doi.org/10.1186/s12859-019-2851-0
  • Application Note for TH2 (in preparation).

Contributing

Fork, branch, and submit pull requests. Please add tests and follow code style. For major changes, open an issue first.

License

GNU General Public License v3.0. See LICENSE.

Contact

Acknowledgements

Developed by Ferdinand Popp, Lina Sieverling, Philip Ginsbach, Lars Feuerbach. Supported by German Cancer Research Center (DKFZ) - Division Applied Bioinformatics.


Copyright 2025 Ferdinand Popp, Lina Sieverling, Philip Ginsbach, Lars Feuerbach

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

telomerehunter2-1.0.1.tar.gz (126.9 kB view details)

Uploaded Source

Built Distribution

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

telomerehunter2-1.0.1-py3-none-any.whl (119.2 kB view details)

Uploaded Python 3

File details

Details for the file telomerehunter2-1.0.1.tar.gz.

File metadata

  • Download URL: telomerehunter2-1.0.1.tar.gz
  • Upload date:
  • Size: 126.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for telomerehunter2-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cd841ca100ccca1f1e2f719dd3795f27213865b479ed3ba5a180d249563ddc55
MD5 1c610064adee9dd6f282995c38865d88
BLAKE2b-256 0b1e4011b35a1611db4c0448029b06db8bdcefda73382277d63a2d4ed7597b1e

See more details on using hashes here.

File details

Details for the file telomerehunter2-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for telomerehunter2-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb0fef6616d5752f39322f5f48a1966b7108ae34de3ea0465a5b3a95da8f3cec
MD5 ef2563b9a5bdf71324f94f0bfe576e39
BLAKE2b-256 3af62165f671e254580c5e8342bdd8e1b636cd08931511864972c247167a968c

See more details on using hashes here.

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