Skip to main content

A library to encode text as DNA and decode DNA to text.

Project description

GeneSpeak

genespeak-banner

GitHub - License PyPI - Python Version PyPI - Package Version Conda - Platform Conda (channel only) Docs - GitHub.io

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 Colab Badge
Binder Binder

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

Docs - GitHub.io

The genespeak docs are maintained here.

License

GitHub - 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


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.7.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genespeak-0.0.7-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file genespeak-0.0.7.tar.gz.

File metadata

  • Download URL: genespeak-0.0.7.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for genespeak-0.0.7.tar.gz
Algorithm Hash digest
SHA256 ec12783122d1f6307c6103b3e237f0539b948024f20be5c97713e4bc13ed9234
MD5 eabf0ec1b3f620174576ef8b517e01e2
BLAKE2b-256 001214ec850ba870bec24834b4244b95422fff9433f0b385cb3657929e31da47

See more details on using hashes here.

File details

Details for the file genespeak-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: genespeak-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for genespeak-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e5d5277a15fce61d347c3123ad0cbfb7428da7ebfc226c71fe45d21c2ff8f72c
MD5 13a63b8fd7ffcff82c0856b38eed3eaa
BLAKE2b-256 5c78e05277a82edbbb68bf083683ba769a537686cbe9785c3b573d857d2bd7cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page