Primer Designer was written to automate the Buckley Lab primer design process. It is essentially just a wrapper around Primer3 with extra modules to pull sequence data from Ensembl and to check secondary structure formation with Unafold.

Code for Primer Designer is on Github, feel free to fork.

Installation

These instructions are based on an installation of Scientific Linux release 6.2 (Carbon). It should be the same for any RHEL6 variant. Other Linux distributions will be similar but might need adjustments for different package requirements and package managers. I haven’t tried getting it to work under Windows, if you manage it, let me know.

Prerequisites

Bioperl

Just follow the Bioperl instructions to install Bioperl and Bioperl-run via CPAN. You’ll need to force install Bioperl run as they are all wrappers for bioinformatics tools and their tests will fail if you don’t have the relevant tools installed. If you’re starting from a vanilla Perl install, this will install a lot of dependencies and takes a little while.


> yum install expat expat-devel perl-CPAN libtidyp libtidyp-devel
> perl -MCPAN -e shell
cpan> install Bundle::CPAN
cpan> install Module::Build
cpan> o conf prefer_installer MB
cpan> o conf commit
cpan> d /bioperl/
cpan> install C/CJ/CJFIELDS/BioPerl-1.6.901.tar.gz
cpan> install Algorithm::Diff
cpan> install File::Sort
cpan> install IPC::Run
cpan> install XML::XPath
cpan> install XML::XPathEngine
cpan> install XML::Simple
cpan> install XML::Handler::YAWriter
cpan> install XML::SAX::Writer
cpan> install HTML::TreeBuilder
cpan> install HTML::Entities::Numbered
cpan> install HTML::Tidy
cpan> install Tie::IxHash
cpan> install Test::Pod
cpan> install IO::Scalar
cpan> install IO::CaptureOutput
cpan> install XML::Twig
cpan> install Array::Compare
cpan> install Tree::DAG_Node
cpan> install Test::Exception
cpan> install Test::Warn
cpan> install Test::Most
cpan> install Module::Find
cpan> install JSON
cpan> force install CJFIELDS/BioPerl-Run-1.006900.tar.gz

Ensembl Perl API

You can ignore the requirement for an ancient version of Bioperl for this application, Primer Designer will work fine with the current version (actually most stuff will work fine with the current version). I generally install into /opt from cvs as follows (update version number if needed).


> mkdir -p /opt/ensembl67
> cd /opt/ensembl67
> cvs -d :pserver:cvsuser@cvs.sanger.ac.uk:/cvsroot/ensembl login
Logging in to :pserver:cvsuser@cvs.sanger.ac.uk:2401/cvsroot/ensembl
CVS password: CVSUSER
> cvs -d :pserver:cvsuser@cvs.sanger.ac.uk:/cvsroot/ensembl checkout -r branch-ensembl-67 ensembl
> cvs -d :pserver:cvsuser@cvs.sanger.ac.uk:/cvsroot/ensembl checkout -r branch-ensembl-67 ensembl-variation
> cvs -d :pserver:cvsuser@cvs.sanger.ac.uk:/cvsroot/ensembl checkout -r branch-ensembl-67 ensembl-functgenomics
> cvs -d :pserver:cvsuser@cvs.sanger.ac.uk:/cvsroot/ensembl checkout -r branch-ensembl-67 ensembl-compara
> cvs -d :pserver:cvsuser@cvs.sanger.ac.uk:/cvsroot/ensembl checkout -r branch-ensembl-67 ensembl-api

Then you just need to tell Perl where your new modules are by adding all these locations to your $PERL5LIB environment variable.

In RHEL, you can just add files in /etc/profile.d/


/etc/profile.d/ensembl.sh:
PERL5LIB=${PERL5LIB}:/opt/ensembl67/ensembl/modules
PERL5LIB=${PERL5LIB}:/opt/ensembl67/src/ensembl-compara/modules
PERL5LIB=${PERL5LIB}:/opt/ensembl67/src/ensembl-variation/modules
PERL5LIB=${PERL5LIB}:/opt/ensembl67/src/ensembl-functgenomics/modules
export PERL5LIB


/etc/profile.d/ensembl.csh:
setenv PERL5LIB ${PERL5LIB}:/opt/ensembl67/ensembl/modules
setenv PERL5LIB ${PERL5LIB}:/opt/ensembl67/src/ensembl-compara/modules
setenv PERL5LIB ${PERL5LIB}:/opt/ensembl67/src/ensembl-variation/modules
setenv PERL5LIB ${PERL5LIB}:/opt/ensembl67/src/ensembl-functgenomics/modules

It is worth noting that the API is tied to a specific database version, so if Ensembl gets a new release and you want to use it, you’ll need to install the new API modules.

Primer3

Download the most recent primer3 from sourceforge, unpack and install. The following is an example, change filenames and version numbers appropriately.

Note that we copy the primer3_config dir, containing all the thermodynamic parameters, to /opt. This is the default location and primer3 knows to look here. If you want to put it somewhere else, you’ll need to specify its location in your primer3 settings with PRIMER_THERMODYNAMIC_PARAMETERS_PATH.


mkdir /opt/primer3
cd /opt/primer3
curl -L "http://downloads.sourceforge.net/project/primer3/primer3/2.3.4/primer3-2.3.4.tar.gz?r=http%3A%2F%2Fprimer3.sourceforge.net%2Freleases.php&ts=1341420099&use_mirror=netcologne" > primer3-2.3.4.tgz
tar -xvzf primer3-2.3.4.tgz
cd primer3-2.3.4
cd src
make all
make test
cp primer3_core /usr/local/bin
ln -s /usr/local/bin/primer3_core /usr/local/bin/primer3
cp ntdpal /usr/local/bin/
cp oligotm /usr/local/bin/
cp long_seq_tm_test /usr/local/bin/
cp -R primer3_config
/opt/

Unafold

According to the docs you should have glut/openGL, GD and gnuplot. These were all already on my system.


mkdir /opt/unafold
cd /opt/unafold
wget http://mfold.rna.albany.edu/cgi-bin/UNAFold-download.cgi?unafold-3.8.tar.bz2
tar -xvjf unafold-3.8.tar.bz2
rm unafold-3.8.tar.bz2
cd unafold-3.8
./configure
make
make install

CPAN modules
Other Bioperl Modules

I am using Chris Field’s Primer3Redux wrapper, which is yet to be added to the main Bioperl Run tools. I am also using a wrapper for Unafold that I am still developing, and that relies on a modified version of WrapperBase that I wrote. all of these can be retrieved from Github and installed.


mkdir /opt/bioperl-addons
cd /opt/bioperl-addons


git clone https://github.com/cassj/bioperl-wrapperbase-accessors.git
cd bioperl-wrapperbase-accessors/Bio-Tools-Run-WrapperBase-Accessor/
tar -xvzf Bio-Tools-Run-WrapperBase-Accessor-0.001.tar.gz
cd Bio-Tools-Run-WrapperBase-Accessor-0.001
perl Makefile.PL
make
make test
make install


git clone https://github.com/cassj/bioperl-unafold.git
cd Bio-Tools-Unafold/
tar -xvzf Bio-Tools-Unafold-0.001.tar.gz
cd Bio-Tools-Unafold-0.001
cd Bio-Tools-Run-Unafold-hybrid_ss
tar -xvzf Bio-Tools-Run-Unafold-hybrid_ss-0.001.tgz
cd Bio-Tools-Run-Unafold-hybrid_ss-0.001
perl Makefile.PL
make
make test
make install
cd ../../Bio-Tools-Run-Unafold-hybrid_ss_min/
tar -xvzf Bio-Tools-Run-Unafold-hybrid_ss_min-0.001.tar.gz
cd Bio-Tools-Run-Unafold-hybrid_ss_min-0.001
perl Makefile.PL
make
make test
make install
cd ../../Bio-Tools-Run-Unafold-hybrid_ss_2s/
tar -xvzf Bio-Tools-Run-Unafold-hybrid_ss_2s-0.001.tar.gz
cd Bio-Tools-Run-Unafold-hybrid_ss_2s-0.001
perl Makefile.PL
make
make test
make install
cd ../../Bio-Tools-Run-Unafold-melt/
tar -xvzf Bio-Tools-Run-Unafold-melt-0.001.tar.gz
cd Bio-Tools-Run-Unafold-melt-0.001
perl Makefile.PL
make
make test
make install
cd ../../Bio-Tools-Unafold/
tar -xvzf Bio-Tools-Unafold-0.001.tar.gz
cd Bio-Tools-Unafold-0.001
perl Makefile.PL
make
make test
make install


cd /opt/bioperl-addons
git clone https://github.com/cjfields/Bio-Tools-Primer3Redux.git
cd Bio-Tools-Primer3Redux/
perl Build.PL
./Build test
./Build install

Primer-Designer

I haven’t made a proper release of PD yet. It should happen at some point in the next few months. For now, just grab the latest code from github.

Primer Designer is made up of a collection of Perl modules that need to be installed from the github code. If you update from github you can safely reinstall over the previous version.


mkdir /opt/primer_designer
cd /opt/primer_designer
git clone git://github.com/cassj/primer_designer.git
cd primer_designer
cd Bio-SeqFetcher
tar -xvzf Bio-SeqFetcher-0.001.tar.gz
cd Bio-SeqFetcher-0.001
make
make test
make install
cd ../../Bio-SeqFetcher-Ensembl/
tar -xvzf Bio-SeqFetcher-Ensembl-0.001.tar.gz
cd Bio-SeqFetcher-Ensembl-0.001
perl Makefile.PL
make
make test
make install
cd ../../Bio-SeqFetcher-IlluminaIDviaEnsmart/
tar -xvzf Bio-SeqFetcher-IlluminaIDviaEnsmart-0.001.tar.gz
cd Bio-SeqFetcher-IlluminaIDviaEnsmart-0.001
perl Makefile.PL
make
make test
make install
cd Buckley-PrimerDesigner/
tar -xvzf Buckley-PrimerDesigner-0.001.tar.gz
cd Buckley-PrimerDesigner-0.001/
perl Makefile.PL
make test
make install

There is also a script that you can run from the commandline to design primers, which you can install with


cp /opt/primer_designer/bin/design_primers /usr/local/bin/design_primers

Installing RepeatMasker

RepeatMasker

Download the repeatmasker package and unpack it somewhere.


mkdir /opt/repeatmasker
cd /opt/repeatmasker
wget http://www.repeatmasker.org/RepeatMasker-open-3-3-0-p1.tar.gz
tar -xvzf RepeatMasker-open-3-3-0-p1.tar.gz
mv RepeatMasker RepeatMasker3.3.0

We’ll come back to configure the installation once we’ve installed a few dependencies.

trf
Download the latest Tandem Repeats Finder from http://tandem.bu.edu/trf/trf.download.html, rename it ‘trf’, make it executable and put it in your path:

Search engine – RMBlast

Repeatmasker can use various sequence search engines, Cross_Match,RMBlast or ABBlast/WUBlast. I’m using RMBlast as ABBlast is commercial and Cross_Match has some nutty licensing thing that means you have to send them an email and wait until they approve your access.


mkdir /opt/rmblast
cd /opt/rmblast
wget http://www.repeatmasker.org/rmblast-1.2-ncbi-blast-2.2.23+-src.tar.gz
tar -xvzf rmblast-1.2-ncbi-blast-2.2.23+-src.tar.gz
cd rmblast-1.2-ncbi-blast-2.2.23+-src/c++
./configure
make
make install

Configuring RepeatMasker


cd /opt/repeatmasker/RepeatMasker-3-3-0
perl configure
ln -s /opt/repeatmasker/RepeatMasker-3-3-0/RepeatMasker /usr/local/bin/

Leave a Reply