Skip to main content

hgt-site

hgt-site finds places where DNA from bacteria or other organisms may have been inserted into a host genome, such as a human genome, using sequencing data. Most bacterial reads in these samples come from contamination or from DNA fragments joined by chance in the lab, so hgt-site checks each possible site against what chance alone would produce and keeps only the sites with clearly more support.

It takes paired-end reads aligned to the host (BAM, CRAM or SAM) and Kraken2 classifications of the reads that did not align, and writes a table of candidate sites, with optional BED and VCF files. It works with any host alignment and Kraken2 output, including the files produced by nf-core/hgtseq.

In benchmarks on real human and bacterial genomes with added contamination, every site hgt-site reported was a real insertion. It is also fast: on a sample of 2.1 million reads it took about 3 seconds once the reads were aligned and classified, against about 2.5 minutes for LGTSeek.

Installation

pip install hgt-site

Usage

hgt-site call \
  --bam sample.bam \
  --kraken sample.kraken2.txt \
  --host-taxid 9606 \
  --nodes taxonomy/nodes.dmp \
  -o sample.hgt-site.tsv \
  --bed sample.hgt-site.bed \
  --vcf sample.hgt-site.vcf

Add --threads 4 to read large BAM or CRAM files faster. --kraken accepts several files, such as the two that nf-core/hgtseq writes for each sample.

To try it on simulated data with known insertion sites:

hgt-site simulate -o demo
hgt-site call --bam demo.sam --kraken demo.kraken2.txt --host-taxid 9606 -o demo.tsv

Documentation and benchmarks

The full documentation, the output format and the benchmark results, including a comparison with LGTSeek, are on GitHub: https://github.com/iraajgangavaram/hgt-site

Citation

If you use hgt-site, please cite it: https://doi.org/10.5281/zenodo.23842712

Licence

MIT

Metadata

Release files for hgt-site 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hgt-site 0.2.0
File Size Uploaded Provenance Actions
hgt_site-0.2.0.tar.gz 28.3 kB With provenance Details for hgt_site-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hgt-site 0.2.0
File Interpreter ABI Platform Actions
hgt_site-0.2.0-py3-none-any.whl Python 3 none any Details for hgt_site-0.2.0-py3-none-any.whl

Total release size: 47.5 kB

Release files / hgt_site-0.2.0.tar.gz

Download URL hgt_site-0.2.0.tar.gz
Size 28.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a7adf681d71c41eb2d5838154a99bbf832377d659063f26b8481e832f46c5832
BLAKE2b-256 checksum
How to use checksums
729fed88587787d67719093cc25cfe57ce9f7f94bd88ac8be167e742b7ec2d76
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 1, 2026.

Transparency log

Release files / hgt_site-0.2.0-py3-none-any.whl

Download URL hgt_site-0.2.0-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a74c5d4ad39f4a2faa23f6b83b8e84d377eaa1810575db071986eb73cb875711
BLAKE2b-256 checksum
How to use checksums
ad3af79727de1f8ece6d63b1a3fc157b08b31f60d8ac9aa8ddf2d92dc56da50e
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 1, 2026.

Transparency log

Security for hgt-site 0.2.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.

Select from 2 files

Attestation for hgt_site-0.2.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 1, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page