Skip to main content

🕊️ Pysylph Stars

PyO3 bindings and Python interface to sylph, an ultrafast method for containment ANI querying and taxonomic profiling.

Actions Coverage License PyPI Bioconda AUR Wheel Python Versions Python Implementations Source Mirror Issues Docs Changelog Downloads

🗺️ Overview

sylph[1] is a method developed by Jim Shaw and Yun William Yu for fast and robust ANI querying or metagenomic profiling for metagenomic shotgun samples. It uses a statistical model based on Poisson coverage to compute coverage-adjusted ANI instead of naive ANI.

pysylph is a Python module, implemented using the PyO3 framework, that provides bindings to sylph. It directly links to the sylph code, which has the following advantages over CLI wrappers:

  • pre-built wheels: pysylph is distributed on PyPI and features pre-built wheels for common platforms, including x86-64 and Arm64.
  • single dependency: If your software or your analysis pipeline is distributed as a Python package, you can add pysylph as a dependency to your project, and stop worrying about the sylph binary being present on the end-user machine.
  • sans I/O: Everything happens in memory, in Python objects you control, making it easier to pass your sequences to pysylph without having to write them to a temporary file.

This library is still a work-in-progress, and in an experimental stage, with API breaks very likely between minor versions.

🔧 Installing

Pysylph can be installed directly from PyPI, which hosts some pre-built CPython wheels for x86-64 platforms, as well as the code required to compile from source with Rust and maturin:

$ pip install pysylph

🔖 Citation

Pysylph is scientific software, and builds on top of sylph. Please cite sylph if you are using it in an academic work, for instance as:

pysylph, a Python library binding to sylph (Shaw & Yu, 2024).

💡 Examples

🔨 Creating a database

A database is a collection of genomes sketched for fast querying.

Here is how to create a database into memory, using Biopython to load genomes:

sketcher = pysylph.Sketcher()
sketches = []

for path in pathlib.Path(".").glob("*.fasta"):
    contigs = [ str(record.seq) for record in Bio.SeqIO.parse(path, "fasta") ]
    sketch = sketcher.sketch_genome(name=path.stem, contigs=contigs)
    sketches.append(sketch)

database = pysylph.Database(sketches)

Sketcher methods are re-entrant and can be used to sketch multiple genomes in parallel using for instance a ThreadPool.

📝 Saving a database

The database can be saved to the binary format used by the sylph binary as well:

database.dump("genomes.syldb")

🗒️ Loading a database

A database previously created with sylph can be loaded transparently in pysylph:

database = pysylph.Database.load("genomes.syldb")

📊 Sketching a query

Samples must also be sketched before they can be used to query a database. Here is how to sketch a sample made of single-ended reads stored in FASTQ format:

reads = [str(record.seq) for record in Bio.SeqIO.parse("sample.fastq", "fastq")]
sample = sketcher.sketch_single(name="sample", reads=reads)

🔬 Querying a database

Once a sample has been sketched, it can be used to query a database for ANI containment or taxonomic profiling:

profiler = pysylph.Profiler()
results = profiler.query(sample, database)   # ANI containment
results = profiler.profile(sample, database) # taxonomic profiling

Profiler methods are re-entrant and can be used to query a database with multiple samples in parallel using for instance a ThreadPool.

🔎 See Also

Computing ANI for closed genomes? You may also be interested in pyskani, a Python package for computing ANI binding to skani, which was developed by the same authors.

💭 Feedback

⚠️ Issue Tracker

Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker if you need to report or ask something. If you are filing in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproducible situation.

🏗️ Contributing

Contributions are more than welcome! See CONTRIBUTING.md for more details.

⚖️ License

This library is provided under the MIT License. It contains some code included verbatim from the the sylph source code, which was written by Jim Shaw and is distributed under the terms of the MIT License as well. Source distributions of pysylph vendors additional sources under their own terms using the cargo vendor command.

This project is in no way not affiliated, sponsored, or otherwise endorsed by the original sylph authors. It was developed by Martin Larralde during his PhD project at the Leiden University Medical Center in the Zeller team.

📚 References

Metadata

Release files for pysylph 0.1.3

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

Source distribution (sdist)

Source distribution for pysylph 0.1.3
File Size Uploaded
pysylph-0.1.3.tar.gz 1.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pysylph 0.1.3
File
pysylph-0.1.3-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
pysylph-0.1.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details
pysylph-0.1.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details
pysylph-0.1.3-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
pysylph-0.1.3-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details
pysylph-0.1.3-cp310-none-win_amd64.whl CPython 3.10 none Windows x86-64 Details
pysylph-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
pysylph-0.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ ARM64 Details
pysylph-0.1.3-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 13.9 MB

Release files / pysylph-0.1.3.tar.gz

Download URL pysylph-0.1.3.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
4e5edeb334ba3efacff16a097d165494f78b019466e74d85ee1673993b05c548
BLAKE2b-256 checksum
How to use checksums
6ddaf0538328d6607b22879e212a43f202de6ee458629ac8eb096d7320aeb987
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 1, 2026.

Transparency log

Release files / pysylph-0.1.3-cp311-abi3-win_amd64.whl

Download URL pysylph-0.1.3-cp311-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
57f850c73f2a5b4878f3367aea434e64bbc95427ad816018d8332c66be4e3271
BLAKE2b-256 checksum
How to use checksums
c92976685dc0cc608af37ffd848589ff413b0a19a10c5ebe92f364bc3181144f
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 1, 2026.

Transparency log

Release files / pysylph-0.1.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pysylph-0.1.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5f8fa849f8b1cd30bc8dd3d0c1a8f37b2028f1771c5edba6378fc0b16f88fe4e
BLAKE2b-256 checksum
How to use checksums
fa5be7d75014468d4227b90edf3799d1bcc202ad187a767fc688d511d693e61d
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 1, 2026.

Transparency log

Release files / pysylph-0.1.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL pysylph-0.1.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.4 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
c626ae43ffc04675687bb869c6d65ba95e8088809b604359353e990175e82989
BLAKE2b-256 checksum
How to use checksums
c619f342e993dcc9cf7f40e0d3a67d88d90228e07e6c1d6be25a2a8efd811896
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 1, 2026.

Transparency log

Release files / pysylph-0.1.3-cp311-abi3-macosx_11_0_arm64.whl

Download URL pysylph-0.1.3-cp311-abi3-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
659b69f10d3efffd62dd5210c45f8d2875d6a64e395baa528ccd34da427f7344
BLAKE2b-256 checksum
How to use checksums
3a68ed739b593b7010a855db3208ccfb8896967d5fe1ce429a33eed3d3383efc
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 1, 2026.

Transparency log

Release files / pysylph-0.1.3-cp311-abi3-macosx_10_12_x86_64.whl

Download URL pysylph-0.1.3-cp311-abi3-macosx_10_12_x86_64.whl
Size 1.4 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
a104063e7ff97b0e48c81a8caf3e593288800127feb55901ca995a94d23fa974
BLAKE2b-256 checksum
How to use checksums
b25575fe5ae87e01639bb9d8e5b9520b98169972d14a06b79eddc653501b4294
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 1, 2026.

Transparency log

Release files / pysylph-0.1.3-cp310-none-win_amd64.whl

Download URL pysylph-0.1.3-cp310-none-win_amd64.whl
Size 1.4 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
976ae115e3ff3e4694c8b94a602c19bf25080f2dcd0f7128d7bc3f77384a300b
BLAKE2b-256 checksum
How to use checksums
2a98f4e324ec06c1ce9da54fe2e6391c7ae1aae8f5ffe4a113bf015079fc296f
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 1, 2026.

Transparency log

Release files / pysylph-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pysylph-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2bccff9d73b763819f1693ef32bbdac4304c720b8543685c15be8de67b0ad2de
BLAKE2b-256 checksum
How to use checksums
e10650d6b6f11fb0be5b8bc7badb699b58f8641c4c7765d0b212dd3ca61913ea
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 1, 2026.

Transparency log

Release files / pysylph-0.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL pysylph-0.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.4 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
1a3401c5761181ce1248e915601070c29ab8f828d9ba6cfa159d5989ccb30346
BLAKE2b-256 checksum
How to use checksums
941f768a0fbae88ab09331df027534317adc46b6a3aa46ab7105d161c464a7a8
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 1, 2026.

Transparency log

Release files / pysylph-0.1.3-cp310-cp310-macosx_11_0_arm64.whl

Download URL pysylph-0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
55329c3afb56e628a3dd4572e75cef7fb0cdf6e24910ba169e52ce6d03a954cd
BLAKE2b-256 checksum
How to use checksums
60ee03f6fe7ee33d2f65b9318ef4a186aeabe02f0694b7c1aa809759028f78c6
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 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.3 This release

10 release files

0.1.1

22 release files

0.1.0

8 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