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

Uploaded CPython 3.8+Windows x86-64

sassy_rs-0.1.7-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.7-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.7-cp38-abi3-macosx_11_0_arm64.whl (326.1 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

sassy_rs-0.1.7-cp38-abi3-macosx_10_12_x86_64.whl (321.3 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: sassy_rs-0.1.7.tar.gz
  • Upload date:
  • Size: 6.2 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.7.tar.gz
Algorithm Hash digest
SHA256 2a068d5d088fae277d32159915322e85fd12a2428201a12ba24bdfc696c9a136
MD5 b87ca8c6b5e384ab2dcca73e389f3302
BLAKE2b-256 7658641db8e63478a21c73ecebc8ff479c7891ed3e7fa88af896fdd7649c261b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sassy_rs-0.1.7-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 199.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.7-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 229e546e534fb05ae865262c31c2ba58c3ec9ae28345a5db6f62dab9e22fbb4f
MD5 1d9395ba1e24331f1f87c62b3fca19b1
BLAKE2b-256 27d084dceb4b46ca5540b03ff47f5854247f714590a9f11b83ce2b03ff6917e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b25f89eb9254a5d62d9f021f3087b4b82f1707c570600da2edb6b5861e8123df
MD5 f93045fdc449f792542956049e1827f6
BLAKE2b-256 198c21735c8a167fce9abbc7cfd01cce25d1c59d5791616a22e99ed45bf00675

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.7-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0f5dce9e9e37675df1eb6a4e5ad4a71d78109181f47273b86116cf1abebffd69
MD5 1e7309b6834c8e86314e3bf04ca7138a
BLAKE2b-256 f80c203ba2dad722e5d459a53d2e3cfd715bd59672dd9a70a798a9426a765971

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.7-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c404971ff1a50016821a41586127758ca0fe0b2ba66215077e36916e083dc693
MD5 031a03de89e3e3a3569245fb8d8e6560
BLAKE2b-256 cc0c1430fb14f0c88d0022a750e6f21b20987262fcad56223ac7ff29b14ded34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sassy_rs-0.1.7-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 eaf66bd7429812ffb2262a64ef6eef4dc24ef9978a7277a51f3d10c744f9751a
MD5 8c425f9fe354350ea96851d308e0ece1
BLAKE2b-256 d6ec187586e9ae190aa05a96858ae40d0625b14e293fb9c1d46f44790c46ab52

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