Skip to content
Janne H. Korhonen edited this page Jan 10, 2017 · 9 revisions

Python installation

Start by downloading and extracting the tar archive as usual:

tar xzvf MOODS-python-[version].tar.gz
cd MOODS-python-[version]/

Next, you'll need to compile the C++ extensions. You'll need a fairly recent C++ compiler, as the C++ parts use C++11 features, so make sure your compiler is new enough (tested on Linux with g++ 5.4.0 and on Max OS X with Clang/Apple LLVM 8.0.0).

Option 1: Compile in place

If you just want to use the MOODS basic functionality without installing the package (e.g. you just want to use the moods_dna.py script for basic analysis), you can compile the extension in place:

python setup.py build_ext --inplace

This builds the MOODS extensions and puts everything necessary under the MOODS/ directory. However, this does not install MOODS to Python library path (see below), so Python will not find the library unless MOODS/ directory is in the script path or you explicitly add it to sys.path. To use the example scripts under scripts/ directory, for instance, you can symlink the library there:

cd scripts/
ln -s ../MOODS/    

You can then test the functionality by running the moods_dna.py script with the example data:

python moods_dna.py -m example-data/matrices/*.{pfm,adm} -s example-data/seq/chr1-5k-55k.fa -p 0.0001
python moods_dna.py --help

Option 2: Install the Python module

For large-scale usage, you'll possibly want to install MOODS to Python library path. To install MOODS locally to your own home directory, run:

python setup.py install --user

If you use virtualenv, then you can omit --user as usual.

For global install, assuming you have sudo rights, use:

sudo python setup.py install

Again, test the install by running the moods_dna.py script:

cd scripts/
python moods_dna.py -m example-data/matrices/*.{pfm,adm} -s example-data/seq/chr1-5k-55k.fa -p 0.0001
python moods_dna.py --help