bio.kmer

Source code: bio/kmer.seq

extension Kmer[k]

Magic methods:

__new__()
__new__(kmer: Kmer[k])
__new__(p: Ptr[byte], L: int, b: bool)
__new__(s: seq)
__new__(s: seq, rc: bool)
__new__(s: seq)
__new__(s: str)
__new__(n: int)
__int__()
__copy__()
__invert__()
__getitem__(idx: int)
__lshift__(s: seq)
__rshift__(s: seq)
__sub__(other: Kmer[k])
Hamming distance algorithm:

input: kmer1, kmer2 mask1 = 0101…0101 (same bit width as encoded kmer) mask2 = 1010…1010 (same bit width as encoded kmer) popcnt(

(((kmer1 & mask1) ^ (kmer2 & mask1)) << 1) | ((kmer1 & mask2) ^ (kmer2 & mask2))

)

__hash__()
__len__()
__eq__(other: Kmer[k])
__ne__(other: Kmer[k])
__lt__(other: Kmer[k])
__gt__(other: Kmer[k])
__le__(other: Kmer[k])
__ge__(other: Kmer[k])
__contains__(s: seq)
__str__()
__pickle__(jar: Jar)
__unpickle__(jar: Jar)
__match__(pattern: str)

Methods:

len()
as_int()
extension str

Magic methods:

__prefix_k__[n](s: str)