Skip to content

Archive of primer design and nucleic acid thermodynamics scripts used by the Das lab at Stanford for high-throughput RNA synthesis and design.

License

Notifications You must be signed in to change notification settings

ribokit/Primerize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Primerize (NA_Thermo)

Primerize Logo

Primerize (previously named NA_thermo), is an archive of Python and MATLAB scripts for primer design and nucleic acid thermodynamic scripts developed by the Das Lab at Stanford University for high-throughput RNA synthesis and design.

The algorithm designs forward (sense strand) and reverse (anti-sense strand) primers that minimize the total length, and therefore the total synthesis cost, of the oligonucleotides. Although developed independently, Primerize is a special case of the general ‘Gapped Oligo Design’ algorithm, optimizing the mispriming score and sequence span instead of Tm.

An online user-friendly GUI is available as the Primerize Server.

Installation

To install Primerize, simply:

cd path/to/Primerize/
python setup.py install

For system-wide installation, you must have permissions and use with sudo.

Primerize requires the following Python packages as dependencies, all of which can be installed through pip.

matplotlib >= 1.5.0
numpy >= 1.10.1
xlwt >= 1.0.0

Loop Optimization with numba (Optional)

To speed up Primerize code, we take advantage of @jit decorator of numba on loop optimization. This is totally optional. Enabling such feature may speed up the run for up to 10x.

numba requires llvm, which can be installed through apt-get on Linux or brew on Mac OSX. It also requires llvmlite, which can be installed through pip. The compatibility between numba, llvmlite, and llvm needs to pay special attention to. The below specified numba and llvmlite versions have been tested to work with llvm 3.6.2 on Linux machines.

llvmlite == 0.8.0
numba == 0.23.1

Or the following works with llvm 3.7.1.

llvmlite == 0.12.1
numba == 0.27.0

Newer version combinations may work, but we haven't test since.

Test

To test if Primerize is functioning properly in local installation, run the unit test scripts:

cd path/to/Primerize/tests/
python -m unittest discover

All test cases should pass.

Usage

For simple Primer Design tasks, follow this example:

import primerize

prm_1d = primerize.Primerize_1D
job_1d = prm_1d.design('TTCTAATACGACTCACTATAGGCCAAAGGCGUCGAGUAGACGCCAACAACGGAAUUGCGGGAAAGGGGUCAACAGCCGUUCAGUACCAAGUCUCAGGGGAAACUUUGAGAUGGCCUUGCAAAGGGUAUGGUAAUAAGCUGACGGACAUGGUCCUAACCACGCAGCCAAGUCCUAAGUCAACAGAUCUUCUGUUGAUAUGGAUGCAGUUCAAAACCAAACCGUCAGCGAGUAGCUGACAAAAAGAAACAACAACAACAAC', MIN_TM=60.0, NUM_PRIMERS=None, MIN_LENGTH=15, MAX_LENGTH=60, prefix='P4P6_2HP')
if job_1d.is_success:
	print job_1d

job_2d = primerize.Primerize_2D.design(job_1d, offset=-51, which_muts=range(102, 261 + 1), which_lib=1)
if job_2d.is_success:
	print job_2d
	job_2d.save()

job_3d = primerize.Primerize_3D.design(job_1d, offset=-51, structures=['...........................((((((.....))))))...........((((((...((((((.....(((.((((.(((..(((((((((....)))))))))..((.......))....)))......)))))))....))))))..)).))))((...((((...(((((((((...)))))))))..))))...)).............((((((.....))))))......................'], N_mutations=1, which_lib=1, is_single=True, is_fillWT=True)
if job_3d.is_success:
    print job_3d
    job_3d.save()

For advanced users, the returned Design_Single and Design_Plate result classes (refer to the Documentation) offer methods for get(), save() and echo():

MIN_TM = job_1d.get('MIN_TM')
print job_1d.get('MISPRIME')
print job_1d.echo('WARNING')
if job_1d.is_success:
	job_1d.save(path='result/', name='Primer')

LIB = job_2d.get('which_lib')
N_PRIMER = job_2d.get('N_PRIMER')
print job_2d.get('CONSTRUCT')
if job_2d.is_success:
	print job_2d.echo('region')
	job_2d.save('assembly', path='result/', name='Lib')

N_PLATE = job_3d.get('N_PLATE')
if job_3d.is_success:
    print job_3d.echo('plate')
    print repr(job_3d)

Besides design(), the Primerize_1D, Primerize_2D, and Primerize_3D factory instances offer methods for get(), set(), and reset():

COL_SIZE = prm_1d.get('COL_SIZE')
prm_1d.set('MIN_LENGTH', 30)
prm_1d.reset()

There are also Assembly, Mutation, Construct_List, and Plate_96Well helper classes. For more details, please refer to the Documentation.

Additionally, you can specify your customized list of mutations through the Primerize_Custom factory instance:

mut_list = primerize.util.Construct_List()
mut_list.push(['T120C'])
job_cm = primerize.Primerize_Custom.design(job_1d, offset=-51, mut_list=mut_list)

More importantly, you can use the merge() method of Construct_List to combine multiple results into one:

mut_list = job_2d.get('CONSTRUCT')
mut_list.merge(job_3d.get('CONSTRUCT'))
job_cm = primerize.Primerize_Custom.design(job_1d, offset=-51, mut_list=mut_list)
if job_cm.is_success:
    print job_2d
    job_2d.save()

MATLAB Code (Deprecated)

Instructions on MATLAB usage is available at old README.md. Please note that MATLAB code is no longer actively under development or fully maintained.

Documentation

Code Documentation is available at https://ribokit.github.io/Primerize/ or https://primerize.stanford.edu/docs/.

Experimental Protocol is available at https://primerize.stanford.edu/protocol/.

License

Copyright © of Primerize Source Code is described in LICENSE.md.

Reference

Tian, S., et al. (2015)
Primerize: Automated Primer Assembly for Transcribing Interesting RNAs.
Nucleic Acid Research 43 (W1): W522-W526.

Tian, S., and Das, R. (2017)
Primerize-2D: automated primer design for RNA multidimensional chemical mapping.
Bioinformatics 33 (9): 1405-1406.


Developed by Das lab, Leland Stanford Junior University.

README by t47, January 2016.

About

Archive of primer design and nucleic acid thermodynamics scripts used by the Das lab at Stanford for high-throughput RNA synthesis and design.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •