umi

package
v0.0.0-...-d966d87 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SnapCorrector

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

SnapCorrector implements "snap" correction of UMIs. A umi U is snappable if there is a known non-random umi U1 that is closer to U than all other known umis, in terms of Levenshtein edit distance.

func NewSnapCorrector

func NewSnapCorrector(knownUMIs []byte) *SnapCorrector

NewSnapCorrector creates a new snap corrector. The knownUMIs are a \n separated list of UMIs (identical to the file content of a list of UMIs, where each line contains a UMI). Each UMI should consist of characters ACGTN.

func (*SnapCorrector) CorrectUMI

func (c *SnapCorrector) CorrectUMI(umi string) (correctedUMI string, edits int, corrected bool)

CorrectUMI returns a corrected umi, number of edits to the corrected umi, and true if there is exactly one known UMI that is closest to the original umi with respect to Levenshtein edit distance. Otherwise, return the original umi, -1, and false.

Jump to

Keyboard shortcuts

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