Modern Cpp binding for complete-striped-smith-watern-library
Project description
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()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mssw-0.1.5.tar.gz
(82.5 kB
view details)
Built Distribution
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 mssw-0.1.5.tar.gz.
File metadata
- Download URL: mssw-0.1.5.tar.gz
- Upload date:
- Size: 82.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cee51b65defa41f37e3cdc228b892de2f247b94657baeab7379fe354ee5a02e
|
|
| MD5 |
2d4fc9c6e43dd344ff2f511d2a481c5e
|
|
| BLAKE2b-256 |
29efc516271da7c0693faff5f81d7fbdb9ef24e3b687249319620cac366b6734
|
File details
Details for the file mssw-0.1.5-cp310-cp310-manylinux_2_31_x86_64.whl.
File metadata
- Download URL: mssw-0.1.5-cp310-cp310-manylinux_2_31_x86_64.whl
- Upload date:
- Size: 203.3 kB
- Tags: CPython 3.10, manylinux: glibc 2.31+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
381756479536d904d3b11d451b8ff4d26471822eb5c5bc79019a72ef6e21b34b
|
|
| MD5 |
a72a026609274687f6aa1c22041cb830
|
|
| BLAKE2b-256 |
cdceae2c6379262c93cf3741e2e6f5df1fbbd4adf3ea6ec23f69c4c70a8bd7d8
|