Skip to main content

Fast approximate string searching using SIMD

Project description

Sassy Python Bindings

🐍 The python bindings for Sassy

Installation

Pip.

pip install sassy-rs

(as sassy was already taken we chose sassy-rs)

From source. In the root of the repository, run:

maturin develop --features python

You need Maturin for this, see maturin:

Usage

A simple usage is as follows:

import sassy
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 sassy/example.py for a larger example.

Troubleshooting

1. I could install sassy-rc but no modules/functions are found.

When creating an issue please include the output of print(dir(sassy)) if you were able to install sassy-rs but no functions/modules were found.

Your output might look like:

['__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']

Whereas it should look like:

['Searcher', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'features', 'sassy']

2. Other sassy issues.

If you were able to install sassy, but have other issues please also add the output of sassy.features().

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.3.tar.gz (930.6 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.3-cp38-abi3-win_amd64.whl (197.8 kB view details)

Uploaded CPython 3.8+Windows x86-64

sassy_rs-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (352.3 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

sassy_rs-0.1.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (338.9 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

sassy_rs-0.1.3-cp38-abi3-macosx_11_0_arm64.whl (306.5 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

sassy_rs-0.1.3-cp38-abi3-macosx_10_12_x86_64.whl (315.7 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: sassy_rs-0.1.3.tar.gz
  • Upload date:
  • Size: 930.6 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.3.tar.gz
Algorithm Hash digest
SHA256 2afb5dc1a0cf57e39c3f036d88e05477ed0a9c8411ce3c1786cf84cca8f6dc6a
MD5 8895657813fdc40dcd5d320ae76cbfc2
BLAKE2b-256 f7bd16c86928422ac935e6833489b9c7f954929f5e8711be205b81dc5c740373

See more details on using hashes here.

File details

Details for the file sassy_rs-0.1.3-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: sassy_rs-0.1.3-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 197.8 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.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ae9907140173f355c73d3d835c041f26c811823b78564d6852a281458b701717
MD5 f4dcb8fc6e575e491f10bfff568bbcee
BLAKE2b-256 43e940848295b256eafcf0307ccf5c0a92820ed2a207ab2e98b953586c6c601f

See more details on using hashes here.

File details

Details for the file sassy_rs-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sassy_rs-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c77b774b2b26e2c5710d73a5fc61abaebc26b6bc0f0539e531b39de587b9b36e
MD5 fdcb5287cc79fcf661f864b3609b4481
BLAKE2b-256 acdeb24362864a34574a02905a0be3d22cccfaf8bc753f4cdaee8f85aea90291

See more details on using hashes here.

File details

Details for the file sassy_rs-0.1.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for sassy_rs-0.1.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a0e27998a3ff9ab133646ca94ba646df0d2b081fb9f79f0211670a512b460aad
MD5 ba46195c0ab2a953836975a7913bab0f
BLAKE2b-256 a80a5371f336eaeb49c3ae3197b8779dc6cd4a1a797a852f16b39b106242a706

See more details on using hashes here.

File details

Details for the file sassy_rs-0.1.3-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sassy_rs-0.1.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9dcf98f64da6e7aa33af8709db21fdbab905583d3701cfc4d0ca67691c13d171
MD5 2426d119abe55691375611e84ba65b53
BLAKE2b-256 69e06774ffce9549270f531e74c61b0a245af075a0ac8c52fea7d56171988577

See more details on using hashes here.

File details

Details for the file sassy_rs-0.1.3-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sassy_rs-0.1.3-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 833e28d7df24c9438f3eccea292264115abb6635cab95251837ac771ada1c0f6
MD5 686071d005c253969924141cdfc9502c
BLAKE2b-256 21bf56acdf5c70c46d9996edeedc11323c903ccd7c753dc0af77444ff7011e62

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