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, usehelp(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 hashes)
Built Distributions
Close
Hashes for npysearch-1.3.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6702a9a5fc1d419c0f2cbb52eb40b2cb6c782d1fa3da016f367ce43e157d5b55 |
|
MD5 | 4efa04905332292afdc7ebc5afaf3f3f |
|
BLAKE2b-256 | 4618c9c9bd317d9ad73ef1641c84e412ec43f955e6f717d491627985fd0a86cb |
Close
Hashes for npysearch-1.3.1-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 112dd98de079b8dae276ed32b009394597c082ef1569d4710f19b8cb0c2ac2c1 |
|
MD5 | 23bf6633b8d6b4ff8a3eb39112716dbc |
|
BLAKE2b-256 | a5f19f1a0892ee0a2d5fac68cda32451cd64e7d51e38f1785fd0283108ef3015 |
Close
Hashes for npysearch-1.3.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47e7d0e8258808927ed7ab59dc11239141c17e652d871a356922949d34c9bc62 |
|
MD5 | ee01808b84cabd2086eedf6c45ae7b0d |
|
BLAKE2b-256 | 50684bc3946b2f1b66089e3146c5f64e2f8782bb1eaf9324bed2548362aee27b |
Close
Hashes for npysearch-1.3.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e432f61da7c87d3293db72c6342ea3190fa0b477481684ec6080f2e6adf93248 |
|
MD5 | 7a86f08541a7d73d84b9dab7687585a6 |
|
BLAKE2b-256 | 8ad3745912d25a79b92b0a8d8987797f6c7416787511dc1db9cb2c0c44901b7d |