def decompress_seq(x, length, bits=64):
x = np.uint64(x)
assert length <= (bits/2 - 1)
if x & (1L << (bits-1)):
return 'N' * length
result = bytearray(length)
for i in xrange(length):
result[(length-1)-i] = tk_seq.NUCS[x & np.uint64(0b11)]
x = x >> np.uint64(2)
return str(result)
评论列表
文章目录