Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support for v8.6 in addition to 9.0. For compatibility, print functio…
…n in analyze_wvector fixed. test_install script to perform test upon installation.
  • Loading branch information
snikumbh committed Aug 2, 2017
1 parent bf6fa04 commit 9ba7664
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 8 deletions.
Binary file added CoMIK_v86
Binary file not shown.
Binary file added CoMIK_v90
Binary file not shown.
30 changes: 23 additions & 7 deletions README.md
Expand Up @@ -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)
Expand All @@ -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 <your_MCR_path_here>
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:
Expand All @@ -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 <MATLAB_Runtime_location> <config_file>
./run_CoMIK.sh /usr/lib/matlab-9.0 config-comik.txt
./run_CoMIK_v90.sh <MATLAB_Runtime_location> <config_file>
./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.
Expand Down
2 changes: 1 addition & 1 deletion analyze_wvector.m
Expand Up @@ -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)];
Expand Down
11 changes: 11 additions & 0 deletions 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
33 changes: 33 additions & 0 deletions 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 \<deployedMCRroot\> 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

33 changes: 33 additions & 0 deletions 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 \<deployedMCRroot\> 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

49 changes: 49 additions & 0 deletions 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."


0 comments on commit 9ba7664

Please sign in to comment.