Efficiently computes distances between protein sequences
Project description
pwseqdist
A small package that efficiently computes distances between protein sequences. Can accommodate similarity matrices, sequences of different lengths and custom metrics.
Install
pip install pwseqdist
Example
import pwseqdist as pw
import multiprocessing
from scipy.spatial.distance import squareform
peptides = ['CACADLGAYPDKLIF','CACDALLAYTDKLIF',
'CACDAVGDTLDKLIF','CACDDVTEVEGDKLIF',
'CACDFISPSNWGIQSGRNTDKLIF','CACDPVLGDTRLTDKLIF']
dvec = pw.apply_pairwise_sq(seqs = peptides,
metric = pw.metrics.nw_hamming_metric,
ncpus = multiprocessing.cpu_count() )
dmat = squareform(dvec).astype(int)
dmat
array([[ 0, 4, 6, 7, 15, 8],
[ 4, 0, 5, 7, 14, 7],
[ 6, 5, 0, 6, 14, 4],
[ 7, 7, 6, 0, 14, 8],
[15, 14, 14, 14, 0, 11],
[ 8, 7, 4, 8, 11, 0]])
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
pwseqdist-0.4.tar.gz
(23.9 kB
view details)
Built Distribution
pwseqdist-0.4-py3-none-any.whl
(29.1 kB
view details)
File details
Details for the file pwseqdist-0.4.tar.gz
.
File metadata
- Download URL: pwseqdist-0.4.tar.gz
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.2.post20200812 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16e7ddfdd7ae1a141b96fbc0a771be273a0e47c27353881aea2338795e7a9dc9 |
|
MD5 | e9b6aab68b31acbe1b57d28f2fd6b604 |
|
BLAKE2b-256 | 351b874a08b48bd24e4f59bf020d078142ff78df06b1e83f255f46cd48b79a71 |
File details
Details for the file pwseqdist-0.4-py3-none-any.whl
.
File metadata
- Download URL: pwseqdist-0.4-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.2.post20200812 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97f83959b9f69b25a7f9906da7a4555f4890f77a215c535d81dcd26eee73fd8e |
|
MD5 | f5c5651721c1406586751d5e87ebdc74 |
|
BLAKE2b-256 | 0c077263829d81e655c91b7dba74382e2d24849cf93686fd65d9642b202a20a4 |