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
.
Installation
You can install the library via pip
or conda
.
Install with pip
pip install genespeak
Install with conda
conda install -c conda-forge genespeak
Quickstart
See the quickstart guide here.
Service | Link/Badge |
---|---|
Colab | |
Binder |
Usage
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.5.tar.gz
(10.5 kB
view hashes)
Built Distribution
Close
Hashes for genespeak-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b935345ea8925163f3e672a306c842a2f2e1e6ca8204da8cb1a35b04f20150c0 |
|
MD5 | 40b1ab3f9d63039d4c08acabf692f7bb |
|
BLAKE2b-256 | 2337cbf193f27244e8b2242d93b687f91ed59e8ab71b6850cd1d3b48da3e7a08 |