###########################################################################
# RNAcop-1.03-bundle                                                      # 
# #######################                                                 #
#                                                                         #
# RNA context optimization by probability (RNAcop)                        #
#                                                                         #
# A framework for optimizing flanking region lengths with the aim to      #
# improve the probability to observe a predicted structure.               #
#                                                                         #
#    Copyright (C) 2015  Nikolai Hecker                                   #
#                                                                         #
#   This program is free software: you can redistribute it and/or modify  #
#   it under the terms of the GNU General Public License as published by  #
#   the Free Software Foundation, either version 3 of the License, or     #
#   (at your option) any later version.                                   #
#                                                                         #
#   This program is distributed in the hope that it will be useful,       #
#   but WITHOUT ANY WARRANTY; without even the implied warranty of        #
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         #
#   GNU General Public License for more details.                          #
#                                                                         #
#   ADDITIONAL TERMS                                                      #
#    The program RNAcop itself is part of a different license.            #
#    In particular, it was implemented in the ViennaRNA package,          # 
#    thus it is not licensed under terms of the GNU General Public        #
#    License, but follows a similar license as the ViennaRNA package      #
#    itself.                                                              #
#                                                                         #
#   You should have received a copy of the GNU General Public License     #
#   along with this program.  If not, see <http://www.gnu.org/licenses/>. #
#                                                                         #
###########################################################################

The RNAcop-bundle contains the entire RNAcop framework. It consists of the main
tool 'RNAcop-1.03', 'utility' scripts for data processing and visualization and
a program that uses a heuristic to suggest flanking region lengths, 
'findgoodregion-0.2'.

Please, see the README file in each sub-folder for more specific 
information and our web server at:

http://rth.dk/resources/rnacop

If you have suggestions for improvement, comments or for reporting bugs, please
send me an email: hecker@rth.dk

INSTALLATION
############
Prerequisites and installation instructions are given inside the corresponding
sub folders. If you meet all prerequisites compile RNAcop and findgoodregion:

$ cd RNAcop-1.03
$ ./configure
$ make
$ cd ../
$ cd findgoodregion-0.2
$ make


RUNNING THE RNACOP FRAMEWORK
############################
For an example input sequence-constraint file see 
'example/rfam_ALIL_psknot_short.vienna'.

'bash_full_RNAcop_analysis.sh' is as BASH script which performs all steps
of a RNAcop analysis and creates a HTML file similar to our web server.
Once you have compiled RNAcop and findgoodregion, to analyze the example file, 
run 'bash_full_RNAcop_analysis.sh'.
For running this file, you will need the command-line tools 'awk' and 
'readlink', as well as 'ruby'.

$ ./bash_full_RNAcop_analysis.sh example/rfam_ALIL_psknot_short.vienna rnacoptest

This will create a 'rnacoptest' folder and a 'rnacoptest.html' file. Open 
'rnacoptest.html' with your web browser to see the results, e.g.:

$ firefox rnacoptest.html

* inside the 'rnacoptest' folders among others should be following files
  (one for each entry inside the input file):

1) 'flanks*_log.tsv' files contain the probabilities for all combinations of
   flanking regions (ranked by probability)
2) 'goodregion_*.tsv' suggested flanking regions including radius, i.e. the 
   tolerance in 5' and 3' without obtaining probabilities lower than the
   maximum probability minus the defined threshold
