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
- type Bin
- type KmerSpectrum
- func (KmerSpectrum *KmerSpectrum) AddHash(kmer uint64) error
- func (KmerSpectrum *KmerSpectrum) Cardinality() int
- func (KmerSpectrum *KmerSpectrum) Dump() (<-chan *Bin, error)
- func (KmerSpectrum *KmerSpectrum) Print() string
- func (KmerSpectrum *KmerSpectrum) Size() uint
- func (KmerSpectrum *KmerSpectrum) Wipe()
Constants ¶
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 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