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 reused between runs.
  • Trees: UPGMA, neighbour joining and minimum evolution, with optional bootstrap support.
  • 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

Release files for genome-comparator 0.4.6

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.4.6
File Size Uploaded
genome_comparator-0.4.6.tar.gz 31.5 kB Details

Built distribution (wheel)

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

Total release size: 59.4 kB

Release files / genome_comparator-0.4.6.tar.gz

Download URL genome_comparator-0.4.6.tar.gz
Size 31.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b239a83b63ba80547867e78a82debbfd80eb7fe43fdce370dc92af3d954cc39b
BLAKE2b-256 checksum
How to use checksums
4238905f310a9cc3c7cfde4de903f2113f3697bab072c6c302e226c2b4c0a865
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 23, 2026.

Transparency log

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

Download URL genome_comparator-0.4.6-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54aaadf97f879807a63b31f20ba9c63765313d4785773a238d65e995930486d2
BLAKE2b-256 checksum
How to use checksums
0a16fc15642613217bf6c287482160122cfe7a922a60b6bf55fa0540df1491e2
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 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.7

2 release files

This release

0.4.6 This release

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