bio.kmer

Source code: bio/kmer.seq

class bio.kmer.Kmer[K]

Magic methods:

__new__()
__new__(k: 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__[N](pattern: str)

Methods:

len()
as_int()
extension str

Magic methods:

__prefix_k__[N](s: str)