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

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.7
File Size Uploaded
genome_comparator-0.4.7.tar.gz 32.8 kB Details

Built distribution (wheel)

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

Total release size: 61.2 kB

Release files / genome_comparator-0.4.7.tar.gz

Download URL genome_comparator-0.4.7.tar.gz
Size 32.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cb064e6aacb5dc9ca8e5e0f9cadf030ac416d046b40eb6647315cec11bf3de74
BLAKE2b-256 checksum
How to use checksums
f05f9edef9a0bd9579a3656e2d56794a0f18b892cce36b80e9f6956693104f00
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.7-py3-none-any.whl

Download URL genome_comparator-0.4.7-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29adcdea0a44712238155b1776facf45256fad3196e1b09c0a85759d4229fdcb
BLAKE2b-256 checksum
How to use checksums
f779c485b88f2883bf6c786b8d5b12661393e9c991a4394b09838ad84d340c91
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

This release

0.4.7 This release

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