Documentation
¶
Index ¶
- func ByteLengthUint32(n uint32) uint8
- func ByteLengthUint64(n uint64) uint8
- func CtrlByte2ByteLengthsUint32(ctrl byte) int
- func CtrlByte2ByteLengthsUint64(ctrl byte) int
- func Hash64(key uint64) uint64
- func IsLowComplexity(code uint64, k uint8) bool
- func IsLowComplexityDust(code uint64, k uint8) bool
- func KmerBaseAt(code uint64, k uint8, i uint8) uint8
- func KmerHasPrefix(code uint64, prefix uint64, k1, k2 uint8) bool
- func KmerHasSuffix(code uint64, suffix 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 MustKmerHasSuffix(code uint64, suffix 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 MustSharingPrefixKmersSuffixMatches(code1, code2 uint64, k, p uint8) (n uint8)
- func Ns(b uint64, k uint8) (code uint64)
- func PutUint32s(buf []byte, v1, v2, v3, v4 uint32) (ctrl byte, n int)
- 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 SharingPrefixKmersSuffixMatches(code1, code2 uint64, k, p uint8) (n uint8)
- func Uint32s(ctrl byte, buf []byte) (v1, v2, v3, v4 uint32, n int)
- func Uint64s(ctrl byte, buf []byte) (v1, v2 uint64, n int)
- func UniqUint64s(list *[]uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteLengthUint32 ¶ added in v0.3.0
ByteLengthUint32 returns the minimum number of bytes to store a integer.
func ByteLengthUint64 ¶ added in v0.3.0
ByteLengthUint64 returns the minimum number of bytes to store a integer.
func CtrlByte2ByteLengthsUint32 ¶ added in v0.3.0
CtrlByte2ByteLengthsUint32 returns the byte length for a given control byte.
func CtrlByte2ByteLengthsUint64 ¶ added in v0.3.0
CtrlByte2ByteLengthsUint64 returns the byte length for a given control byte.
func Hash64 ¶
https://gist.github.com/badboy/6267743 . version with mask: https://gist.github.com/lh3/974ced188be2f90422cc .
func IsLowComplexity ¶ added in v0.5.0
IsLowComplexity checks k-mer complexity according to the frequencies of 2-mer and 3-mer.
func IsLowComplexityDust ¶ added in v0.5.0
IsLowComplexity checks k-mer complexity with DUST algorithm
func KmerBaseAt ¶
KmerBaseAt returns the base in pos i (0-based).
func KmerHasPrefix ¶
KmerHasPrefix checks if a k-mer has a prefix.
func KmerHasSuffix ¶ added in v0.3.0
KmerHasSuffix checks if a k-mer has a suffix.
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 MustKmerHasSuffix ¶ added in v0.3.0
MustKmerHasSuffix checks if a k-mer has a suffix, 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 MustSharingPrefixKmersSuffixMatches ¶ added in v0.4.0
MustSharingPrefixKmersSuffixMatches counts the number of matches in the suffix region of two k-mers sharing with a p-bp prefix.
func PutUint32s ¶ added in v0.3.0
PutUint32s encodes four uint32s into 4-16 bytes, and returns control byte and encoded byte length.
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.
func SharingPrefixKmersSuffixMatches ¶ added in v0.4.0
SharingPrefixKmersMatches counts the number of matches in the suffix region of two k-mers sharing with a p-bp prefix.
Types ¶
This section is empty.