Modern C++ Binding for SSW Library
Changes
- Add Modern C++ Binding
- Use pybind11 Binding
- Provide Python api
Installation
$ pip install mssw
Benchmark
The result is tested in Linux x86_64 4 cores and 4GB of memory.
With BioPython
| Query Length | Reference Length | mssw Time (s) | bio python Time (s) | Speedup |
|---|---|---|---|---|
| 15 | 39 | 4.470348e-05 | 1.424551e-04 | 3.186666 |
| 150 | 390 | 2.179623e-04 | 2.270699e-03 | 10.41785 |
| 1500 | 3900 | 1.665862e-02 | 1.534623e-01 | 9.212187 |
| 15000 | 39000 | 1.696888e+00 | 1.574137e+01 | 9.276609 |
Usage
Example 1: Alignment with default filter and score matrix
import mssw
reference = "CAGCCTTTCTGACCCGGAAATCAAAATAGGCACAACAAA"
query = "CTGAGCCGGTAAATC"
# default match: int = 2, mismatch: int = 2, gap_open: int = 3, gap_extend: int = 1
aligner = mssw.Aligner()
aligner_filter = mssw.Filter()
alignment = aligner.align(query, reference, aligner_filter)
Example 2: Alignment with default filter and score matrix
import mssw
reference = "CAGCCTTTCTGACCCGGAAATCAAAATAGGCACAACAAA"
query = "CTGAGCCGGTAAATC"
aligner = mssw.Aligner()
alignment = aligner.align(query, reference)
Example 3: Alignment with filter But custom gap open and gap extension
import mssw
reference = "CAGCCTTTCTGACCCGGAAATCAAAATAGGCACAACAAA"
query = "CTGAGCCGGTAAATC"
aligner = mssw.Aligner(match=3, mismatch=1, gap_open=2, gap_extend=2)
alignment = aligner.align(query, reference)
Example 4: Alignment Result
import mssw
reference = "CAGCCTTTCTGACCCGGAAATCAAAATAGGCACAACAAA"
query = "CTGAGCCGGTAAATC"
aligner = mssw.Aligner(match=3, mismatch=1, gap_open=2, gap_extend=2)
alignment = aligner.align(query, reference)
assert alignment.sw_score == 21
assert alignment.sw_score_next_best == 2
assert alignment.ref_begin == 8
assert alignment.ref_end == 21
assert alignment.query_begin == 0
assert alignment.query_end == 14
assert alignment.ref_end_next_best == 0
assert alignment.mismatches == 2
assert alignment.cigar_string == "4=1X4=1I5="
Example 5: Print Alignment Result
import mssw
reference = "CAGCCTTTCTGACCCGGAAATCAAAATAGGCACAACAAA"
query = "CTGAGCCGGTAAATC"
aligner = mssw.Aligner(match=3, mismatch=1, gap_open=2, gap_extend=2)
alignment = aligner.align(query, reference)
alignment.print()
Metadata
Release files for mssw 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mssw-0.1.5.tar.gz | 82.5 kB | Without provenance | Details for mssw-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mssw-0.1.5-cp310-cp310-manylinux_2_31_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.31+ x86-64 | Details for mssw-0.1.5-cp310-cp310-manylinux_2_31_x86_64.whl |
Total release size: 285.8 kB
Release files / mssw-0.1.5.tar.gz
| Download URL | mssw-0.1.5.tar.gz |
|---|---|
| Size | 82.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6cee51b65defa41f37e3cdc228b892de2f247b94657baeab7379fe354ee5a02e
|
|
BLAKE2b-256 checksum How to use checksums |
29efc516271da7c0693faff5f81d7fbdb9ef24e3b687249319620cac366b6734
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Release files / mssw-0.1.5-cp310-cp310-manylinux_2_31_x86_64.whl
| Download URL | mssw-0.1.5-cp310-cp310-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 203.3 kB |
| Tags | CPython 3.10 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
381756479536d904d3b11d451b8ff4d26471822eb5c5bc79019a72ef6e21b34b
|
|
BLAKE2b-256 checksum How to use checksums |
cdceae2c6379262c93cf3741e2e6f5df1fbbd4adf3ea6ec23f69c4c70a8bd7d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Security for mssw 0.1.5
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.