fmi

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FMIndex

type FMIndex struct {
	// EndSymbol
	EndSymbol byte

	// SuffixArray
	SuffixArray []int

	// Burrows-Wheeler Transform
	BWT []byte

	// First column of BWM
	F []byte

	// Alphabet in the BWT
	Alphabet []byte

	// Count of Letters in Alphabet.
	// CountOfLetters map[byte]int
	CountOfLetters []int // slice is faster han map

	// C[c] is a table that, for each character c in the alphabet,
	// contains the number of occurrences of lexically smaller characters
	// in the text.
	// C map[byte]int
	C []int // slice is faster han map

	// Occ(c, k) is the number of occurrences of character c in the
	// prefix L[1..k], k is 0-based.
	// Occ map[byte]*[]int32
	Occ []*[]int32 // slice is faster han map
}

FMIndex is Burrows-Wheeler Index

func NewFMIndex

func NewFMIndex() *FMIndex

NewFMIndex is constructor of FMIndex

func (*FMIndex) Last2First

func (fmi *FMIndex) Last2First(i int) int

Last2First mapping

func (*FMIndex) Locate

func (fmi *FMIndex) Locate(query []byte, mismatches int) ([]int, error)

Locate locates the pattern

func (*FMIndex) Match added in v0.5.0

func (fmi *FMIndex) Match(query []byte, mismatches int) (bool, error)

Match is a simple version of Locate, which returns immediately for a match.

func (*FMIndex) String

func (fmi *FMIndex) String() string

func (*FMIndex) Transform

func (fmi *FMIndex) Transform(s []byte) ([]byte, error)

Transform return Burrows-Wheeler-Transform of s

type Stack added in v0.4.0

type Stack []sMatch

Stack struct

func (Stack) Empty added in v0.4.0

func (s Stack) Empty() bool

Empty tell if it is empty

func (Stack) Peek added in v0.4.0

func (s Stack) Peek() sMatch

Peek return the last element

func (*Stack) Pop added in v0.4.0

func (s *Stack) Pop() sMatch

Pop pops element from the stack

func (*Stack) Put added in v0.4.0

func (s *Stack) Put(i sMatch)

Put puts element to stack

Jump to

Keyboard shortcuts

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