index

package
v0.18.8 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Version uint8 = 2

Version is the version of index format

Variables

View Source
var ErrInvalidIndexFileFormat = errors.New("unikmer/index: invalid index format")

ErrInvalidIndexFileFormat means invalid index format.

View Source
var ErrNameAndIndexMismatch = errors.New("unikmer/index: size of names and indices unequal")

ErrNameAndIndexMismatch means size of names and sizes are not equal.

View Source
var ErrNameAndSizeMismatch = errors.New("unikmer/index: size of names and sizes unequal")

ErrNameAndSizeMismatch means size of names and sizes are not equal.

View Source
var ErrTruncateIndexFile = errors.New("unikmer/index: truncated index file")

ErrTruncateIndexFile means the file is truncated

View Source
var ErrUnfishedWrite = errors.New("unikmer/index: index not fished writing")

ErrUnfishedWrite means writing not finished

View Source
var ErrVersionMismatch = errors.New("unikmer/index: version mismatch")

ErrVersionMismatch means version mismatch between files and program

View Source
var ErrWrongWriteDataSize = errors.New("unikmer/index: write data with wrong size")

ErrWrongWriteDataSize means the size of data to write is invalid

View Source
var Magic = [8]byte{'.', 'u', 'n', 'i', 'k', 'i', 'd', 'x'}

Magic number of index file.

Functions

This section is empty.

Types

type Header struct {
	Version   uint8 // uint8
	K         int   // uint8
	Canonical bool  // uint8
	NumHashes uint8 // uint8
	NumSigs   uint64
	Names     []string
	Indices   []uint32
	Sizes     []uint64

	NumRowBytes int // length of bytes for storing one row of signiture for n names
}

Header contains metadata

func (Header) Compatible

func (h Header) Compatible(b Header) bool

Compatible checks compatibility

func (Header) String

func (h Header) String() string

type Reader

type Reader struct {
	Header
	// contains filtered or unexported fields
}

Reader is for reading KmerCode.

func NewReader

func NewReader(r io.Reader) (reader *Reader, err error)

NewReader returns a Reader.

func (*Reader) Read

func (reader *Reader) Read() ([]byte, error)

Read reads one code.

type Writer

type Writer struct {
	Header
	// contains filtered or unexported fields
}

Writer writes KmerCode.

func NewWriter

func NewWriter(w io.Writer, k int, canonical bool, numHashes uint8, numSigs uint64, names []string, indices []uint32, sizes []uint64) (*Writer, error)

NewWriter creates a Writer.

func (*Writer) Flush

func (writer *Writer) Flush() (err error)

Flush check completeness

func (*Writer) Write

func (writer *Writer) Write(data []byte) (err error)

Write writes some thing

func (*Writer) WriteBatch

func (writer *Writer) WriteBatch(data []byte, n int) (err error)

WriteBatch writes a batch of data

func (*Writer) WriteHeader

func (writer *Writer) WriteHeader() (err error)

WriteHeader writes file header

Jump to

Keyboard shortcuts

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