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.5.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.5-cp38-abi3-win_amd64.whl (193.7 kB view details)

Uploaded CPython 3.8+Windows x86-64

sassy_rs-0.1.5-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.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

sassy_rs-0.1.5-cp38-abi3-macosx_11_0_arm64.whl (320.7 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

sassy_rs-0.1.5-cp38-abi3-macosx_10_12_x86_64.whl (319.4 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: sassy_rs-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 daf6fcca0dd0db29cc65d2e087968dea092ad7678bf91a5fe225e0ea8e679326
MD5 9d8395922163c1555a97a4cc189f72cd
BLAKE2b-256 da5d271a56cc80ee07efdd028278955fbef109ffafb5b5cd1d303f3795dc74ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sassy_rs-0.1.5-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 193.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.5-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 45c59440fa4b28e9436d06dd77036effb3b9e358db0786b8c7ad92943b4dbbb2
MD5 e8a4d56f006dc1768927cc783e2af5ed
BLAKE2b-256 429eb54bf202ff80b7f423d5dfdfbb08a6ec9f50b65bc3ad07ce76a206462713

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3e1cc520f74b79bbe39505707630c59e792696d1c922d2a9830413a93173ba78
MD5 1d18aa3388ce7090dd51b185462ee924
BLAKE2b-256 b0a656715a77112e5dbcaa51fcd2dec753e6a365773e607adfa916f6fa182040

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6ef720c5cbece4898eebca2b112fa1615f1da1611579613a02ffd48b31e92de0
MD5 844907d64874301eedbbe6758f08052c
BLAKE2b-256 926d86fdc6cbc5a8a4dbcd2f1b79e6305f3bac2f03fef903e798ece5a2e2ab4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.5-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e504e9b4bd5f704d999fd02ac70b2a4c9061409308eb286ec22f395588896814
MD5 3696eae2a94b8a36a590732535006444
BLAKE2b-256 244acfa0a75ed32e7131140d3fee3b06dcf6692efbdeb56947e6162abde0aa44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.5-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 858ab2f54b6b77daa335ddf035960605cbb850f7b0fd0017a7dc7aef97e566a9
MD5 dd6142979d042c8e0deb6264b2681f91
BLAKE2b-256 7c8931b2cf53d132a90c64b597ad904a5ad79b90c8d6de2c4e86b8695b42c4e7

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