Documentation
¶
Index ¶
- Variables
- func ByteLength(n uint64) uint8
- func Hash64(key uint64) uint64
- func KmerBaseAt(code uint64, k uint8, i uint8) uint8
- func KmerHasPrefix(code uint64, prefix uint64, k1, k2 uint8) bool
- func KmerLongestPrefix(code1, code2 uint64, k1, k2 uint8) uint8
- func KmerPrefix(code uint64, k uint8, n uint8) uint64
- func KmerSuffix(code uint64, k uint8, i uint8) uint64
- func MustKmerHasPrefix(code uint64, prefix uint64, k1, k2 uint8) bool
- func MustKmerLongestPrefix(code1, code2 uint64, k1, k2 uint8) uint8
- func MustSharingPrefixKmersMismatch(code1, code2 uint64, k, p uint8) (n uint8)
- func PutUint64s(buf []byte, v1, v2 uint64) (ctrl byte, n int)
- func ReverseInts(s []int)
- func SharingPrefixKmersMismatch(code1, code2 uint64, k, p uint8) (n uint8)
- func Uint64s(ctrl byte, buf []byte) (values [2]uint64, n int)
- func UniqUint64s(list *[]uint64)
Constants ¶
This section is empty.
Variables ¶
var CtrlByte2ByteLengths = [64][2]uint8{
{1, 1},
{1, 2},
{1, 3},
{1, 4},
{1, 5},
{1, 6},
{1, 7},
{1, 8},
{2, 1},
{2, 2},
{2, 3},
{2, 4},
{2, 5},
{2, 6},
{2, 7},
{2, 8},
{3, 1},
{3, 2},
{3, 3},
{3, 4},
{3, 5},
{3, 6},
{3, 7},
{3, 8},
{4, 1},
{4, 2},
{4, 3},
{4, 4},
{4, 5},
{4, 6},
{4, 7},
{4, 8},
{5, 1},
{5, 2},
{5, 3},
{5, 4},
{5, 5},
{5, 6},
{5, 7},
{5, 8},
{6, 1},
{6, 2},
{6, 3},
{6, 4},
{6, 5},
{6, 6},
{6, 7},
{6, 8},
{7, 1},
{7, 2},
{7, 3},
{7, 4},
{7, 5},
{7, 6},
{7, 7},
{7, 8},
{8, 1},
{8, 2},
{8, 3},
{8, 4},
{8, 5},
{8, 6},
{8, 7},
{8, 8},
}
CtrlByte2ByteLengths is a table for query byte lenghts from the control byte.
Functions ¶
func ByteLength ¶
ByteLength returns the minimum number of bytes to store a integer.
func Hash64 ¶
https://gist.github.com/badboy/6267743 . version with mask: https://gist.github.com/lh3/974ced188be2f90422cc .
func KmerBaseAt ¶
KmerBaseAt returns the base in pos i (0-based).
func KmerHasPrefix ¶
KmerHasPrefix checks if a k-mer has a prefix.
func KmerLongestPrefix ¶
KmerLongestPrefix returns the length of the longest prefix.
func KmerPrefix ¶
KmerPrefix returns the first n bases. n needs to be > 0. The length of the prefix is n.
func KmerSuffix ¶
KmerSuffix returns the suffix starting from position i (0-based). The length of the suffix is k - commonPrefix.
func MustKmerHasPrefix ¶
MustKmerHasPrefix checks if a k-mer has a prefix, by assuming k1>=k2.
func MustKmerLongestPrefix ¶
MustKmerLongestPrefix returns the length of the longest prefix. We assume k1 >= k2.
func MustSharingPrefixKmersMismatch ¶
MustSharingPrefixKmersMismatch counts the number of mismatch between two k-mers sharing with a p-bp prefix. This function assumes p<k.
func PutUint64s ¶
PutUint64s encodes two uint64s into 2-16 bytes, and returns control byte and encoded byte length.
func SharingPrefixKmersMismatch ¶
SharingPrefixKmersMismatch counts the number of mismatch between two k-mers sharing with a p-bp prefix.
Types ¶
This section is empty.