Skip to main content

Fast approximate string searching using SIMD

Project description

simd-sassy Python Bindings

This directory contains the Python interface for the simd-sassy sequence search library, powered by Rust and PyO3.

Installation

You can install the package using maturin:

maturin develop --features python

Or install from PyPI (once published):

pip install simd-sassy

Usage

A simple usage is as follows:

pattern = b"ATCGATCG"
text = b"GGGGATCGATCGTTTT"
# alphabet: ascii, dna, uipac
searcher = sassy.Searcher("dna")
matches = searcher.search(pattern, text, k=1)
for i, match in enumerate(matches):
    print(f"Match {i+1}:")
    print(f"    Start: {match.text_start}")
    print(f"    End: {match.text_end}")
    print(f"    Cost: {match.cost}")
    print(f"    Strand: {match.strand}")
    print(f"    CIGAR: {match.cigar}")

This finds 3 matches:

Match 1:
    Start: 4
    End: 12
    Cost: 0
    Strand: +
    CIGAR: 8=
Match 2:
    Start: 6
    End: 14
    Cost: 1
    Strand: -
    CIGAR: 6=X=
Match 3:
    Start: 2
    End: 10
    Cost: 1
    Strand: -
    CIGAR: X7=

Further options are sassy.Searcher(alpha=0.5) to allow overhang alignments, and sassy.Searcher("dna", rc=False) to disable reverse complements for DNA or IUPAC strings.

See example.py for a larger example.

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

sassy_rs-0.1.1.tar.gz (63.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sassy_rs-0.1.1-cp38-cp38-win_amd64.whl (175.2 kB view details)

Uploaded CPython 3.8Windows x86-64

sassy_rs-0.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (339.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

sassy_rs-0.1.1-cp38-cp38-macosx_10_12_x86_64.whl (290.2 kB view details)

Uploaded CPython 3.8macOS 10.12+ x86-64

File details

Details for the file sassy_rs-0.1.1.tar.gz.

File metadata

  • Download URL: sassy_rs-0.1.1.tar.gz
  • Upload date:
  • Size: 63.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for sassy_rs-0.1.1.tar.gz
Algorithm Hash digest
SHA256 44ae1aaee5982f57151a2943519a1fdc83a35107071041368ad6696a86eb563d
MD5 1e8e62e7f2b89d7b06a951d34edcf272
BLAKE2b-256 120908bfcca88542456256ee55c301945b03a5d69e93c53c0816340fa0944684

See more details on using hashes here.

File details

Details for the file sassy_rs-0.1.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: sassy_rs-0.1.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 175.2 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for sassy_rs-0.1.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8bb603786830d9460ce2fb4131b0d936eeedffe678bb65b68fa9276c27952905
MD5 ab034d9f0df8dbafe954257618d94515
BLAKE2b-256 56e34784729d20af5fea1f0acdf374b62c2e2ac30c2e0ad2ddb50f824860be4a

See more details on using hashes here.

File details

Details for the file sassy_rs-0.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sassy_rs-0.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2d8b026b7532931e95e12a08f66358afdc059742ae1f0de8d70bcac77a9b1be7
MD5 3dcd3af573f8dc0128d22dd2dec9d830
BLAKE2b-256 552f0002c9783f88de7ca1690f16165e3b73f52d1d0c617805e624a61214ba54

See more details on using hashes here.

File details

Details for the file sassy_rs-0.1.1-cp38-cp38-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sassy_rs-0.1.1-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0a5d03494705ade0b20f0c0bb13000923795af5f7b51c4a60ffad6a86d1d0d65
MD5 bef4520833461e3497cafec2d5239bef
BLAKE2b-256 8dee631ccef36f3244344256f789a714316f9a5f3f33624068378e5e029e6104

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page