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.2.tar.gz
(23.6 kB
view details)
Built Distribution
pwseqdist-0.2-py3-none-any.whl
(28.7 kB
view details)
File details
Details for the file pwseqdist-0.2.tar.gz
.
File metadata
- Download URL: pwseqdist-0.2.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66e0061c4474d9c78bcedb3923d8b578f9c0f5077d32f1234341038fcb508762 |
|
MD5 | be92214bea0ece3906289acfc62a0fa3 |
|
BLAKE2b-256 | c4597f87cb5b3f82572e2c4ac1fc88b505c7558e4fb2fa7828a3f9a5e087bba7 |
File details
Details for the file pwseqdist-0.2-py3-none-any.whl
.
File metadata
- Download URL: pwseqdist-0.2-py3-none-any.whl
- Upload date:
- Size: 28.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29ebba9e6933b7014da05a62c0e3972edb3f2c07e2bbefb0804b4900c619fd00 |
|
MD5 | 302a9ae8f7dbe2b638ea4c1c3222c955 |
|
BLAKE2b-256 | 83798ef8ec796e8f58f39466ec8824766912beaf657083472a032bf8cf0ed892 |