A library to encode text as DNA and decode DNA to text.
Project description
GeneSpeak
A library to encode text as DNA and decode DNA to text.
GeneSpeak allows you to encode regular text as DNA using base-pairs (A
, T
, G
, C
) and convert back to text. The coding scheme could be any combination of A
, T
, G
, C
.
Example
import genespeak as gp
print(f'{gp.__name__} version: {gp.__version__}')
schema = "ATCG"
text = "Hello World!"
dna = gp.text_to_dna(text, schema=schema)
print(f'Text: {text}\nEncoded DNA: {dna}\n')
text_from_dna = gp.dna_to_text(dna, schema=schema)
print(f'Text: {text}\nEncoded DNA: {dna}\nDecoded Text: {text_from_dna}\n')
Output
genespeak version: 0.0.3
Text: Hello World!
Encoded DNA: TACATCTTTCGATCGATCGGACAATTTGTCGGTGACTCGATCTAACAT
Text: Hello World!
Encoded DNA: TACATCTTTCGATCGATCGGACAATTTGTCGGTGACTCGATCTAACAT
Decoded Text: Hello World!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
genespeak-0.0.4.tar.gz
(8.8 kB
view hashes)
Built Distribution
Close
Hashes for genespeak-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0483bd7727c0f4a1947ddcb5782f5d6105e5f24ec5653cdeaaef7e42f7435000 |
|
MD5 | ec1527c5dc1e1052d5b7ae8c9faf8297 |
|
BLAKE2b-256 | 305e40c3cef57cd82be32245a0e4bd7839d7a95e17d410b85d7a80d3c2ac948f |