Skip to main content

pypi status python version Tests Release

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()

img.png

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)

Source distribution for mssw 0.1.5
File Size Uploaded
mssw-0.1.5.tar.gz 82.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mssw 0.1.5
File Interpreter ABI Platform
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

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

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page