Documentation ¶
Index ¶
Constants ¶
const ( CANONICAL = 1 << iota COMPACT )
const Version uint8 = 4
Version is the version of index format
Variables ¶
var ErrInvalidIndexFileFormat = errors.New("kmcp: invalid index format")
ErrInvalidIndexFileFormat means invalid index format.
var ErrNameAndIndexMismatch = errors.New("kmcp: size of names and indices unequal")
ErrNameAndIndexMismatch means size of names and sizes are not equal.
var ErrNameAndSizeMismatch = errors.New("kmcp: size of names and sizes unequal")
ErrNameAndSizeMismatch means size of names and sizes are not equal.
var ErrTruncateIndexFile = errors.New("kmcp: truncated index file")
ErrTruncateIndexFile means the file is truncated
var ErrUnfishedWrite = errors.New("kmcp: index not fished writing")
ErrUnfishedWrite means writing not finished
var ErrVersionMismatch = errors.New("kmcp: version mismatch")
ErrVersionMismatch means version mismatch between files and program
var ErrWrongWriteDataSize = errors.New("kmcp: write data with wrong size")
ErrWrongWriteDataSize means the size of data to write is invalid
var Magic = [8]byte{'.', 'k', 'm', 'c', 'p', 'i', 'd', 'x'}
Magic number of index file.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct { Version uint8 // uint8 K int // uint8 Canonical bool Compact bool NumHashes uint8 // uint8 NumSigs uint64 Names [][]string // one bloom filter contains union of multiple sets GSizes [][]uint64 // genome sizes // Kmers [][]uint64 // kmer numbers Indices [][]uint32 // coresponding chunk indices of all sets. Sizes []uint64 NumRowBytes int // length of bytes for storing one row of signiture for n names // contains filtered or unexported fields }
Header contains metadata
func (Header) Compatible ¶
Compatible checks compatibility
type Reader ¶
type Reader struct { Header // contains filtered or unexported fields }
Reader is for reading signatures.
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, compact bool, numHashes uint8, numSigs uint64, names [][]string, gsizes [][]uint64, indices [][]uint32, sizes []uint64) (*Writer, error)
NewWriter creates a Writer. func NewWriter(w io.Writer, k int, canonical bool, compact bool, numHashes uint8, numSigs uint64,
names [][]string, gsizes [][]uint64, kmers [][]uint64, indices [][]uint32, sizes []uint64) (*Writer, error) {
func (*Writer) WriteBatch ¶
WriteBatch writes a batch of data
func (*Writer) WriteHeader ¶
WriteHeader writes file header