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.4.tar.gz (1.6 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.4-cp38-abi3-win_amd64.whl (196.7 kB view details)

Uploaded CPython 3.8+Windows x86-64

sassy_rs-0.1.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (348.9 kB view details)

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

sassy_rs-0.1.4-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.4-cp38-abi3-macosx_11_0_arm64.whl (306.4 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

sassy_rs-0.1.4-cp38-abi3-macosx_10_12_x86_64.whl (309.0 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: sassy_rs-0.1.4.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • 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.4.tar.gz
Algorithm Hash digest
SHA256 58154b4d5cb59ce4a492e1547e4e073196eae02e33baf3f9380946422097dfcd
MD5 c53b4c4f268739c44dee75df71d897e0
BLAKE2b-256 cba96101d7a1c96a664f482b619216335f8dec394d86c282522fa101056fe17d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sassy_rs-0.1.4-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 196.7 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.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7b1ccba63281d26835e3e70b77f57855dc5320d814d83a5d4e2629240c57adb5
MD5 bd34e10ddf12e3dcac3e7fb6325a479a
BLAKE2b-256 44485e1144e3ec6c653e60eeef5b342aa4172e7e9acf93d8f1f06fc534bff22d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 81c9b22999b91928cbbdd4524b5670abdfe54fdb3bf326e9dd36ab58c5f09c83
MD5 490f7ca495283383c41c0194f10484d1
BLAKE2b-256 b0e1fd7695c1882602c09d2cb764fa793c87f1c7870bec285a28f3ee3b12c1a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 73cde0df8497de61ffc752f598b3ba928eaf28e3753821c29fe7a813db31290a
MD5 9e0365754f37b8d1f7f4e4601734ee2b
BLAKE2b-256 8213ed6323acf4143acedbf06a9ccd6b83a242f34f467c422a1b51a3bc0a9f01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 20dfb8731e1eeb72aa3b30cc83fc41f80abec2509df7b6654c7e3bc753294add
MD5 33d54c3ce916641ab789c9117122340f
BLAKE2b-256 9f882b9c1bbd19aea44b0710c907a7067d60169c67644277419d9680a4d05b7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.4-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7434b6f6e8f4660c484b3f996201c1b92b3af09b30ae58f24390b6e82d63adc5
MD5 6adfc0c615a0090151f7c2c2d9f3eef1
BLAKE2b-256 3ba69b6ec6df32a2a1367ee9c94e10fcb36d81745d955d8167b11646f39bf88d

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