Skip to main content

Python bindings for nsearch, an efficient BLAST-like sequence comparison algorithm written in C++

Project description

npysearch

npysearch implements an efficient BLAST-like sequence comparison algorithm, written in C++11 and using native Python datatypes and bindings. npysearch is light-weight, fast, and dependency-free. The code base of npysearch is adapted from nsearch.

Installation

from pypi

pip install npysearch

from conda-forge

Installing from the conda-forge channel can be achieved by adding conda-forge to your channes with:

conda config --add channels conda-forge
conda config --set channel_priority strict

You can skip the above step if conda-forge channel has been added already.

Once the conda-forge channel has been enabled, npysearch can be installed with:

conda install npysearch

from github

# Clone repository from github
git clone https://github.com/tamminenlab/npysearch.git

# Install package using pip
pip install ./npysearch

Examples

# Import npysearch package
import npysearch as npy

# Read query file into a dictionary
query = npy.read_fasta("npysearch/data/query.fasta")

# Read database file into a dictionary
database = npy.read_fasta("npysearch/data/db.fasta")

# BLAST the query against the database
results_dna = npy.blast(query, database)

# BLAST protein sequence file against itself using filenames as blast function arguments

results_prot = npy.blast(query = "npysearch/data/prot.fasta",
                   		 database = "npysearch/data/prot.fasta",
                     	 alphabet = "protein")

Caveats

  • The blast function automatically detects whether the query and database arguments were passed as string paths to fasta files or as dictionaries of sequences. Both of them need not be input as the same type.
  • Use help(npy) (assuming you've imported npysearch as npy) to get a list of the functions included and their docstrings. For docstrings of specific functions, for example blast, use help(npy.blast)

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

npysearch-1.3.1.tar.gz (38.0 kB view details)

Uploaded Source

Built Distributions

npysearch-1.3.1-cp310-cp310-win_amd64.whl (137.4 kB view details)

Uploaded CPython 3.10Windows x86-64

npysearch-1.3.1-cp310-cp310-manylinux_2_24_x86_64.whl (153.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64

npysearch-1.3.1-cp39-cp39-win_amd64.whl (137.4 kB view details)

Uploaded CPython 3.9Windows x86-64

npysearch-1.3.1-cp38-cp38-macosx_11_0_arm64.whl (161.3 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

Details for the file npysearch-1.3.1.tar.gz.

File metadata

  • Download URL: npysearch-1.3.1.tar.gz
  • Upload date:
  • Size: 38.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.10

File hashes

Hashes for npysearch-1.3.1.tar.gz
Algorithm Hash digest
SHA256 03c4b7a3be80f5168e6df3f9dc57cdca71d822f09a3a5d90994c308334a53f46
MD5 fcb45cb594ed8665d298c358b538062e
BLAKE2b-256 5cebb7a9c115c095361aaaea9457e60720a5b5c5bc5c0beea02d5c21a2b32ac8

See more details on using hashes here.

File details

Details for the file npysearch-1.3.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: npysearch-1.3.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 137.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.10

File hashes

Hashes for npysearch-1.3.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6702a9a5fc1d419c0f2cbb52eb40b2cb6c782d1fa3da016f367ce43e157d5b55
MD5 4efa04905332292afdc7ebc5afaf3f3f
BLAKE2b-256 4618c9c9bd317d9ad73ef1641c84e412ec43f955e6f717d491627985fd0a86cb

See more details on using hashes here.

File details

Details for the file npysearch-1.3.1-cp310-cp310-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for npysearch-1.3.1-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 112dd98de079b8dae276ed32b009394597c082ef1569d4710f19b8cb0c2ac2c1
MD5 23bf6633b8d6b4ff8a3eb39112716dbc
BLAKE2b-256 a5f19f1a0892ee0a2d5fac68cda32451cd64e7d51e38f1785fd0283108ef3015

See more details on using hashes here.

File details

Details for the file npysearch-1.3.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: npysearch-1.3.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 137.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.10

File hashes

Hashes for npysearch-1.3.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 47e7d0e8258808927ed7ab59dc11239141c17e652d871a356922949d34c9bc62
MD5 ee01808b84cabd2086eedf6c45ae7b0d
BLAKE2b-256 50684bc3946b2f1b66089e3146c5f64e2f8782bb1eaf9324bed2548362aee27b

See more details on using hashes here.

File details

Details for the file npysearch-1.3.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for npysearch-1.3.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e432f61da7c87d3293db72c6342ea3190fa0b477481684ec6080f2e6adf93248
MD5 7a86f08541a7d73d84b9dab7687585a6
BLAKE2b-256 8ad3745912d25a79b92b0a8d8987797f6c7416787511dc1db9cb2c0c44901b7d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page