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.
Metadata
Release files for softalign 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| softalign-1.0.0.tar.gz | 17.9 kB | Details |
Built distributions (wheels)
Total release size: 948.9 kB
Release files / softalign-1.0.0.tar.gz
| Download URL | softalign-1.0.0.tar.gz |
|---|---|
| Size | 17.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96b279b7d53327690b6e917918af87de921d31447a96ca765f9111e0960977f1
|
|
BLAKE2b-256 checksum How to use checksums |
304c5814e6ed8c3e485bf907097a1a91399bf32ab1ed1599f242e2a286c1b531
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.12
|
Release files / softalign-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | softalign-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 104.7 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
c79cae063afd51aa6588f02dda09d17d6e7379efb8ec6693ecee4b8ae928045e
|
|
BLAKE2b-256 checksum How to use checksums |
84c1a1e8ac44cce4e2103392e2a61025eeb5d9344f98a3a3997a1eb2a6048028
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.12
|
Release files / softalign-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | softalign-1.0.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 71.0 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a97c4d8cfdabf4edd3a7f3ea78fcd555b7cc7f98164cf169ca0babcfa2ac09b7
|
|
BLAKE2b-256 checksum How to use checksums |
65f612fc76697f394d6d20efb9a412d626ddbb30fc2491be797a0972b8ce56f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.12
|
Release files / softalign-1.0.0-cp312-cp312-macosx_11_0_arm64.macosx_11_0_x86_64.macosx_11_0_universal2.whl
| Download URL | softalign-1.0.0-cp312-cp312-macosx_11_0_arm64.macosx_11_0_x86_64.macosx_11_0_universal2.whl |
|---|---|
| Size | 137.4 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 macOS 11.0+ universal2 (ARM64, x86-64) macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
f864625c64c31836ec0adbf70d76330440531c71db2f07ceb16a7d7dc92cbbd8
|
|
BLAKE2b-256 checksum How to use checksums |
9358b4157be141e742871289a98b370dd7285161de45ba2ddd1196c2de5965c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.12
|
Release files / softalign-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | softalign-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 105.5 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
cfcdc9892e183682a1a8353522b2b4a07d72b0e44b573c7b722e8a2cc13f0f02
|
|
BLAKE2b-256 checksum How to use checksums |
31df3a8ea45123c1a8a24d62ed53946ac98dbb349368decf7c2c75b6092c0bfc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.12
|
Release files / softalign-1.0.0-cp311-cp311-macosx_11_0_universal2.macosx_11_0_x86_64.macosx_11_0_arm64.whl
| Download URL | softalign-1.0.0-cp311-cp311-macosx_11_0_universal2.macosx_11_0_x86_64.macosx_11_0_arm64.whl |
|---|---|
| Size | 135.9 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 macOS 11.0+ universal2 (ARM64, x86-64) macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
72dae3dd87e1ecbbee79c0ff771fa49d9140f4a13a9acae16a071747be139637
|
|
BLAKE2b-256 checksum How to use checksums |
a9d76b807020784f7172202836ac190dc6b6e86da8d6adfc8b2a3c11b545cde0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.12
|
Release files / softalign-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | softalign-1.0.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 70.5 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
08d990736af6fc06017307fd55b22499bca22ee2ac1c91da41f384509ec2d35c
|
|
BLAKE2b-256 checksum How to use checksums |
8c1b1020c3cea2dfd1e8fe8b95611b335fc6e77c0e4e93f40ead506bb6de2d06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.12
|
Release files / softalign-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | softalign-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 103.9 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
1d40d6ebed0b6f0437d22e6fc256a0b330d90f9d1f7b4b02eeb654d61825208b
|
|
BLAKE2b-256 checksum How to use checksums |
fb97b6c3b0d015acf19ae52d8b596128246816353d4d0110b0a525627ebd2c24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.12
|
Release files / softalign-1.0.0-cp310-cp310-macosx_11_0_x86_64.macosx_11_0_universal2.macosx_11_0_arm64.whl
| Download URL | softalign-1.0.0-cp310-cp310-macosx_11_0_x86_64.macosx_11_0_universal2.macosx_11_0_arm64.whl |
|---|---|
| Size | 132.9 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 macOS 11.0+ universal2 (ARM64, x86-64) macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
c574bd3a6eac7224999c97860a52597f3ae6922d8cf710631327f29719e4ab84
|
|
BLAKE2b-256 checksum How to use checksums |
f55f0ad5ef5607d0aaafcd2eb77ec8abbf095dd5635ecd7a105c0269c0402bb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.12
|
Release files / softalign-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | softalign-1.0.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 69.2 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9460797003dbab90663a3a6b93a62bcc54a855447eddb53eeedafee81ee86dff
|
|
BLAKE2b-256 checksum How to use checksums |
b200b7334fefb519730d9568dd366847d2813070d83762e2f00ad7cfd1c2d85f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.12
|