Skip to main content

genome_comparator logo

genome_comparator

Tests Release PyPI Coverage Python 3.10–3.14 License Documentation DOI

Quickly compare and visualize distances between genomes, from assemblies (fasta) or reads (fastq), using Mash. Produces a distance matrix, trees (UPGMA, neighbour joining, minimum evolution) with optional bootstrap support, and an interactive PCoA plot.

Neighbour joining tree of 22 Listeria genomes with bootstrap support values PCoA of 22 Listeria genomes coloured by species
22 public Listeria genomes from the tutorial: 3 seconds, or under 2 minutes with 100 bootstrap replicates.

Features

  • Assemblies or reads: fasta or fastq (gzipped or not), paired-end reads combined per sample.
  • Fast and scalable: thousands of genomes; sketches are computed in parallel, and adding genomes to an existing run only sketches them and measures their distances.
  • Trees: UPGMA, neighbour joining and minimum evolution, with optional bootstrap support.
  • Clusters at any distance thresholds, e.g. species (~95% ANI) or near-identical strains.
  • iTOL annotations: colour strips for the metadata and clusters, to drag and drop on the trees.
  • Interactive PCoA with metadata on hover and colourblind-friendly colouring by any metadata column.
  • Safe by default: ambiguous sample names and unreadable files are reported, never silently merged or ignored.

How it works

flowchart LR
    A[fasta / fastq files] -->|mash sketch| B[one sketch per sample]
    B -->|mash triangle| C[pairwise distance matrix]
    C --> D[UPGMA / NJ / ME trees]
    C --> E[PCoA plot]
    B -. re-sketch with other hash seeds .-> F[bootstrap replicates]
    F -. support values .-> D

Installation

With pip. Mash is not available from PyPI: install it separately (e.g. conda install -c bioconda mash).

pip install genome-comparator

Or from source, in a conda environment that includes Mash:

git clone https://github.com/duceppemo/genome_comparator
cd genome_comparator
conda env create -f environment.yml
conda activate genome_comparator
pip install --no-deps .

Quick start

genome-comparator -i /input/folder/ -o /output/folder/ --nj --pcoa

New to the tool? Follow the tutorial: it downloads 22 public genomes and walks through every output in a few minutes.

Documentation

The wiki covers usage and options, output files, interpreting the results, bootstrap support, performance, related tools, troubleshooting and the FAQ.

Citing

If you use genome_comparator, please cite it and Mash, which computes the distances:

Duceppe M-O. genome_comparator: fast comparison and visualization of genome distances with Mash. Zenodo. https://doi.org/10.5281/zenodo.22920856

This DOI always points to the latest version; each release also has its own DOI, listed on Zenodo. GitHub's "Cite this repository" button gives the same citation in APA and BibTeX formats.

Ondov BD, Treangen TJ, Melsted P, Mallonee AB, Bergman NH, Koren S, Phillippy AM. Mash: fast genome and metagenome distance estimation using MinHash. Genome Biology 17, 132 (2016). https://doi.org/10.1186/s13059-016-0997-x

Contributing

Bug reports, questions and pull requests are welcome: see CONTRIBUTING.md.

Author

Marc-Olivier Duceppe, Canadian Food Inspection Agency (CFIA): marc-olivier.duceppe@inspection.gc.ca

License

MIT

Metadata

Release files for genome-comparator 0.5.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 genome-comparator 0.5.0
File Size Uploaded
genome_comparator-0.5.0.tar.gz 42.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for genome-comparator 0.5.0
File Interpreter ABI Platform
genome_comparator-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 76.1 kB

Release files / genome_comparator-0.5.0.tar.gz

Download URL genome_comparator-0.5.0.tar.gz
Size 42.2 kB
Tags Source
SHA-256 checksum
How to use checksums
96b9d517263cce6a625d2e1c4080348a4e4405d159ef98c90425c9bc09d575f9
BLAKE2b-256 checksum
How to use checksums
57513c1818a452a1917f79b4e8ea851ce81669398769aa7ac642849b01c50c66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 28, 2026.

Transparency log

Release files / genome_comparator-0.5.0-py3-none-any.whl

Download URL genome_comparator-0.5.0-py3-none-any.whl
Size 33.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34e2f2df6cce5e7436cd14ffbee13b273de20984b4c11e919840ef503b9a0f2d
BLAKE2b-256 checksum
How to use checksums
cb2aac987d0075b550567c9e3b89a55720348121b3a8187624f339368c615b23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.7

2 release files

0.4.6

2 release files

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