An AA/NT sequence encoder using umap & pca
Project description
sequmap
Encode and embed sequences as kmer vectors (both NT and AA) and generate projections using UMAP
Setup
pip install sequmap
Usage
Embed and project sequences using
from sequmap import sequmap, NT_DICT
proj = sequmap(seqs, ndim, k = 5, lookup_dic = NT_DICT, n_neighbors = 30, min_dist = 0.001)
where seqs is an array of strings, ndim is the number of projected dimensions and k is the kmer size. By default, sequences are embedded by counting all unique kmers and the distance between sequences is estimated using the SquaredEuclidean distance between dimensionality-reduced kmer vector.
Additionally, a simpler seqpca method is included which just performs PCA in the kmer domain, used as follows:
from sequmap import seqpca, NT_DICT
proj = seqpca(seqs, ndim, k = 5, lookup_dic = NT_DICT)
The following lookup dictionaries are included for sequence encoding:
AA_DICT = Dict(
'A' => 1, 'C' => 2, 'D' => 3, 'E' => 4, 'F' => 5,
'G' => 6, 'H' => 7, 'I' => 8, 'K' => 9, 'L' => 10,
'M' => 11, 'N' => 12, 'P' => 13, 'Q' => 14, 'R' => 15,
'S' => 16, 'T' => 17, 'V' => 18, 'W' => 19, 'Y' => 20,
'*' => 21, 'X' => 22
)
NT_DICT = Dict('A' => 1, 'C' => 2, 'G' => 3, 'T' => 4)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sequmap-0.1.0.tar.gz.
File metadata
- Download URL: sequmap-0.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97901777600555c33c52ecf80beb4412738f5f6e363a43c3a347dea9f03b5195
|
|
| MD5 |
6b1d9a86015f8c560510240a1a340b94
|
|
| BLAKE2b-256 |
224bc659ee62571ee7357d6f32bbdb1347bb017659856bb7034ce117bb65ad43
|
File details
Details for the file sequmap-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sequmap-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94d511d531dbba2a846b1df525853d307394654d713f6ad00ce75e375aa0c909
|
|
| MD5 |
b6b67de30a21ec8a5aac55c7ba23d368
|
|
| BLAKE2b-256 |
92729b85dcccb877492fb19239c9f523e68c64b0e9a3c13ed9fdd6feba56c1ac
|