Fast probabilistic protein soft sequence alignment with AVX
Project description
softalign
A high-performance Python package for aligning "soft" biological sequences (probability distributions) using a C++ backend accelerated with AVX.
Installation
Install from PyPI (recommended; uses prebuilt wheels on macOS):
pip install softalign
Install directly from the source repository (developer path; requires a C++ toolchain):
pip install git+https://github.com/RSCJacksonLab/softalign.git
Note: installing from a Git URL always builds from source and will not use prebuilt wheels. For a no-toolchain install on macOS, use the PyPI release.
Usage Example
import numpy as np
from softalign import align_soft_sequences
# Define the standard 20-amino-acid alphabet
ALPHABET = list("ARNDCQEGHILKMFPSTWYV")
ALPHABET_SIZE = len(ALPHABET)
seq1 = np.random.rand(10, ALPHABET_SIZE)
seq1 = seq1 / seq1.sum(axis=1, keepdims=True)
seq2 = np.random.rand(12, ALPHABET_SIZE)
seq2 = seq2 / seq2.sum(axis=1, keepdims=True)
alignment, score = align_soft_sequences(
sequences=[seq1, seq2],
alphabet=ALPHABET,
gap_open=10.0,
gap_extend=0.5
)
aligned_seq1 = alignment[0]
aligned_seq2 = alignment[1]
print(f"Alignment Score: {score:.2f}")
print(f"Alignment Length: {aligned_seq1.shape[0]}")
Testing
To run the test suite, clone the repository and install the testing dependencies.
git clone https://github.com/RSCJacksonLab/softalign.git
cd softalign
# Install in editable mode with testing dependencies
# Use quotes for zsh compatibility
pip install -e '.[test]'
# Run tests
pytest
Maintainer Notes
- Supported Python versions: 3.10, 3.11, 3.12, 3.13.
- Wheels are built for macOS (arm64 + universal2) and Linux x86_64.
- Linux cp313 wheels are skipped on manylinux2014 due to SciPy wheel availability.
- Release process:
- Bump
versioninpyproject.toml. - Tag the commit as
vX.Y.Zand publish a GitHub release. - The
Publish to PyPIworkflow builds wheels + sdist and uploads via trusted publishing.
- Bump
- If a wheel build fails:
- Check the
Build Wheelsworkflow logs for CMake/compiler errors. - On Linux, SciPy compatibility is the most common failure mode; see the
version markers in
pyproject.toml. - Re-run the failed job after fixing CMake or dependency issues.
- Check the
- The sdist path is kept for developers; building from source on macOS requires Xcode CLT.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file softalign-1.0.0.tar.gz.
File metadata
- Download URL: softalign-1.0.0.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96b279b7d53327690b6e917918af87de921d31447a96ca765f9111e0960977f1
|
|
| MD5 |
b501fa733f75ebfdbc0900d0672ddf91
|
|
| BLAKE2b-256 |
304c5814e6ed8c3e485bf907097a1a91399bf32ab1ed1599f242e2a286c1b531
|
File details
Details for the file softalign-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: softalign-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 104.7 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c79cae063afd51aa6588f02dda09d17d6e7379efb8ec6693ecee4b8ae928045e
|
|
| MD5 |
59caf2981f271b7a61dfaf1467b5cea6
|
|
| BLAKE2b-256 |
84c1a1e8ac44cce4e2103392e2a61025eeb5d9344f98a3a3997a1eb2a6048028
|
File details
Details for the file softalign-1.0.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: softalign-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 71.0 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a97c4d8cfdabf4edd3a7f3ea78fcd555b7cc7f98164cf169ca0babcfa2ac09b7
|
|
| MD5 |
3943fce24f1730e2cc35a1cc9e017035
|
|
| BLAKE2b-256 |
65f612fc76697f394d6d20efb9a412d626ddbb30fc2491be797a0972b8ce56f0
|
File details
Details for the file softalign-1.0.0-cp312-cp312-macosx_11_0_arm64.macosx_11_0_x86_64.macosx_11_0_universal2.whl.
File metadata
- Download URL: softalign-1.0.0-cp312-cp312-macosx_11_0_arm64.macosx_11_0_x86_64.macosx_11_0_universal2.whl
- Upload date:
- Size: 137.4 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64, macOS 11.0+ universal2 (ARM64, x86-64), macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f864625c64c31836ec0adbf70d76330440531c71db2f07ceb16a7d7dc92cbbd8
|
|
| MD5 |
b8a4862ac274c099022da36ef0faef5e
|
|
| BLAKE2b-256 |
9358b4157be141e742871289a98b370dd7285161de45ba2ddd1196c2de5965c8
|
File details
Details for the file softalign-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: softalign-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 105.5 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfcdc9892e183682a1a8353522b2b4a07d72b0e44b573c7b722e8a2cc13f0f02
|
|
| MD5 |
80b1ee9108a2f7323805657c20846018
|
|
| BLAKE2b-256 |
31df3a8ea45123c1a8a24d62ed53946ac98dbb349368decf7c2c75b6092c0bfc
|
File details
Details for the file softalign-1.0.0-cp311-cp311-macosx_11_0_universal2.macosx_11_0_x86_64.macosx_11_0_arm64.whl.
File metadata
- Download URL: softalign-1.0.0-cp311-cp311-macosx_11_0_universal2.macosx_11_0_x86_64.macosx_11_0_arm64.whl
- Upload date:
- Size: 135.9 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64, macOS 11.0+ universal2 (ARM64, x86-64), macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72dae3dd87e1ecbbee79c0ff771fa49d9140f4a13a9acae16a071747be139637
|
|
| MD5 |
f047d78e571175cbeb43237fa8ecc4fb
|
|
| BLAKE2b-256 |
a9d76b807020784f7172202836ac190dc6b6e86da8d6adfc8b2a3c11b545cde0
|
File details
Details for the file softalign-1.0.0-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: softalign-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 70.5 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08d990736af6fc06017307fd55b22499bca22ee2ac1c91da41f384509ec2d35c
|
|
| MD5 |
74d81dc1ecbad3f9ced9cec8fa3c1bee
|
|
| BLAKE2b-256 |
8c1b1020c3cea2dfd1e8fe8b95611b335fc6e77c0e4e93f40ead506bb6de2d06
|
File details
Details for the file softalign-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: softalign-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 103.9 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d40d6ebed0b6f0437d22e6fc256a0b330d90f9d1f7b4b02eeb654d61825208b
|
|
| MD5 |
6170bc26646d41dd8f5c51edcc403fed
|
|
| BLAKE2b-256 |
fb97b6c3b0d015acf19ae52d8b596128246816353d4d0110b0a525627ebd2c24
|
File details
Details for the file softalign-1.0.0-cp310-cp310-macosx_11_0_x86_64.macosx_11_0_universal2.macosx_11_0_arm64.whl.
File metadata
- Download URL: softalign-1.0.0-cp310-cp310-macosx_11_0_x86_64.macosx_11_0_universal2.macosx_11_0_arm64.whl
- Upload date:
- Size: 132.9 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64, macOS 11.0+ universal2 (ARM64, x86-64), macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c574bd3a6eac7224999c97860a52597f3ae6922d8cf710631327f29719e4ab84
|
|
| MD5 |
14ee4905b9c707dfefc636c6fde49a35
|
|
| BLAKE2b-256 |
f55f0ad5ef5607d0aaafcd2eb77ec8abbf095dd5635ecd7a105c0269c0402bb1
|
File details
Details for the file softalign-1.0.0-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: softalign-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 69.2 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9460797003dbab90663a3a6b93a62bcc54a855447eddb53eeedafee81ee86dff
|
|
| MD5 |
dbadee7272fe82b3c1d4edc68da4bc89
|
|
| BLAKE2b-256 |
b200b7334fefb519730d9568dd366847d2813070d83762e2f00ad7cfd1c2d85f
|