Skip to main content

BioSynth is a synthetic DNA design tool that eliminates unwanted patterns from sequences using a biologically informed cost model and optimized algorithms. It leverages a finite state machine with two-base memory and dynamic programming to generate minimum-cost sequences that preserve protein function, respect codon usage bias, and avoid unwanted patterns. The tool provides both GUI and CLI interfaces for flexible and efficient DNA design workflows.

Project description

Build Status Latest Release PyPI - Downloads License

Python Version

Flexible and comprehensive software app for design of synthetic DNA sequences without unwanted patterns

BioSynth is a software application for designing synthetic DNA sequences while eliminating unwanted patterns and considering codon usage bias.

Installation

Install BioSynth directly from PyPI:

pip install biosynth-tool

This will automatically install all required dependencies.

Using a Virtual Environment (Recommended)

To avoid conflicts, create a Python virtual environment before installation:

macOS/Linux:

python3 -m venv biosynth_venv
source biosynth_venv/bin/activate
pip install biosynth-tool

Ubuntu:

sudo apt-get update
sudo apt-get install -y libxcb-xinerama0 libxcb1 libxcb-util1 libx11-xcb1 libglu1-mesa qtbase5-dev qtwayland5
python3 -m venv biosynth_venv
source biosynth_venv/bin/activate
pip install biosynth-tool

Windows (Command Prompt):

 python -m venv biosynth_venv
 biosynth_venv\Scripts\activate
 pip install biosynth-tool

Pre Processing

To operate the application, the user must provide the following three input text files:

  1. Target sequence file – a plain text file containing a DNA sequence composed exclusively of the characters A, T, G, and C. The sequence must be provided on a single continuous line. For example:

    ATAGTACATATC
    
  2. Unwanted pattern list – a plain text file containing DNA patterns (substrings) that should be eliminated from the target sequence. Each pattern must appear on a separate line, separated by whitespace. For example:

    TAGTAC
    ATATCA
    
  3. Codon usage file – a plain-text file that defines the relative codon usage frequencies for a specific organism. To obtain and prepare this file:

    Step 1: Extract Codon Usage Data

    1. Visit the Kazusa Codon Usage Database:
      https://www.kazusa.or.jp/codon/

    2. Under the QUERY Box for search with Latin name of organism, enter the name of the organism. For example:
      Marchantia polymorpha

    3. Click the Submit button.

    4. In the search results, locate the desired genome type (e.g., chloroplast) and click the corresponding link under the Link column.

    5. The codon usage table will appear. Ensure to choose a format and then click submit. You should see the following header:

      fields: [triplet] [amino acid] [fraction] [frequency: per thousand] ([number])
      
    6. Select the entire codon usage table (not including the header), for example:

      UUU F 0.94 63.5 (  1558)  UCU S 0.40 25.8 (   634)  UAU Y 0.89 33.4 (   820)  UGU C 0.85  8.6 (   212)
      UUC F 0.06  4.4 (   107)  UCC S 0.05  3.0 (    73)  UAC Y 0.11  4.1 (   100)  UGC C 0.15  1.5 (    38)
      ...
      
    7. Copy and paste it into a plain text file.

    8. Save the file.

    Step 2: Convert to BioSynth Format

    1. Download local script named convert_kazusa_to_biosynth.py from the BioSynth repository: https://github.com/HadarPur/RU-BioSynth/blob/main/convert_kazusa_to_biosynth.py

    2. This script reads the codon usage file you just created and outputs a two-column text file in the format required by the BioSynth app: each line should contain a codon followed by its usage frequency, separated by whitespace.

    3. Run the script from the command line:

      cd /path/to/script_directory
      python ./convert_kazusa_to_biosynth.py <codon_usage_file_path> -o <output_file>
      
    4. The output file will consist of lines in the following form:

      TAC 0.56
      GCT 0.89
      ...
      

    This transformation ensures that rare codons have higher substitution costs, reflecting biological codon bias.

    Note:
    If you wish to get the table from another resource, please make sure to write your own converter script to ensure that you are in the right format.

Executing the Command Line Interface (CLI)

To execute the elimination tool via the terminal, use the following command:

biosynth -s <seq_file> -p <pattern_file> -c <codon_usage_file> -a <alpha> -b <beta> -w <w>

Examples

For example, you can run the program using short options:

biosynth -s s_file_no_coding.txt -p p_file_no_coding.txt -c biosynth_codon_usage.txt -a 1.02 -b 1.98 -w 99.96

Or, with the full option names:

# macOS/Linux (bash, zsh)
biosynth --target_sequence s_file_no_coding.txt \
         --unwanted_patterns p_file_no_coding.txt \
         --codon_usage codon_usage_chloroplast.txt \
         --alpha 1.02 \
         --beta 1.98 \
         --non_synonymous_w 99.96

Executing the Graphical User Interface (GUI)

To launch the graphical user interface of the elimination tool, run:

biosynth -g

You're all set! 🚀

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

biosynth_tool-2.0.0.tar.gz (3.1 MB view details)

Uploaded Source

Built Distribution

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

biosynth_tool-2.0.0-py3-none-any.whl (3.1 MB view details)

Uploaded Python 3

File details

Details for the file biosynth_tool-2.0.0.tar.gz.

File metadata

  • Download URL: biosynth_tool-2.0.0.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.6 Darwin/25.2.0

File hashes

Hashes for biosynth_tool-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5730ba540969b5130b7540ac90823c54cd23cb501e249c2b2631bd785d9c681a
MD5 22cc75fcbe47d0dcbff293547d9bfc6d
BLAKE2b-256 096e41cb428e65a7bd8565441e95ad9a1b871c5fdb0a99b0a67d4b54f0d2dde3

See more details on using hashes here.

File details

Details for the file biosynth_tool-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: biosynth_tool-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.6 Darwin/25.2.0

File hashes

Hashes for biosynth_tool-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33fcf8ae81c475fe85e430c49d1866e512fe0ad45f9d523d667238de4985829e
MD5 53d3dd52c3295626d901bf175549cc16
BLAKE2b-256 db404082159a6349f06d85e76af75b216edcc8ec065278a8cd5588ebbd7a1891

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