No description
Find a file
2018-12-19 16:16:58 -07:00
src add default ording function 2018-12-19 16:16:58 -07:00
.gitignore working install with license 2018-12-19 12:31:09 -07:00
LICENSE working install with license 2018-12-19 12:31:09 -07:00
LICENSE-variantkey working install with license 2018-12-19 12:31:09 -07:00
README.md handle long variants 2018-12-19 15:23:40 -07:00
variantkey.nimble working install with license 2018-12-19 12:31:09 -07:00

variantkey

nim wrapper for variantkey.

This wrapper can encode+decode about 5 million variants per second. The entirety of the API exposed by this library is demonstrated below:

import variantkey

var
  chrom = "19"
  pos = 3323934'u32
  # encode
  e = encode(chrom, pos, "A", "T")


assert e.exact
echo e # 10959892387821256704
echo e.decode # (chrom: "19", position: 3323934, reference: "A", alternate: "T", exact: true)

# longer variants are encoded with a hash
e = encode("1", 878111, "CAGGGGCCCCCGGGCTCCGGACCCCCCACCCCGTCCCGGGACTCTGCCCGGCGAGCCCCCCGGAA", "C")
# the reference and alternate are not set upon decoding.
echo e # (chrom: "1", position: 878111, reference: "", alternate: "")