Skip to content

Instantly share code, notes, and snippets.

View jermp's full-sized avatar
🎯
Focusing

Giulio Ermanno Pibiri jermp

🎯
Focusing
View GitHub Profile
@shenwei356
shenwei356 / benchmark-encoding.md
Last active August 13, 2022 17:36
k-mer encoding and decoding

Functions:

# encoding: ACTG

def nuc2int_nochecking(b):
    return (ord(b) >> 1) & 3, True
    
def nuc2int_if(b):
    if b == 'a' or b == 'c' or b == 'g' or b == 't' \

or b == 'A' or b == 'C' or b == 'G' or b == 'T':