/*
 * A program that predicts structures using the TurboFold algorithm.
 *
 * (c) 2010 Mathews Lab, University of Rochester Medical Center.
 * Written by Jessica S. Reuter
 */

#ifndef TURBOFOLD_INTERFACE_H
#define TURBOFOLD_INTERFACE_H

#include <sstream>

#include "TurboFold_object.h"
#include "../src/configfile.h"
#include "../src/ErrorChecker.h"
#include "../src/ParseCommandLine.h"
#include "../src/TProgressDialog.h"

class TurboFold_Interface {
 public:
	// Public constructor and methods.

	/*
	 * Name:        Constructor.
	 * Description: Initializes all private variables.
	 */
	TurboFold_Interface();

	/*
	 * Name:        parse
	 * Description: Parse command line arguments to determine what options are
	 *              required for a partitcular calculation.
	 * Arguments:
	 *     1.   The number of command line arguments.
	 *     2.   The command line arguments themselves.
	 * Returns:
	 *     True if parsing completed without errors, false if not.
	 */
	bool parse( int argc, char** argv );

	/*
	 * Name:        run
	 * Description: Run calculations.
	 */
	void run();

	/**
	 * Name:        usage
	 * Description: Print out a special usage message for this interface.
	 * Arguments:
	 *     1. parser
	 *        The command line parser.
	 */
	void usage( ParseCommandLine* parser );

 private:
	// Private variables important for multiple sequence calculations.

	// The calculation type description.
	string calcType;

	// 2D vector of input file names.
	vector< vector<string> > files;

	// Boolean flag, true if SHAPE data is being used, false if not.
	bool hasSHAPE;

	// The number of processors the calculation is run on.
	// By default, this is 1 (serial mode), but it may be more than that if the calculation is run in parallel.
	int processors;

	// The number of sequences used as input.
	int seqNumber;

 private:
	// Private variables.

	// The maximum pairing distance.
	int distance;

	// The intercept for SHAPE constraints.
	double intercept;

	// The MEA mode maximum number of structures.
	int maxStructures;

	// The MEA mode gamma value.
	double meaGamma;

	// The ProbKnot mode minimum helix length.
	int minHelixLength;

	// The mode that TurboFold runs under.
	string mode;

	// The MEA mode maximum percent energy difference.
	double percent;

	// The ProbKnot mode number of iterations.
	int pkIterations;

	// The slope for SHAPE constraints.
	double slope;

	// The termperature at which calculation occurs.
	double temperature;

	// The Threshold mode probable pair threshold.
	double threshold;

	// The gamma value for TurboFold.
	double turboGamma;

	// The iterations value for TurboFold.
	double turboIterations;

	// The MEA mode window size.
	int windowSize;
};

#endif /* TURBOFOLD_INTERFACE_H */
