kmerspectrum

package
v0.0.0-...-cbd5ca3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package kmerspectrum uses a Go implementation of the jump consistent hash algorithm to bin hashed k-mers into k-mer spectrum bins (ala histogram)

Index

Constants

View Source
const MIN_USED_BINS float64 = 0.01

MIN_USED_BINS is a threshold to change the behaviour of histosketching if the number of used bins in the k-mer spectrum < MIN_USED_BINS, then heuristics are used to add bins to a histosketch

Variables

This section is empty.

Functions

This section is empty.

Types

type Bin

type Bin struct {
	BinID     int32
	Frequency float64
}

kmerSpectrumBin is a helper struct used to send data from the k-mer spectrum

type KmerSpectrum

type KmerSpectrum struct {
	// contains filtered or unexported fields
}

kmerSpectrum is the datastructure for a k-mer spectrum

func NewKmerSpectrum

func NewKmerSpectrum(numBins int32) (*KmerSpectrum, error)

NewKmerSpectrum is the constructor function

func (*KmerSpectrum) AddHash

func (KmerSpectrum *KmerSpectrum) AddHash(kmer uint64) error

AddHash is a method to add a hashed k-mer to the spectrum

func (*KmerSpectrum) Cardinality

func (KmerSpectrum *KmerSpectrum) Cardinality() int

Cardinality is a method to calculate the number of currently used bins in the k-mer spectrum

func (*KmerSpectrum) Dump

func (KmerSpectrum *KmerSpectrum) Dump() (<-chan *Bin, error)

Dump is a method that returns each counter value in the CMS (returned via channel)

func (*KmerSpectrum) Print

func (KmerSpectrum *KmerSpectrum) Print() string

Print is a method to print the k-mer spectrum bin values as a comma separated list

func (*KmerSpectrum) Size

func (KmerSpectrum *KmerSpectrum) Size() uint

Size is a method to return the number of bins in the k-mer spectrum

func (*KmerSpectrum) Wipe

func (KmerSpectrum *KmerSpectrum) Wipe()

Wipe is a method to clear all the bins in a k-mer spectrum

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL