# Name of your program
package "RNAplex" # don't use package if you're using automake
purpose "Find targets of a query RNA"
usage "RNAplex [options]\n"

# Version of your program
#version "2.0"   # don't use version if you're using automake

# command line options passed to gengetopt
args "--file-name=RNAplex_cmdl --include-getopt --default-optional --func-name=RNAplex_cmdline_parser --arg-struct-name=RNAplex_args_info"


description "reads two RNA sequences from stdin or <filename> and\
 computes optimal and suboptimal secondary structures for their\
 hybridization. The calculation is simplified by allowing only\
 inter-molecular base pairs. Accessibility effects can be estimated by\
 RNAplex if a RNAplfold accessibility profile is provided. The\
 computed optimal and suboptimal structure are written to stdout, one\
 structure per line. Each line consist of: The structure in dot bracket\
 format with a \"&\" separating the two strands. The range of the\
 structure in the two sequences in the format  \"from,to : from,to\";\
 the energy of duplex structure in kcal/mol.\nThe format is especially\
 useful for computing the hybrid structure between a small probe\
 sequence and a long target sequence.\n"

# Options

option  "verbose" v
"Be verbose.\n"
details="Lower the log level setting such that even INFO messages are passed through.\n\n"
flag
off


section "I/O Options"
sectiondesc="Command line options for input and output (pre-)processing\n\n"

option "query" q
"File containing the query sequence.\n"
details="Input sequences can be given piped to RNAplex or given in a query file with the -q option.\
 Note that the -q option implies that the -t option is also used\n\n"
string
optional

option "target" t
"File containing the target sequence.\n"
details="Input sequences can be given piped to RNAplex or given in a target file with the -t option.\
 Note that the -t option implies that the -q option is also used\n\n"
string
optional

option "accessibility-dir" a
"Location of the accessibility profiles.\n"
details="This option switches the accessibility modes on and indicates in which directory accessibility\
 profiles as generated by RNAplfold can be found\n\n"
string
optional

option "binary" b
"Allow the reading and parsing of memory dumped opening energy file\n"
details="The -b option allows one to read and process opening energy files which are saved in binary format\n\
 This can reduce by a factor of 500x-1000x the time needed to process those files. RNAplex recognizes the\
 corresponding opening energy files by looking for files named after the sequence and containing the suffix\
 _openen_bin. Please look at the man page of RNAplfold if you need more information on how to produce binary\
 opening energy files.\n\n"
flag
off


option  "log-level" -
"Set log level threshold.\n"
details="By default, any log messages are filtered such that only warnings (level 2) or errors (level 3)\
 are printed. This setting allows for specifying the log level threshold, where higher values result in\
 fewer information. Log-level 5 turns off all messages, even errors and other critical information.\n\n"
int
typestr="level"
default="2"
hidden


option  "log-file" -
"Print log messages to a file instead of stderr.\n"
string
typestr="filename"
default="RNAplex.log"
argoptional
hidden


option  "log-time" -
"Include time stamp in log messages.\n\n"
flag
off
hidden


option  "log-call" -
"Include file and line of log calling function.\n\n"
flag
off
hidden


section "Algorithms"
sectiondesc="Options which alter the computing behaviour of RNAplex.\n\n"

option "interaction-length" l
"Maximal length of an interaction\n"
details="Maximal allowed length of an interaction\n\n"
default="40"
int
optional

option "extension-cost" c
"Cost to add to each nucleotide in a duplex\n"
details="Cost of extending a duplex by one nucleotide. Allows one to find compact duplexes, having few/small bulges or internal loops\
 Only useful when no accessibility profiles are available. This option is disabled if accessibility profiles are used (-a option)\n\n"
default="0"
int
optional

option "probe-mode" p
"Compute Tm for probes"
details="Use this option if you want to compute the melting temperature of your probes\n\n"
flag
off

option "probe-concentration" Q
"Set the probe concentration for the Tm computation\n\n"
double
default="0.1"
optional

option "na-concentration" N
"Set the Na+ concentration for the Tm computation.\n\n"
double
default="1.0"
optional
hidden

option "mg-concentration" M
"Set the Mg2+ concentration for the Tm computation.\n\n"
double
default="1.0"
optional
hidden

option "k-concentration" K
"Set the K+ concentration for the Tm computation.\n\n"
double
default="1.0"
optional
hidden

option "tris-concentration" U
"Set the tris+ concentration for the Tm computation.\n\n"
double
default="1.0"
optional
hidden

option "fast-folding" f
"Speedup of the target search\n"
details="This option allows one to decide if the backtracking has to be done (-f 0, -f 2) or not (-f 1). For -f 0 the structure is computed\
 based on the standard energy model. This is the slowest and most precise mode of RNAplex. With -f 2, the structure is computed based on the approximated\
 plex model. If a lot of targets are returned this is can greatly improve the runtime of RNAplex. -f 1 is the fastest mode, as no structure\
 are recomputed \n\n"
int 
default="0"
optional

option "scale-accessibility" V
"Rescale all opening energy by a factor V\n"
details="Scale-factor for the accessibility. If V is set to 1 then the scaling has no effect on the accessibility.\n\n"
double
default="1.0"
optional

option "alignment-mode" A
"Tells RNAplex to compute interactions based on alignments\n"
details="If the A option is set RNAplex expects clustalw files as input for the -q and -t option.\n\n"
flag
off

option "convert-to-bin" k
"If set, RNAplex will convert all opening energy file in a directory set by the -a option into binary opening energy files\n"
details="RNAplex can be used to convert existing text formatted opening energy files into binary formatted files. In this mode RNAplex does not compute interactions.\n\n"
flag
off

option "duplex-distance" z
"Distance between target 3' ends of two consecutive duplexes\n"
details="Distance between the target 3'ends of two consecutive duplexes. Should be set to the maximal length of interaction to get\
 good results\n\
 Smaller z leads to larger overlaps between consecutive duplexes.\n\n"
int
default="0"
optional

option "energy-threshold" e
"Minimal energy for a duplex to be returned\n"
details="Energy threshold for a duplex to be returned. The threshold is set on the total energy of interaction, i.e. the hybridization\
 energy corrected for opening energy if -a is set or the energy corrected by -c. If unset, only the mfe will be returned\n\n"
double
default="-100000"
optional

option "WindowLength" L
"Tells how large the region around the target site should be for redrawing the alignment interaction\n"
details="This option allows one to specify how large the region surrounding the target site should be set when generating the alignment figure of the interaction\n\n"
int
default="1"
optional


section "Structure Constraints"
sectiondesc="Command line options to interact with the structure constraints feature of this program\n\n"

option "constraint" C
"Calculate structures subject to constraints.\n"
details="The program reads first the\
 sequence, then a string containing constraints on the structure for the query sequence encoded with the symbols:\n. (no constraint\
 for this base)\n| (the corresponding base has to be paired)\n\n"
flag
off


section "Energy Parameters"
sectiondesc="Energy parameter sets can be adapted or loaded from user-provided input files\n\n"

option  "temp"  T
"Rescale energy parameters to a temperature of temp C. Default is 37C.\n\n"
double
default="37.0"
optional

option  "paramFile" P
"Read energy parameters from paramfile, instead of using the default parameter set.\n"
details="Different sets of energy parameters for RNA and DNA should accompany your distribution.\nSee the\
 RNAlib documentation for details on the file format. When passing the placeholder file name \"DNA\",\
 DNA parameters are loaded without the need to actually specify any input file.\n\n"
string
typestr="paramfile"
optional

option  "noTetra" 4
"Do not include special tabulated stabilizing energies for tri-, tetra- and hexaloop hairpins.\n"
details="Mostly for testing.\n\n"
flag
off
hidden

option  "salt" -
"Set salt concentration in molar (M). Default is 1.021M.\n\n"
double
optional

option  "saltInit" -
"Provide salt correction for duplex initialization (in kcal/mol).\n\n"
double
optional
hidden


section "Model Details"
sectiondesc="Tweak the energy model and pairing rules additionally using the following parameters\n\n"

option  "helical-rise"  -
"Set the helical rise of the helix in units of Angstrom.\n"
details="Use with caution! This value will be re-set automatically to 3.4 in case DNA\
 parameters are loaded via -P DNA and no further value is provided.\n\n"
float
optional
default="2.8"
hidden

option  "backbone-length"  -
"Set the average backbone length for looped regions in units of Angstrom.\n"
details="Use with caution! This value will be re-set automatically to 6.76 in case DNA\
 parameters are loaded via -P DNA and no further value is provided.\n\n"
float
optional
default="6.0"
hidden


section "Plotting"
sectiondesc="Command line options for changing the default behavior of structure layout and pairing probability plots\n\n"

option "produce-ps" I
"Draw an alignment annotated interaction from RNAplex.\n"
details="This option allows one to produce interaction figures in PS-format a la RNAalifold, where base-pair conservation is represented in\
 color-coded format. In this mode no interaction are computed, but the -I option indicates the location of the file containing interactions\
 between two RNA (alignments/sequence) from a previous run. If the -A option is not set a structure figure a la RNAfold with color-coded annotation of the accessibilities is returned\n\n"
string
optional


text    "\nIf in doubt our program is right, nature is at fault.\nComments should be sent to\
 rna@tbi.univie.ac.at.\n\n"
