minhash

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package minhash is a simple KMV MinHash implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MinHash

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

MinHash is used to process hashed k-mers and return a sketch of minimums.

func New

func New(kSize, sketchSize int) *MinHash

New returns an initialised minhash object which is ready to receive hashed k-mers.

func (*MinHash) Add

func (mh *MinHash) Add(kmerChan <-chan uint64)

Add will check k-mers and add minimums to the sketch.

func (*MinHash) GetDistance

func (mh *MinHash) GetDistance(query *MinHash) (float64, error)

GetDistance returns the jaccard distance between two sketches.

func (*MinHash) GetSketch

func (mh *MinHash) GetSketch() []uint64

GetSketch returns the current sketch from the minhash object.

type Sketch

type Sketch []uint64

Sketch is a max-heap of uint64s.

func (Sketch) Len

func (mh Sketch) Len() int

func (Sketch) Less

func (mh Sketch) Less(i, j int) bool

func (*Sketch) Pop

func (mh *Sketch) Pop() interface{}

Pop will remove a uint64 from the first position in the Sketch.

func (*Sketch) Push

func (mh *Sketch) Push(x interface{})

Push will add a uint64 to a Sketch.

func (Sketch) Swap

func (mh Sketch) Swap(i, j int)

Jump to

Keyboard shortcuts

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