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 the
original text. Text encoding is done for both ascii
and
utf-8
characters based on the strategy
keyword argument.
The encoding 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 | |
SageMaker StudioLab |
Demo App ✨
You can play around with GeneSpeak in this streamlit app: https://tinyurl.com/genespeak-demo
Usage ✋
import genespeak as gp
print(f'{gp.__name__} version: {gp.__version__}')
schema = "ATCG" # (1)
strategy = "ascii" # (2)
text = "Hello World!"
dna = gp.text_to_dna(text, schema=schema)
text_from_dna = gp.dna_to_text(dna, schema=schema)
print(f'Text: {text}\nEncoded DNA: {dna}\nDecoded Text: {text_from_dna}\nSuccess: {text == text_from_dna}')
Output
genespeak version: 0.0.5
Text: Hello World!
Encoded DNA: TACATCTTTCGATCGATCGGACAATTTGTCGGTGACTCGATCTAACAT
Text: Hello World!
Encoded DNA: TACATCTTTCGATCGATCGGACAATTTGTCGGTGACTCGATCTAACAT
Decoded Text: Hello World!
Documentation 📚
The genespeak
docs are maintained here.
License 📑
The library is available under MIT license.
Citation 🔖
You may cite this library as follows.
@software{ray2022genespeak,
author = {Ray, Sugato},
title = {{genespeak} - A library to encode text as DNA and decode DNA to text},
url = {https://github.com/sugatoray/genespeak}
}
GeneSpeak Thumb Print 👍
Let's have some fun! ✨ The following is a GeneSpeak thumbprint of genespeak
itself.
schema | strategy | thumbprint |
---|---|---|
ATCG |
ascii |
TCTGTCTTTCGCTCTTTGAGTGAATCTTTCATTCCG |
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
Built Distribution
Hashes for genespeak-0.0.9.dev1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03cb0d20214f123220976b64d788c76cc273910391b5f67a01120a2eeeef8054 |
|
MD5 | 4867dd614db0df0366e2087ad009a4c5 |
|
BLAKE2b-256 | 072c52e2abd4975035c18758cdab1d7e7968e43d45b9660680101fa9c4be3b39 |