Skip to main content

kmer_counter

Count kmers in regions or at SNVs or at indel breakpoints.

Requirements

kmer_counter requires Python 3.7 or above.

Installation

With pip:

pip install kmer_counter

With pipx:

pipx install kmer_counter

Usage

Counting k-mers at SNVs

To count the 3-mers at SNVs do:

kmer_counter snv {genome}.2bit {snv_file}

Where the {snv_file} should be a vcf-like text file where the first four columns are: Chromosome, Position, Ref_Allele, Alt_Allele. Fx:

chr1  1000000  A G
chr1  1000200  G C
chr1  1000300  A T
chr1  1000500  C G

Comments or header lines starting with "#" are allowed and will be ignored and any additional columns are also allowed but ignored. So a vcf file is also a valid input file. The Ref_Allele column should match the reference genome provided by the 2bit file. 2bit files can be downloaded from: https://hgdownload.cse.ucsc.edu/goldenpath/{genome}/bigZips/{genome}.2bit where {genome} is a valid UCSC genome assembly name (fx. "hg38").

Counting k-mers in genomic regions

To count all 5-mers in a bed file called {regions}.bed do:

kmer_counter background --bed {regions}.bed -radius 2 {genome}.2bit

By default all k-mers where the middle base is not A or C will be reverse complemented before being counted. This behaviour can be changed using the "--reverse_complement_method". If we instead wants to count 4-mers, we can use the "--before_after" option:

kmer_counter background --bed {regions}.bed --before_after 2 1 {genome}.2bit

When this option is used the default is not to reverse complement any of the k-mers but count all.

Counting k-mers at indels

To count one of the possible insertion breakpoint 4-mer for each insertion in a vcf-like file with variants do:

kmer_counter indel -r 2 --sample {genome}.2bit {variants} ins

And for deletion start breakpoints:

kmer_counter indel -r 2 --sample {genome}.2bit {variants} del_start

This will produce 2 counts for each deletion; one for the start breakpoint and one for the reverse complement at the k-mer at end breakpoint.

Metadata

Release files for kmer_counter 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kmer_counter 0.2.2
File Size Uploaded Provenance Actions
kmer_counter-0.2.2.tar.gz 8.0 kB Without provenance Details for kmer_counter-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kmer_counter 0.2.2
File Interpreter ABI Platform Actions
kmer_counter-0.2.2-py3-none-any.whl Python 3 none any Details for kmer_counter-0.2.2-py3-none-any.whl

Total release size: 17.2 kB

Release files / kmer_counter-0.2.2.tar.gz

Download URL kmer_counter-0.2.2.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
85c12e648e5b41d2c2608de291435309a274fe9e36f1e584b4daa396953cd093
BLAKE2b-256 checksum
How to use checksums
65c6ddfb83dc92c93ce70ad70f04be4741bc7115c577f434bedfa59b2a0c1853
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.9.15 Darwin/23.6.0

Release files / kmer_counter-0.2.2-py3-none-any.whl

Download URL kmer_counter-0.2.2-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68c06f2aca124e0267dca6859bd8f7c208b8fb5ef37f03067b348d5169e8b6cb
BLAKE2b-256 checksum
How to use checksums
c90761f9ab04096c3394a5c51670e6f2ca5a6eba7009bb80cb25688c674d6c7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.9.15 Darwin/23.6.0

Security for kmer_counter 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page