# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
-TEMPLATE_RELATIONS = NO
+TEMPLATE_RELATIONS = YES
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
# tags are set to YES then doxygen will generate a graph for each documented
# So in most cases it will be better to enable call graphs for selected
# functions only using the \callgraph command.
-CALL_GRAPH = NO
+CALL_GRAPH = YES
# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will
# generate a caller dependency graph for every global function or class method.
#include <map>
#include "misc.h"
+/**
+ * Creates and holds a component tree.
+ */
class ComponentTree {
public:
+ /**
+ * A node in the component tree.
+ */
struct Node {
Node(Node* parent, Component comp);
~Node();
*/
void makeUnoriented();
+ /**
+ * Count the number of leaves in the component tree.
+ * This is the number of hurdles, if makeUnoriented has been called.
+ */
size_t countLeaves();
+ /**
+ * Number of short branches.
+ * If makeUnoriented has been called and countLeaves is >= 3
+ * then we have a super hurdle if short branches = 0.
+ */
size_t shortBranches();
private:
class GeneOrder;
struct Component;
-
+/**
+ * Simple interval struct, holds the indexes + information if the interval is
+ * oriented or not.
+ */
struct Interval{
Interval(size_t f,size_t s,bool o = false):first(f),second(s),oriented(o){}
bool operator==(const Interval& i){
std::pair<int,int> longestSequences(const GeneOrder& go);
/**
+ * Uses the Robinson-Schensted algorithm on the gene order. Gives the longest
+ * increasing and decreasing subsequences.
*/
std::vector<std::vector<int> > robinsonSchensted(const GeneOrder& go);
#ifndef __MISC_H__
#define __MISC_H__
+/**
+ * The type we use for genes, has to be a signed integer type.
+ */
typedef int Gene;
+/**
+ * Simple struct for components. Holds the indexes, the first and last genes
+ * + information if the component is unoriented.
+ */
struct Component{
Component(int b = 0,int e = 0,int s = 0,size_t i1 = 0, size_t i2 = 0):begin(b),end(e),sign(s),i1(i1), i2(i2){}
bool operator==(const Component& c){
Model(Models::ModelImpl* model);
/**
+ * Gives the score for the action on a given gene order.
+ * A better match for this model gives a higher score.
*/
double score(const SortAction& sa, const GeneOrder& go) const;
+ /**
+ * The name for the model used.
+ */
const char* name() const;
+ /**
+ * Creates a model from a name.
+ */
static Model modelFactory(const std::string& name);
private:
namespace Models {
+/**
+ * Basic implementation of a model. All sort actions are considered equal.
+ */
class ModelImpl {
public:
virtual ~ModelImpl();
+ /**
+ * All actions return 1 in this model.
+ *
+ * \see Model::score
+ */
virtual double score(const SortAction& sa, const GeneOrder& go);
+ /**
+ * \see Model::name
+ */
virtual const char* name();
};
+/**
+ * A model that favors symmetric reversal, resulting in an X-like
+ * picture in a dot plot.
+ */
class X : public ModelImpl {
public:
+ /**
+ * Returns a higher score for reversals around the center
+ *
+ * \see Model::score
+ */
double score(const SortAction& sa, const GeneOrder& go);
+ /**
+ * \see Model::name
+ */
const char* name();
};
+/**
+ * A model that favors short reversals, resulting in a zipper-like
+ * picture in a dot plot
+ */
class Zipper : public ModelImpl {
public:
+ /**
+ * Returns higher score for shorter reversals.
+ *
+ * \see Model::score
+ */
double score(const SortAction& sa, const GeneOrder& go);
+ /**
+ * \see Model::name
+ */
const char* name();
};
+/**
+ * A model that favors single gene transpositions, resulting in a
+ * very scattered dot plot.
+ */
class Cloud : public ModelImpl {
public:
+ /**
+ * \todo has to be implemented
+ * \see Model::score
+ */
double score(const SortAction& sa, const GeneOrder& go);
+ /**
+ * \see Model::name
+ */
const char* name();
};
+/**
+ * A model similar to X, but a wider X in the dot plot.
+ */
class FatX : public ModelImpl {
public:
+ /**
+ * \todo has to be implemented
+ * \see Model::score
+ */
double score(const SortAction& sa, const GeneOrder& go);
+ /**
+ * \see Model::name
+ */
const char* name();
};
class GeneOrder;
+/**
+ * Abstraction for a sort action implementation, this is the base that other
+ * actions inherits from.
+ */
class SortActionImpl{
public:
};
/**
- * Abstraction of a sort action, all child actions has to be immutable.
+ * Abstraction of a sort action, all SortActionImpls has to be immutable.
*
* \author Michael Andreen
*/