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.6.tar.gz (6.1 MB 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.6-cp38-abi3-win_amd64.whl (195.7 kB view details)

Uploaded CPython 3.8+Windows x86-64

sassy_rs-0.1.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB view details)

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

sassy_rs-0.1.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.5 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

sassy_rs-0.1.6-cp38-abi3-macosx_11_0_arm64.whl (320.4 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

sassy_rs-0.1.6-cp38-abi3-macosx_10_12_x86_64.whl (319.8 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: sassy_rs-0.1.6.tar.gz
  • Upload date:
  • Size: 6.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sassy_rs-0.1.6.tar.gz
Algorithm Hash digest
SHA256 3650ecf40af7c9e4adb6d4682140c9c70935e19423fb8509f5bcce465fdbe231
MD5 5afa6d568c0f9b90034a97ec8d9496ac
BLAKE2b-256 1e30f6ad7759ded74dbe877af6cee308098ab7f785d5c0ebef06906f8944a8de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sassy_rs-0.1.6-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 195.7 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sassy_rs-0.1.6-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 98efee690e4f7f7d41924f4b4d9d24b4e0bd3025eb925715e5977191cd6111e9
MD5 6e18b3f6878deea56247bbd1e0c3e2e3
BLAKE2b-256 d27df719ddf46926a4581974ffc8b020c798a9bbdc39bbc3a54e95d82c005667

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8bcd224e3d3f6fa82b2849e8dc339430a8eef90ab35a001f1c49947ff9f91777
MD5 d649b3e6e4f1c82f8f2147cdb26ecb61
BLAKE2b-256 a6e027e22756574f7be2feb84adfe00b0d8e5eff4156fbc433481c942c2ea657

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c798f1a2ed724c1e6944bdac6a916a196055e5966e0919acadb739da063e9633
MD5 243c821e0db64470b9ee47a88b0a8aa7
BLAKE2b-256 f03d5e39392696a6c6db58eb06443db7d41cc9533b7118179525f508f7cdec67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.6-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 783d77d66af4b407b116fc5920a952d599967901393e1102f0b154cb8c757e17
MD5 a8ba5f16616ae2888bab90fd1d31312f
BLAKE2b-256 4e68f27466259d40af2b1306bc4a23291ba9f46570e4104365a619e626785118

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.6-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2fc9e5d7a9c82ede31859b0112aa992bccd0112966ddf8a0613d998aa743efe6
MD5 cedf3193ad9fbec83f4f3bd3dc2885f6
BLAKE2b-256 0ff1b81365525c607dfcf8944a6bb8e68a1942acd0c48d99217bf649bfaa5f5d

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