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
kcounter-0.1.1.tar.gz
(15.7 kB
view hashes)
Built Distributions
Close
Hashes for kcounter-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a6acb88e26a3acb96034316b5839385efe1c55222f7a0b6a806793698f0980b |
|
MD5 | 002b01789424179f49c3a043a8fee8ef |
|
BLAKE2b-256 | 79c1469cf3161e80769c952e37d9c82e14d2b79e214278a10ff7df7fc731a005 |
Close
Hashes for kcounter-0.1.1-cp312-cp312-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21753c95f6c121df2bbc6dcb30c176bd066458ae4d018446cfad5b02c26afc29 |
|
MD5 | 9f4b6f8486d38fa8886c5e97c9f45627 |
|
BLAKE2b-256 | b88a0e13b84cfa9c35fdcae9cc0271193ebecb88e6f001a495ba29ee7cea5fda |
Close
Hashes for kcounter-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeaf0ec5adec03b6eecfbc277ade585c07bdd5568675aba8c9955ef9b9929f5a |
|
MD5 | bfd122cbd0cb0fd43fb76fc128c3cd46 |
|
BLAKE2b-256 | 87e33a36222216d7aca649086b7e94999222c6e5695ac468195d7782b1a11f12 |
Close
Hashes for kcounter-0.1.1-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06219e8af44c382577b2a6eab0ace03d3f6b85487d057c809e05a858ecd4e83a |
|
MD5 | cd5cd3be547b8d55d8b94fc807d34201 |
|
BLAKE2b-256 | 51176dfa601c712ce53feb4b6214ca15aa379dc51ce891d1800f57d3e00dcf5e |
Close
Hashes for kcounter-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab107be6d79299ff5ac481f11512aa3998db7263f179fce63c7a1053ed3b8044 |
|
MD5 | 22cbbe8bcf8ce951fd503412ef89bf43 |
|
BLAKE2b-256 | ea0b913e5103fa9a7b9b4eb43471f68c4fdc7f512cba9747ec8590de4f62cc48 |
Close
Hashes for kcounter-0.1.1-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 428e81bdfe5db28e4154583634a863b0e4c89d355554237d3c4a29d7ffcd496b |
|
MD5 | a8f028cdfb577156b33052299e79574d |
|
BLAKE2b-256 | 3f868a54f0880b5f2a609811d33f85fc954ad66df74101b4a9ed3ffa311e03f6 |
Close
Hashes for kcounter-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 522413a35f2c9afbeb30a7d32b168b40d206735413a10b4afc82512a365e5b72 |
|
MD5 | c7f5a21062b23329d7c12e8b44bfb544 |
|
BLAKE2b-256 | d8bb2a17805177dbf17b22c62c65c30ecedf5460aa8406ea64cd814626deddc8 |
Close
Hashes for kcounter-0.1.1-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fdd02c443e987f56f9783776d4f9f58efb8005f1af2ddfb40280ba0881debfc |
|
MD5 | d70b3ce5831d84a6feee3a2bc07a5b49 |
|
BLAKE2b-256 | a0f140b9cef01eb26bda7962bd2f14bf4d9a715f5ed5224f2e18a619c1efdcd8 |
Close
Hashes for kcounter-0.1.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 709532a15d4aec00505c7bce2d75b5c448b0d4c3e6c1a2f6ba5637e27316d4b2 |
|
MD5 | 9c7cbe0d80aa63d90f3300a94510aea5 |
|
BLAKE2b-256 | 94f0aa84af17a7e06c535d3e7f7e56909e219fc5d1a2043dc15a8d67c7d445ae |
Close
Hashes for kcounter-0.1.1-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41eaeeb64273610150316d976cea389c343eebb2e874a9e8481ad8fc34441870 |
|
MD5 | 9ab0761da730c9066e4bf93dfc094709 |
|
BLAKE2b-256 | 14198547fe102be5ad0313950d39ef5c83eab2a06473c9d9319cc719fd0fc4af |
Close
Hashes for kcounter-0.1.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01c0db11f9627c38121ddd29ac466eac1087269433ed7fd4c1452950b02516d2 |
|
MD5 | c3e2b21b0a007cdb8f5b430f8b444808 |
|
BLAKE2b-256 | 4e0ec61387d48d6b1b1771f27e6a8e364bee3da505c95c0984c8b260ca61b3e9 |
Close
Hashes for kcounter-0.1.1-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | beb044cf1b2ce9d3457c59edbc6881d6527492f8dc4a96bf829f7c4a8b3f36ff |
|
MD5 | 1df23f1be041e6f2bbf5468e52c4240b |
|
BLAKE2b-256 | 373fb237cd070f1516a6ef89ab7e4be0a12e09853aca18e1164995b2d2fddf36 |
Close
Hashes for kcounter-0.1.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 948922a0c221febc5273ec9fac3654cb2cc591f2238e977276f50e62982bc9e2 |
|
MD5 | d8e5507d74fc1263873b013735c4a986 |
|
BLAKE2b-256 | eb309f1e40ab9357592b3a65b222c33d2ef1d13f0caca71ea46d6c9302b5ad2e |
Close
Hashes for kcounter-0.1.1-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 562a0055669bda07bde1550c2f20a3a416071d960c1674eec895eac44fd053ab |
|
MD5 | e5df32ba4388983d81e09eabc5f85e11 |
|
BLAKE2b-256 | 02adce56accd1ea28f606aa7a082696a57b047a69b8a46fe8046699da30d1170 |