Skip to content

Latest commit

 

History

History
85 lines (65 loc) · 2.76 KB

README.md

File metadata and controls

85 lines (65 loc) · 2.76 KB

Adaptive Coder

Transform digital data to ATCG sequences for DNA storage in high logical density, while output sequences comply with arbitrary user-defined constraints.

First time setup

The following steps are required in order to run Adaptive Coder:

  1. Install Docker.

  2. Check GPUs are avaliable by running:

    docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

    The output of this command should show a list of your GPUs.

Running Adaptive Coder

The simplest way to run Adaptive Coder is using the provided Docker script. This was tested with 20 vCPUs, 64 GB of RAM, and a 3090 GPU.

  1. Launch the nvidia maintained container by running:

    docker run --gpus all -it --rm nvcr.io/nvidia/tensorflow:xx.xx-tf1-py3

Where xx.xx is the container version. For example, 21.12.

  1. Install the bert4keras dependencies in running container, then commit it as a new image for later use.

    pip install bert4keras
    docker commit <CONTAINER ID> adaptive-coder:1.0
  2. Clone this repository to your machine and cd into it.

    git clone https://github.com/chill868686/adaptive-coder.git
  3. Install the run_docker.py dependencies. Note: You can create a new environment by Conda or Virtualenv to prevent conflicts with your system's Python environment.

    pip3 install -r docker/requirements.txt
  4. Run run_docker.py pointing to a file containing digital data or DNA sequences which you wish to transform. You optionally provide parameters to command coding:

       python docker/run_docker.py --file_path=(file_path) [OPTIONS]
       OPTIONS(defaluts):
         --log=running.log \
         --model=best_model.weights \
         --docker_image_name=adaptive-coder:1.0 \
         --coding_type=en_decoding|encoding|decoding|training

    We provide the following pattern:

    1. DNA encoding&decoding:
     python docker/run_docker.py --file_path=mutimedias/poetry.txt
    1. DNA encoding:
     python docker/run_docker.py --file_path=mutimedias/poetry.txt --coding_type=encoding
    1. DNA decoding:
     python docker/run_docker.py --file_path=results/encodes/poetry.txt.dna --coding_type=decoding
    1. model training:
     python docker/run_docker.py --file_path=datasets/seq_good_256_m.txt --coding_type=training