Skip to main content

Python bindings for spoars — partial order alignment consensus and MSA

Project description

spoars (Python)

Python bindings for spoars — a faithful, SIMD-accelerated native-Rust reimplementation of the spoa partial order alignment (POA) library, for consensus generation and multiple sequence alignment.

Install

pip install spoars

Usage

import spoars

# One-call convenience:
g = spoars.poa(["ACGTACGT", "ACGTTCGT", "ACGTACGT"])
print(g.consensus())  # "ACGTACGT"
print(g.msa())  # ['ACGTACGT', 'ACGTTCGT', 'ACGTACGT']

# Or build incrementally, with an alignment type and scoring:
g = spoars.Poa(alignment_type="global", scoring=spoars.Scoring.default())
for read in ["ACGTACGT", "ACGTTCGT", "ACGTACGT"]:
    g.add(read)
print(g.consensus(min_coverage=2))
print(g.gfa())  # GFA v1
print(g.dot())  # Graphviz DOT

alignment_type is one of "global", "local", or "overlap". Scoring takes (match, mismatch, gap_open, gap_extend, gap_open2, gap_extend2); the gap model (linear/affine/convex) is inferred, and Scoring.default() is spoa's convex default (5, -4, -8, -6, -10, -4).

Development

This package is built with maturin and developed with pixi:

pixi run develop      # build & install the extension into the dev env
pixi run test         # rebuild + pytest
pixi run format-check
pixi run lint
pixi run typecheck

License

MIT — see the repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

spoars-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl (335.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

spoars-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl (292.0 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

spoars-0.1.0-cp310-abi3-macosx_11_0_arm64.whl (275.6 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file spoars-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spoars-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c2a42fe99d40ad511e02638e198f684aac991a40b7b5ea033a6be44cfe592528
MD5 c41d383e416a2f71338d7a0e690343be
BLAKE2b-256 3704224551e519ce1cbcffc02045add651d53ec5605e24d3519e85c40e9b7ca2

See more details on using hashes here.

Provenance

The following attestation bundles were made for spoars-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on fg-labs/spoars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spoars-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for spoars-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 aea7f74049fb585ebab9ee4b544aca2aac9193ddd9e8667a9ca2ddcbdd728e88
MD5 401fdd693c2abeaa4500af4500fc5247
BLAKE2b-256 291d72cc42d37787fba3bfecc5e1bb89a7dc7f6f69aaabd645998dc1682b72f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for spoars-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl:

Publisher: pypi.yml on fg-labs/spoars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spoars-0.1.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spoars-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd4c2173729b65bd4308b6673ec173c346e6d43e3c391e8365e4972147ae91a5
MD5 719381316811b197beda78afe100f133
BLAKE2b-256 c354c6760c33b2a6c034cc9cec3d77cd79ec29f6eb3647dc0f00fe34ee374d79

See more details on using hashes here.

Provenance

The following attestation bundles were made for spoars-0.1.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: pypi.yml on fg-labs/spoars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page