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 conda-forge -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
Built Distributions
File details
Details for the file kcounter-0.1.1.tar.gz
.
File metadata
- Download URL: kcounter-0.1.1.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200322 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c837e29d62d1889379a8b6a3ad634a6aa5f0bc0459d5719597c87e046502528 |
|
MD5 | e7af4e5e46caceca638ccd40bf7d654a |
|
BLAKE2b-256 | 5c87a1f492595bad53695ab2533d8fdc39bfcb3197edc0c0f1e94e02cd2ae6b4 |
File details
Details for the file kcounter-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a6acb88e26a3acb96034316b5839385efe1c55222f7a0b6a806793698f0980b |
|
MD5 | 002b01789424179f49c3a043a8fee8ef |
|
BLAKE2b-256 | 79c1469cf3161e80769c952e37d9c82e14d2b79e214278a10ff7df7fc731a005 |
File details
Details for the file kcounter-0.1.1-cp312-cp312-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp312-cp312-macosx_10_7_x86_64.whl
- Upload date:
- Size: 244.1 kB
- Tags: CPython 3.12, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21753c95f6c121df2bbc6dcb30c176bd066458ae4d018446cfad5b02c26afc29 |
|
MD5 | 9f4b6f8486d38fa8886c5e97c9f45627 |
|
BLAKE2b-256 | b88a0e13b84cfa9c35fdcae9cc0271193ebecb88e6f001a495ba29ee7cea5fda |
File details
Details for the file kcounter-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeaf0ec5adec03b6eecfbc277ade585c07bdd5568675aba8c9955ef9b9929f5a |
|
MD5 | bfd122cbd0cb0fd43fb76fc128c3cd46 |
|
BLAKE2b-256 | 87e33a36222216d7aca649086b7e94999222c6e5695ac468195d7782b1a11f12 |
File details
Details for the file kcounter-0.1.1-cp311-cp311-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp311-cp311-macosx_10_7_x86_64.whl
- Upload date:
- Size: 231.9 kB
- Tags: CPython 3.11, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06219e8af44c382577b2a6eab0ace03d3f6b85487d057c809e05a858ecd4e83a |
|
MD5 | cd5cd3be547b8d55d8b94fc807d34201 |
|
BLAKE2b-256 | 51176dfa601c712ce53feb4b6214ca15aa379dc51ce891d1800f57d3e00dcf5e |
File details
Details for the file kcounter-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 995.6 kB
- Tags: CPython 3.10, manylinux: glibc 2.5+ x86-64
- 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.61.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab107be6d79299ff5ac481f11512aa3998db7263f179fce63c7a1053ed3b8044 |
|
MD5 | 22cbbe8bcf8ce951fd503412ef89bf43 |
|
BLAKE2b-256 | ea0b913e5103fa9a7b9b4eb43471f68c4fdc7f512cba9747ec8590de4f62cc48 |
File details
Details for the file kcounter-0.1.1-cp310-cp310-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp310-cp310-macosx_10_7_x86_64.whl
- Upload date:
- Size: 226.0 kB
- Tags: CPython 3.10, macOS 10.7+ x86-64
- 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.61.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 428e81bdfe5db28e4154583634a863b0e4c89d355554237d3c4a29d7ffcd496b |
|
MD5 | a8f028cdfb577156b33052299e79574d |
|
BLAKE2b-256 | 3f868a54f0880b5f2a609811d33f85fc954ad66df74101b4a9ed3ffa311e03f6 |
File details
Details for the file kcounter-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 868.4 kB
- Tags: CPython 3.9, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200322 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 522413a35f2c9afbeb30a7d32b168b40d206735413a10b4afc82512a365e5b72 |
|
MD5 | c7f5a21062b23329d7c12e8b44bfb544 |
|
BLAKE2b-256 | d8bb2a17805177dbf17b22c62c65c30ecedf5460aa8406ea64cd814626deddc8 |
File details
Details for the file kcounter-0.1.1-cp39-cp39-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp39-cp39-macosx_10_7_x86_64.whl
- Upload date:
- Size: 210.8 kB
- Tags: CPython 3.9, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200322 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fdd02c443e987f56f9783776d4f9f58efb8005f1af2ddfb40280ba0881debfc |
|
MD5 | d70b3ce5831d84a6feee3a2bc07a5b49 |
|
BLAKE2b-256 | a0f140b9cef01eb26bda7962bd2f14bf4d9a715f5ed5224f2e18a619c1efdcd8 |
File details
Details for the file kcounter-0.1.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 868.2 kB
- Tags: CPython 3.8, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200322 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 709532a15d4aec00505c7bce2d75b5c448b0d4c3e6c1a2f6ba5637e27316d4b2 |
|
MD5 | 9c7cbe0d80aa63d90f3300a94510aea5 |
|
BLAKE2b-256 | 94f0aa84af17a7e06c535d3e7f7e56909e219fc5d1a2043dc15a8d67c7d445ae |
File details
Details for the file kcounter-0.1.1-cp38-cp38-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp38-cp38-macosx_10_7_x86_64.whl
- Upload date:
- Size: 210.9 kB
- Tags: CPython 3.8, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200322 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41eaeeb64273610150316d976cea389c343eebb2e874a9e8481ad8fc34441870 |
|
MD5 | 9ab0761da730c9066e4bf93dfc094709 |
|
BLAKE2b-256 | 14198547fe102be5ad0313950d39ef5c83eab2a06473c9d9319cc719fd0fc4af |
File details
Details for the file kcounter-0.1.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 868.2 kB
- Tags: CPython 3.7m, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200322 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01c0db11f9627c38121ddd29ac466eac1087269433ed7fd4c1452950b02516d2 |
|
MD5 | c3e2b21b0a007cdb8f5b430f8b444808 |
|
BLAKE2b-256 | 4e0ec61387d48d6b1b1771f27e6a8e364bee3da505c95c0984c8b260ca61b3e9 |
File details
Details for the file kcounter-0.1.1-cp37-cp37m-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp37-cp37m-macosx_10_7_x86_64.whl
- Upload date:
- Size: 210.9 kB
- Tags: CPython 3.7m, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200322 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | beb044cf1b2ce9d3457c59edbc6881d6527492f8dc4a96bf829f7c4a8b3f36ff |
|
MD5 | 1df23f1be041e6f2bbf5468e52c4240b |
|
BLAKE2b-256 | 373fb237cd070f1516a6ef89ab7e4be0a12e09853aca18e1164995b2d2fddf36 |
File details
Details for the file kcounter-0.1.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 868.2 kB
- Tags: CPython 3.6m, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200322 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 948922a0c221febc5273ec9fac3654cb2cc591f2238e977276f50e62982bc9e2 |
|
MD5 | d8e5507d74fc1263873b013735c4a986 |
|
BLAKE2b-256 | eb309f1e40ab9357592b3a65b222c33d2ef1d13f0caca71ea46d6c9302b5ad2e |
File details
Details for the file kcounter-0.1.1-cp36-cp36m-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: kcounter-0.1.1-cp36-cp36m-macosx_10_7_x86_64.whl
- Upload date:
- Size: 211.0 kB
- Tags: CPython 3.6m, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200322 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 562a0055669bda07bde1550c2f20a3a416071d960c1674eec895eac44fd053ab |
|
MD5 | e5df32ba4388983d81e09eabc5f85e11 |
|
BLAKE2b-256 | 02adce56accd1ea28f606aa7a082696a57b047a69b8a46fe8046699da30d1170 |