iterator

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 4 Imported by: 1

README

k-mer iterator

This package is very similar to the k-mer iterator.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptySeq = fmt.Errorf("k-mer iterator: empty sequence")

ErrEmptySeq sequence is empty.

View Source
var ErrIllegalBase = errors.New("k-mer iterator: illegal base")

ErrIllegalBase means that bases beyond IUPAC symbols are detected.

View Source
var ErrInvalidK = fmt.Errorf("k-mer iterator: invalid k-mer size (1 <= k <= 32)")

ErrInvalidK means k < 1 or K > 32

View Source
var ErrShortSeq = fmt.Errorf("k-mer iterator: sequence too short")

ErrShortSeq means the sequence is shorter than k.

Functions

This section is empty.

Types

type Iterator

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

Iterator is a nucleotide k-mer iterator.

func NewKmerIterator

func NewKmerIterator(s []byte, k int) (*Iterator, error)

NewKmerIterator returns a k-mer code iterator.

func (*Iterator) Index

func (iter *Iterator) Index() int

Index returns current 0-baesd index.

func (*Iterator) NextKmer

func (iter *Iterator) NextKmer() (code, codeRC uint64, ok bool, err error)

NextKmer returns next two k-mer codes. code is from the positive strand, codeRC is from the negative strand.

func (*Iterator) NextPositiveKmer

func (iter *Iterator) NextPositiveKmer() (code uint64, ok bool, err error)

NextPositiveKmer returns next the code of k-mer on the positive strand.

Jump to

Keyboard shortcuts

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