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 the per-read output of whatever classifier you ran on the reads that did not align, and writes a table of candidate sites, with optional BED, VCF and MultiQC files.
Nanopore and PacBio alignments are also supported when you know the donor sequence: use --long-reads with --donor, without classifier output or a Kraken2 database.
- Any classifier. Kraken2, KrakenUniq, Kaiju, Centrifuge, DIAMOND and BLAST tabular output are read directly, as is any two-column file of read name and taxid. All of them give identical calls on the same reads.
- Junctions to the base pair where reads cross the junction, rather than an estimate from read pairs.
- The gene at each site, with
--annotationand a GTF or GFF3. hgt-site selftestproves the installation works on data with known answers, in a few seconds, with no database and no network.- One command from a BAM and a Kraken2 database, with
hgt-site run.
In benchmarks on real human and bacterial genomes with added contamination, hgt-site reported no false sites across 18 runs on fresh random seeds, 364 calls in all, while keeping every position with enough read support gave 24,861 sites of which 390 were real. 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
or, with conda, conda install -c conda-forge -c bioconda hgt-site.
Usage
hgt-site run \
--bam sample.bam \
--kraken-db /path/to/kraken2-db \
--host-taxid 9606 \
--threads 8 \
-o sample.hgt-site.tsv \
--bed sample.hgt-site.bed \
--vcf sample.hgt-site.vcf
This classifies the unmapped reads with Kraken2 and calls the sites in one step, and needs kraken2 on PATH. If the reads have already been classified, use hgt-site call --kraken sample.kraken2.txt instead, which accepts several files at once.
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
Full documentation: https://iraajgangavaram.github.io/hgt-site/
Try the self-contained quickstart in your browser: https://colab.research.google.com/github/iraajgangavaram/hgt-site/blob/main/examples/quickstart.ipynb
Source code, benchmark scripts and results: 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.6.0
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 |
|---|---|---|---|---|
| hgt_site-0.6.0.tar.gz | 95.0 kB | With provenance | Details for hgt_site-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hgt_site-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for hgt_site-0.6.0-py3-none-any.whl |
Total release size: 160.7 kB
Release files / hgt_site-0.6.0.tar.gz
| Download URL | hgt_site-0.6.0.tar.gz |
|---|---|
| Size | 95.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29684ed77454a7776f015101cf3ecda69563d4b31f99f4cb279b6403f5c0021a
|
|
BLAKE2b-256 checksum How to use checksums |
a556c3027861dc95c8e854ed4ed7f80fd0029253584ffcc7ac9baa8821c207b6
|
| 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 30, 2026.
Transparency logRelease files / hgt_site-0.6.0-py3-none-any.whl
| Download URL | hgt_site-0.6.0-py3-none-any.whl |
|---|---|
| Size | 65.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e8cb3d02fa4ebdd529aca47e3374cb917ca6d49fe1e988d61978ad96c969395
|
|
BLAKE2b-256 checksum How to use checksums |
48c1ea9fbd60b1f27854448ccf7876953f17f65e3ea249c6d98549f6652d1728
|
| 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 30, 2026.
Transparency logSecurity for hgt-site 0.6.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
Both files in this release have been uploaded with provenance metadata.
Attestation for hgt_site-0.6.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 30, 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.