Skip to main content
Help us improve Python packaging – donate today!

A script to encode/decode arbitrary computer files into DNA sequences.

Project Description

https://landscape.io/github/allanino/DNA/master/landscape.png https://travis-ci.org/allanino/DNA.svg?branch=master

This is a python script to encode/decode arbitrary computer files into DNA sequences. It is a straight implementation of a method published in this Nature’s paper. The details of the method can be found in the Supplementary Information report. The source code organization follows the article steps and nomenclature, so it should be easy to understand.

How to use

Install it using pip:

$ pip install file2dna

The installed script will be called dna and accepts four types of operations passed as arguments together with the file name:

$ dna -h
usage: dna [-h] [-e | -s | -d | -j] file

positional arguments:
  file        File to be encoded/decoded.

optional arguments:
  -h, --help  show this help message and exit
  -e          encode file and save it as .dna
  -s          encode file and save it as .splitted.zip
  -d          decode .dna file and save as .decoded
  -j          decoded .splitted.zip file and save it as .decoded

As a example, we can decode one the files encoded by the authors of the paper. Suppose you have cloned this repo with its examples folder:

$ dna -d examples/DNA_versions/wssnt10.txt.dna

To see the decoded file:

$ cat examples/DNA_versions/wssnt10.txt.decoded

Release history Release notifications

History Node

0.4

This version
History Node

0.3

History Node

0.2

History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
file2dna-0.3.tar.gz (5.2 kB) Copy SHA256 hash SHA256 Source None Sep 4, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page