No project description provided
Project description
kcounter
A simple package for counting DNA k-mers in Python. Written in Rust.
Instalation
There are two ways to install kcounter
:
- Using pip:
pip install kcounter
- Using conda:
conda install -c bioconda kcounter
Usage
Currently, kcounter
provides a single function, count_kmers
, that returns a dictionary containing the k-mers of the chosen size.
>>> import kcounter
>>> kcounter.count_kmers('AAACTTTTTT', 3)
{'AAA': 1.0, 'ACT': 1.0, 'AAC': 1.0, 'CTT': 1.0, 'TTT': 4.0}
>>> kcounter.count_kmers('AAACTTTTTT', 4)
{'AACT': 1.0, 'CTTT': 1.0, 'ACTT': 1.0, 'AAAC': 1.0, 'TTTT': 3.0}
The relative_frequencies
parameter can be used to obtain relative k-mer frequencies:
>>> kcounter.count_kmers('AAACTTTTTT', 3, relative_frequencies=True)
{'AAC': 0.125, 'TTT': 0.5, 'CTT': 0.125, 'ACT': 0.125, 'AAA': 0.125}
The canonical_kmers
parameters aggregates the counts of reverse-complement k-mers (eg.: AGC/GCT):
>>> kcounter.count_kmers('AAACTTTTTT', 3, canonical_kmers=True)
{'ACT': 1.0, 'AAA': 5.0, 'AAC': 1.0, 'AAG': 1.0}
Plans for future versions:
- Performance improvements.
- Add an parameter that makes the function return a sparse k-mer counts.
- Implement a function that returns a numpy array.
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
kcounter-0.1.0.tar.gz
(17.4 kB
view hashes)
Built Distributions
Close
Hashes for kcounter-0.1.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f476beba1b797fd2e5fac68bc457cae4f1481a58c076b10b9548cbb2739df081 |
|
MD5 | ad0ae3d7f41971af8c9f713b5f449c9a |
|
BLAKE2b-256 | 916cf5aa7016966ba6bba343520480803af6ca72fcd5d23542c4252cfa4bd19b |
Close
Hashes for kcounter-0.1.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c8f8052d3782104a3bb2817e6cdf6b9281ec91be60368ad89c0a47e296b8204 |
|
MD5 | 79a589a223c15f5bce696fa58d6b9188 |
|
BLAKE2b-256 | 7a78e2634a38cb0699b9e8c7351bf74504776bc9e126f5091cdd9d71acaa7b70 |
Close
Hashes for kcounter-0.1.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb7fe565b1c8fc5f2784c4d19617175c9397d65629c1bb2ef085acd76c43cba4 |
|
MD5 | 0f5b59f21a6255776cff8f7bec19748d |
|
BLAKE2b-256 | 7b8cb58751b0de87b5d68ebdea8713a3bec6ce671af031baed5356786d8d414d |
Close
Hashes for kcounter-0.1.0-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4988456e09cb945a499c7600a7690b4356cff2d5298f7371841eee2f02ddec41 |
|
MD5 | 670f62b25a1f3ab44fe65ea9e1c3a9fc |
|
BLAKE2b-256 | 519f03220d7f12eaad50f723e90dc0a69598c1dd76c61313ca9c76b5ea61e3f3 |
Close
Hashes for kcounter-0.1.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b12d6fb3e17be9eaa52ca79b09e9009eebf30326e6e7b537d7dfd5af34428ba |
|
MD5 | 7a56376766070523d8ff14f32e0a05dc |
|
BLAKE2b-256 | f7f0644492e743ab00bff1555f5c628600414f112998d2a0fc360683abaee397 |
Close
Hashes for kcounter-0.1.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 507b2af3a2a1772ee9f613b7d79153228ce7f485e70363d7f8178303710d441b |
|
MD5 | 385445cba71152f13afbd088c3ce78a0 |
|
BLAKE2b-256 | e1bb668cd4c1c9ea6245d89f1f2b795da58810905fa69a9d5a0b460cb402294f |
Close
Hashes for kcounter-0.1.0-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9e62b496e7199b0b08c5821d6f8b80eeda5424da7c65492b9163264763acfc6 |
|
MD5 | a1818f5c12685521ffb80a505b36a8b8 |
|
BLAKE2b-256 | cb08485b6f9c4f63ea119a8c93b2d3016b217077e680cc3ded1c888126324f2b |
Close
Hashes for kcounter-0.1.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b811ea9d39948ca7eaf34cc1ab000566d0ebdf9db88b17e067002bf6e3b565c4 |
|
MD5 | bf436b0ebfe4ebbc5ddc1d22f473c1fd |
|
BLAKE2b-256 | 87e386989185f2fd8643f2ceb62c889ee808eb3ad6c365e3a1e6fe17899a16a8 |
Close
Hashes for kcounter-0.1.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d802ba89e8948f262584ae35e8df212453cc8d2363ab99a5d953ab981d0bc67b |
|
MD5 | 3d589feaf2e152b90af23ef3a2a4649d |
|
BLAKE2b-256 | 786bf3303ef378665e85bbdad2d76c7973f298f0628421bb9dd5b59bce1c25eb |