diff --git a/CoMIK_v86 b/CoMIK_v86 new file mode 100755 index 0000000..4011d03 Binary files /dev/null and b/CoMIK_v86 differ diff --git a/CoMIK_v90 b/CoMIK_v90 new file mode 100755 index 0000000..c95a65a Binary files /dev/null and b/CoMIK_v90 differ diff --git a/README.md b/README.md index 108e7f8..1e48124 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ To appear in Proceedings of WABI 2017. bioRxiv DOI: https://doi.org/10.1101/139618 ## Requirements: -- MATLAB 9.0.0.341360 (R2016a) [We developed _CoMIK_ using this version of MATLAB. Compatibility with earlier versions is to be checked.] +- MATLAB 9.0.0.341360 (R2016a) [We developed _CoMIK_ using this version of MATLAB (R2016a). Compatbility checked with version R2015b] - Python 2.7 or higher -- SHOGUN Release version 3.2.0 [See issue #7 (issues/7) in this regard] +- SHOGUN Release version 3.2.0 [See issue #7 (issues/7) in this regard. _CoMIK_ also works with the latest SHOGUN version 6.0.0] For the visualizations, the following R (R version 3.4.0) packages are needed - Lattice (lattice_0.20-35) @@ -21,11 +21,22 @@ This repository contains Matlab code for the project *CoMIK*. The various ".m" f We use MKL implementation from Shogun's modular interface for Python. The Python script mkl.py handles solving of the MKL problem. ## Installation: -```MATLAB +``` git clone https://github.molgen.mpg.de/snikumbh/comik.git cd comik sh install.sh ``` +Once the dependencies are handled, e.g., SHOGUN, MATLAB runtime etc., you can test the installation as follows + +``` +sh test_install.sh +``` +This performs the test for both, the executable and from inside MATLAB. For testing either of them, use +``` +sh test_install.sh executable +OR +sh test_install.sh matlab +``` ## Usage: - If you have MATLAB, see the example config file `config-comik.txt`, for an example function call from inside Matlab: @@ -34,12 +45,17 @@ For simulated dataset 1 provided in the folder `sample_data/simulated_dataset1` comik_wrapper('config-comik.txt'); ``` -- For those who do not have MATLAB, we provide an executable which can be run as follows: +- For those who do not have MATLAB, we provide an executable. Additionally, you require only the MATLAB Runtime installed. The appropriate version can be downloaded from https://mathworks.com/products/compiler/mcr.html . +- Follow the instructions for installation of the MATLAB Runtime; install at any location of your choice on the disk. +- Once installed, provide the corresponding path when running the shell script `run_CoMIK.sh` as follows: + ``` -./run_CoMIK.sh -./run_CoMIK.sh /usr/lib/matlab-9.0 config-comik.txt +./run_CoMIK_v90.sh +./run_CoMIK_v90.sh /usr/lib/matlab-9.0 config-comik.txt #for version 9.0 (R2016a) +OR +./run_CoMIK_v86.sh /usr/lib/matlab-8.6 config-comik.txt #for version 8.6 (R2015b) ``` -where `/usr/lib/matlab-9.0` is the typical location of the MATLAB runtime on a Linux machine. If required, you can add your own paths to the `LD_LIBRARY_PATH` environment variable in the file `run_CoMIK.sh`. +where `/usr/lib/matlab-9.0` could be replaced with the location of the MATLAB runtime on your machine. Additionally, when required, you can add your own paths to the `LD_LIBRARY_PATH` environment variable in the file `run_CoMIK_v86.sh` or `run_CoMIK_v90.sh` (for example, the path for shogun can be added here). _CoMIK_ requires two FASTA files as input -- the first FASTA file containing sequences in the positive class; the second FASTA file containing negative class sequences. Other params are explained below. diff --git a/analyze_wvector.m b/analyze_wvector.m index 557715c..91bdd88 100644 --- a/analyze_wvector.m +++ b/analyze_wvector.m @@ -326,7 +326,7 @@ %set(new_ax, 'Ydir', 'reverse'); pdf_fname = strcat(folderName, '/SeqLogos_MinMax_at_distances_rank', num2str(rankId), '_oligoLen', num2str(oligoLen)); - print(pdf_fname,'-dpdf', '-r900', '-bestfit'); + print(pdf_fname,'-dpdf', '-r900'); % to produce EPS figures, use % print(pdf_fname, '-depsc'); pdfcrop_lines = [pdfcrop_lines; sprintf('pdfcrop %s\n', pdf_fname)]; diff --git a/install.sh b/install.sh index d0bfe1b..17b4f0a 100644 --- a/install.sh +++ b/install.sh @@ -1,4 +1,15 @@ +#!/bin/bash + #Install CoMIK chmod +x mkl.py export PATH=".:$PATH" + +#Check dependenciespython -c "import modshogun" + +if python -c "import modshogun"; +then + echo "You can now run the test_install.sh script." +else + echo "You need to install SHOGUN. Once done, you can run the test_install.sh script." +fi diff --git a/run_CoMIK_v86.sh b/run_CoMIK_v86.sh new file mode 100755 index 0000000..dc95f16 --- /dev/null +++ b/run_CoMIK_v86.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# script for execution of deployed applications +# +# Sets up the MATLAB Runtime environment for the current $ARCH and executes +# the specified command. +# +exe_name=$0 +exe_dir=`dirname "$0"` +echo "------------------------------------------" +if [ "x$1" = "x" ]; then + echo Usage: + echo $0 \ args +else + echo Setting up environment variables + MCRROOT="$1" + echo --- + LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ; + LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ; + LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64; + LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/opengl/lib/glnxa64; + export LD_LIBRARY_PATH; + echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH}; + shift 1 + args= + while [ $# -gt 0 ]; do + token=$1 + args="${args} \"${token}\"" + shift + done + eval "\"${exe_dir}/CoMIK_v86\"" $args +fi +exit + diff --git a/run_CoMIK_v90.sh b/run_CoMIK_v90.sh new file mode 100755 index 0000000..fe0c267 --- /dev/null +++ b/run_CoMIK_v90.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# script for execution of deployed applications +# +# Sets up the MATLAB Runtime environment for the current $ARCH and executes +# the specified command. +# +exe_name=$0 +exe_dir=`dirname "$0"` +echo "------------------------------------------" +if [ "x$1" = "x" ]; then + echo Usage: + echo $0 \ args +else + echo Setting up environment variables + MCRROOT="$1" + echo --- + LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ; + LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ; + LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64; + LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/opengl/lib/glnxa64; + export LD_LIBRARY_PATH; + echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH}; + shift 1 + args= + while [ $# -gt 0 ]; do + token=$1 + args="${args} \"${token}\"" + shift + done + eval "\"${exe_dir}/CoMIK_v90\"" $args +fi +exit + diff --git a/test_install.sh b/test_install.sh new file mode 100644 index 0000000..590b0a1 --- /dev/null +++ b/test_install.sh @@ -0,0 +1,49 @@ +#!/bin/bash + + +echo 'Preparing for testing ...' +cp config-comik.txt config-comik-test.txt + +sed -i 's/OUTPUT_FOLDER=comik_run_simulated_dataset1/OUTPUT_FOLDER=test_comik_run_simulated_dataset1/g' config-comik-test.txt + +sed -i 's/NUMBER_OF_CLUSTERS=\[2 5 7]/NUMBER_OF_CLUSTERS=\[7\]/g' config-comik-test.txt +sed -i 's/SIGMA_VALUES=10\.\^\[1\:1\:2\]/SIGMA_VALUES=10\.\^\[1\]/g' config-comik-test.txt +sed -i 's/COST_VALUES=10\.\^\[-3\:1\:3\]/COST_VALUES=10\.\^\[1\]/g' config-comik-test.txt + +sed -i 's/NUMBER_OF_INNER_FOLDS=5/NUMBER_OF_INNER_FOLDS=2/g' config-comik-test.txt +sed -i 's/NUMBER_OF_OUTER_FOLDS=5/NUMBER_OF_OUTER_FOLDS=3/g' config-comik-test.txt + + +if [ "$1" = "executable" ] +then + echo "Only testing the executable ... this might take some time" + if [ "$3" = "v86" ]; + then + if [ -f "run_CoMIK_v86.sh" ]; + then + ./run_CoMIK_v86.sh $2 config-comik-test.txt + fi + elif [ "$3" = "v90" ]; + then + if [ -f "run_CoMIK_v90.sh" ]; + then + ./run_CoMIK_v90.sh $2 config-comik-test.txt + fi + else + echo 'No file to run.' + fi +elif [ "$1" = "matlab" ] +then + echo 'Only testing inside MATLAB ... this might take some time' + matlab -nodesktop -nodisplay -nosplash -r "comik_wrapper('config-comik-test.txt'); exit;" +else + echo 'Testing both executable and from inside matlab ... this might take some time' +fi + +if [ -d "$test_comik_run_simulated_dataset1"]; then + rm -rf test_comik_run_simulated_dataset1/ + rm config-comik-test.txt +fi +echo "Done." + +