
This document describes the procedures for installation of the DWT-toolbox.
The main software was written in C++ and produces two executables named:
DWT_model, and dependence_posterior.

In addition the toolbox contains a Perl script that transform a
position-specific weight matrix file into a dinucleotide weight tensor
file, and python code for creating a dilogo image (in PDF format) of a
dinucleotide weight tensor (DWT).


All source files are in the subdirectory Source

-----------------------------------------------------------------------
1. Compiling the C++ code 

1a. Using the MakeFile:
Under Linux, or on a Mac with a C++ compiler installed, you should
generally be able to use the provided Makefile to compile the source
code . This can be done by going to the Source directory and execute
the following command:

make all


Note that the C++ code makes use of the Boost library which is
provided as a gzipped tar-archive that will be automatically extracted
by make. Two executables are generated:
-DWT_model (for training DWT models and predicting sites with them)
-dependence_posterior (for calculating posterior probabilities of
dependence).

1b. Manually compiling the C++ code.

First extract the boost library with the command:
tar -xvf boost_1_41_0.tar.gz

Then give the following set of compilation commands to create the object files:
g++ -c -Wall -g3 -O3 -I boost_1_41_0/ -o Score.o Score.cpp
g++ -c -Wall -g3 -O3 -I boost_1_41_0/ -o Alignment.o Alignment.cpp
g++ -c -Wall -g3 -O3 -I boost_1_41_0/ -o BackgroundModel.o BackgroundModel.cpp
g++ -c -Wall -g3 -O3 -I boost_1_41_0/ -o constants.o constants.cpp
g++ -c -Wall -g3 -O3 -I boost_1_41_0/ -o Decomposition.o Decomposition.cpp
g++ -c -Wall -g3 -O3 -I boost_1_41_0/ -o Sequence.o Sequence.cpp
g++ -c -Wall -g3 -O3 -I boost_1_41_0/ -o ParameterFile.o ParameterFile.cpp
g++ -c -Wall -g3 -O3 -I boost_1_41_0/ -o DWT_model.o DWT_model.cpp
g++ -c -Wall -g3 -O3 -I boost_1_41_0/ -o Positional_Dependency_Posterior.o Positional_Dependency_Posterior.cpp

Finally create the executables using the commands:
g++ -Wall -g3 -O3 Score.o Alignment.o BackgroundModel.o constants.o Decomposition.o Sequence.o ParameterFile.o Positional_Dependency_Posterior.o -o dependence_posterior
g++ -Wall -g3 -O3 Score.o Alignment.o BackgroundModel.o constants.o Decomposition.o Sequence.o ParameterFile.o DWT_model.o -o DWT_model

Note that we here use the GNU C++ compiler g++. You can of course use
another C++ compiler.

---------------------------------------------------------------------
2. Requirements for running the Perl script: init_dwt_from_pwm.pl

This is a very simple Perl script for turning a PWM file into a DWT
file and shoudl run with essentially any installation of Perl.




--------------------------------------------------------------------
3. Requirements for running the diLogo.py program.

diLogo.py is written in Python and requires:
-Python 2.7
-The Pyx library (version 0.12.1 is compatible with Python 2.7)
-the argparse library

Probably the easiest way to install these libraries is using the
Python Package Management System pip.

Using pip the libraries can typically be installed with the commands:
pip install pyx==0.12.1
pip install argparse

