CovaRNA is a software for detecting long-range nucleotide covariation in genomic alignments.

1.INSTALLATION

1.1 INSTALLATION (Not using multi-threaded version)

1.1.1
unpack source file:
tar xvfz covarna_v1.16.0.tar.gz
cd covarna_v1.16.0
This directory is here called COVARNA_HOME

1.1.2
Compile sources:
cd $COVARNA_HOME/src

Compile single-threaded version with command:

make

This compiles the source code and creates the covarna and covarna binaries in the subdirectory src/covarna. You can copy these binaries to a location of your choice, for example to the directory $COVARNA_HOME/bin

If you are interested in the multi-threaded version you can follow the instructions given below, otherwise you can skip to the USAGE section.

1.2 INSTALLATION (optional, multi-threaded version)

1.2.1
unpack source file:
tar xvfz covarna_v1.16.0.tar.gz
cd covarna_v1.16.0
This directory is here called COVARNA_HOME
1.2.2 Installation of Intel Threading Building Block library (optional)
Install Intel Threading Building Blocks (TBB) library: download appropriate version from http://threadingbuildingblocks.org/ and compile according to Intel instructions
Modify the .cshrc or .bashrc files of your Unix system in order to
set environment variable TBB_HOME equal to the TBB installation directory

set environment variable TBB_LIB to appropriate directory with compiled shared object libraries. To find the right directory, use the command ls -R $TBB_HOME/lib . In our case this is currently accomplished by the command: 
setenv TBB_LIB $TBB_HOME/lib/intel64/cc4.1.0_libc2.4_kernel2.6.16.21 # add to file .cshrc in your home directory, the precice name of the TBB lib directory might in your case be different

set environment variable LD_LIBRARY_PATH to include TBB_LIB 

This is best accomplished by adding commands to your .cshrc or .bashrc files, depending on whether on your default shell is BASH or SHELL:
# for C-Shell: 
setenv TBB_LIB $TBB_HOME/lib/intel64/cc4.1.0_libc2.4_kernel2.6.16.21 # add to file .cshrc in your home directory, the precice name of the TBB lib directory might in your case be different
setenv LD_LIBRARY_PATH $TBB_LIB

or for BASH:
export TBB_LIB=$TBB_HOME/lib/intel64/cc4.1.0_libc2.4_kernel2.6.16.21 # add to file .bashrc in your home directory
export LD_LIBRARY_PATH=$TBB_LIB

1.2.3

Compile sources:

If you installed the Intel Threading Building block library as indicated above, the multi-threaded version can be compiled with the command:

make subclean # the object files created by the "make" and "make concurrent=1" commands cannot be safely linked together; best to remove object files and binaries created so far in order to avoid confusion:
make concurrent=1

This creates the covarna and covarnap binaries in the subdirectory src/covarna. You can copy these binaries to a location of your choice, for example to the directory $COVARNA_HOME/bin

1.3 Installation of CovStat

CovStat is used for computing measures of statistical significance for observed covariation patterns. It is implemented as R package, located in $COVARNA_HOME/R. It is assumed that a recent version of R is installed on your Unix system.
Installation commands:
cd $COVARNA_HOME/R
R CMD INSTALL covstat_0.5.2.tar.gz
tar xvfz covstat_0.5.2.tar.gz
Next, follow the information found in the file covstat/README.

2 USAGE 

IMPORTANT: Please consult the file userguide.htm in the "doc subdirectory for more information!

2.1 CovaRNA
Input to the covarna method are genomic alignments in University of Santa Cruz (UCSC) MAF format (see http://genome.ucsc.edu/goldenPath/help/hgTracksHelp.html for more information).
Genomic region pairs corresponding to detected covariations are written to an output file; the file format is a variant of the UCSC BED format. The default output file name is covarna_clusters.bed

# search within on MAF file:
covarna MAFFILE 

To run examples, change the current working directory to $COVARNA_HOME/examples

To run the example, issue the command:
../src/covarna/covarna dm3_chrM.maf

This search creates a result file covarna_clusters.bed

This file contains in each row a pair of genomic regions with detected covariation that is annotated with additional information.

# multithreaded search (using 8 cores):
covarnap  MAFFILE -t 8
# Example (run from examples directory) with output to file results.bed:
../src/covarna/covarnap  dm3_chrM.maf -t 8 -o results.bed

# search for long-range covariation between two MAF files:
covarna MAFFILE1 -e MAFFILE2
# Example (run from examples directory):
../src/covarna/covarna  dm3_chrM.maf --e dm3_chr4.maf

# search within between two MAF files (4 cores):
covarnap MAFFILE1 -e MAFFILE2 -t 4

# Example using 4 cores (run from examples directory):
../src/covarna/covarnap  dm3_chrM.maf --e dm3_chr4.maf -t 4

2.2 Shuffling of alignments with shufflemaf

usage:
shufflemaf h|v MAFFILE ASSEMBLY

"vertical" (column-wise) shuffling with dm3 as reference assembly:
../bin/shufflemaf v dm3_chrM.maf dm3

"horizontal" (row-wise) shuffling with dm3 as reference assembly:
../src/covarna/shufflemaf h dm3_chrM.maf dm3

