Skip to main content

Python bindings for nsearch

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 github

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

# Install package using pip
pip3 install ./npysearch

Examples

# Import npysearch package
import npysearch as npy

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

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

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

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

results_prot = blast(query = "npysearch/inst/extdata/prot.fasta",
                     database = "npysearch/inst/extdata/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.1.0.tar.gz (36.6 kB view hashes)

Uploaded Source

Built Distributions

npysearch-1.1.0-cp39-cp39-manylinux_2_24_x86_64.whl (149.2 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64

npysearch-1.1.0-cp39-cp39-macosx_10_14_x86_64.whl (162.7 kB view hashes)

Uploaded CPython 3.9 macOS 10.14+ x86-64

npysearch-1.1.0-cp38-cp38-manylinux_2_24_x86_64.whl (148.9 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

npysearch-1.1.0-cp37-cp37m-manylinux_2_24_x86_64.whl (150.4 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.24+ x86-64

npysearch-1.1.0-cp36-cp36m-manylinux_2_24_x86_64.whl (150.3 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.24+ x86-64

Supported by

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