Skip to content

zacg/dna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go dna

golang library for encoding/decoding information in DNA.

The algorithm is based on the method described in this Nature paper: http://www.nature.com/nature/journal/v494/n7435/full/nature11875.html . Pseudo code and details can be found here: http://www.nature.com/nature/journal/vaop/ncurrent/extref/nature11875-s2.pdf , the required huffman table is included in the repository.

Inspired by Allan Costa's python implementation: https://github.com/allanino/DNA

Example:

Encoding:

str := "some string to encode in DNA"
dna := dna.Encode(str)
fmt.Println("Result: ", dna)

Decoding:

dna := "ATAGTATATCGACTAGTACAGCGTAGCATCTCGCAGCGAGATACGCTGCTACGCAGCATGCTGTGAGTATCGATGACGAGTGACTCTGTACAGTACGTACGATACGTACGTACGTCGTATAGTCGTACGTACGTACGTACGTACGTACGTACTGTACAGAGTCACTCGTCATCGATACTCACAGCATGCTGCGTAGCAGCGTATCTCGCTGCGAGATGATACGTACGTACGAGC"
str := dna.Decode(dna)
fmt.Println("Result",str)

About

Golang library for encoding data as DNA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages