bwt

package module
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

README

bwt

Go Reference Go Report Card

Burrows-Wheeler Transform and FM-index in golang

Install

This package is "go-gettable", just:

go get -u github.com/shenwei356/bwt

Licence

Copyright (c) 2015-2021, Wei Shen (shenwei356@gmail.com)

MIT License

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CheckEndSymbol = true

CheckEndSymbol is a global variable for checking end symbol before Burrows–Wheeler transform

View Source
var ErrEmptySeq = errors.New("bwt: empty sequence")

ErrEmptySeq means a empty sequence is given

View Source
var ErrEndSymbolExisted = errors.New("bwt: end-symbol existed in string")

ErrEndSymbolExisted means you should choose another EndSymbol

View Source
var ErrInvalidSuffixArray = errors.New("bwt: invalid suffix array")

ErrInvalidSuffixArray means length of sa is not equal to 1+len(s)

Functions

func FromSuffixArray

func FromSuffixArray(s []byte, sa []int, es byte) ([]byte, error)

FromSuffixArray compute BWT from sa

func InverseTransform

func InverseTransform(t []byte, es byte) []byte

InverseTransform reverses the bwt to original byte slice. Not optimized yet.

func SuffixArray

func SuffixArray(s []byte) []int

SuffixArray returns the suffix array of s. This function is the performance bottleneck of bwt and bwt/fmi package, with O(nlogn).

func Transform

func Transform(s []byte, es byte) ([]byte, error)

Transform returns Burrows–Wheeler transform of a byte slice. See https://en.wikipedia.org/wiki/Burrows%E2%80%93Wheeler_transform

Types

type SliceOfByteSlice added in v0.4.0

type SliceOfByteSlice [][]byte

SliceOfByteSlice is [][]byte

func (SliceOfByteSlice) Len added in v0.4.0

func (s SliceOfByteSlice) Len() int

func (SliceOfByteSlice) Less added in v0.4.0

func (s SliceOfByteSlice) Less(i, j int) bool

func (SliceOfByteSlice) Swap added in v0.4.0

func (s SliceOfByteSlice) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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