]> ruin.nu Git - germs.git/blob - src/models.h
More help output
[germs.git] / src / models.h
1 /***************************************************************************
2  *   Copyright (C) 2006 by Michael Andreen                                 *
3  *   andreen@student.chalmers.se                                           *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA          *
19  ***************************************************************************/
20
21 #ifndef __MODELS_H__
22 #define __MODELS_H__
23
24 class SortAction;
25 class GeneOrder;
26
27 namespace Models {
28
29 /**
30  * Basic implementation of a model. All sort actions are considered equal.
31  */
32 class ModelImpl {
33         public:
34                 virtual ~ModelImpl();
35
36                 /**
37                  * All actions return 1 in this model.
38                  *
39                  * \see Model::score
40                  */
41                 virtual double score(const SortAction& sa, const GeneOrder& go);
42
43                 /**
44                  * \see Model::name
45                  */
46                 virtual const char* name();
47 };
48
49 /**
50  * A model that favors reversals.
51  */
52 class Whirl : public ModelImpl {
53         public:
54                 /**
55                  * Returns a higher score for reversals and a lower score
56                  * for all other actions.
57                  *
58                  * \see Model::score
59                  */
60                 double score(const SortAction& sa, const GeneOrder& go);
61
62                 /**
63                  * \see Model::name
64                  */
65                 const char* name();
66 };
67
68 /**
69  * A model that favors symmetric reversal, resulting in an X-like
70  * picture in a dot plot.
71  */
72 class X : public ModelImpl {
73         public:
74                 /**
75                  * Returns a higher score for reversals around the center
76                  *
77                  * \see Model::score
78                  */
79                 double score(const SortAction& sa, const GeneOrder& go);
80
81                 /**
82                  * \see Model::name
83                  */
84                 const char* name();
85 };
86
87 /**
88  * A model that favors short reversals, resulting in a zipper-like
89  * picture in a dot plot
90  */
91 class Zipper : public ModelImpl {
92         public:
93                 /**
94                  * Returns higher score for shorter reversals.
95                  *
96                  * \see Model::score
97                  */
98                 double score(const SortAction& sa, const GeneOrder& go);
99
100                 /**
101                  * \see Model::name
102                  */
103                 const char* name();
104 };
105
106 /**
107  * A model that favors single gene transpositions, resulting in a
108  * very scattered dot plot.
109  */
110 class Cloud : public ModelImpl {
111         public:
112                 /**
113                  * \todo has to be implemented
114                  * \see Model::score
115                  */
116                 double score(const SortAction& sa, const GeneOrder& go);
117
118                 /**
119                  * \see Model::name
120                  */
121                 const char* name();
122 };
123
124 /**
125  * A model similar to X, but a wider X in the dot plot.
126  */
127 class FatX : public ModelImpl {
128         public:
129                 /**
130                  * \todo has to be implemented
131                  * \see Model::score
132                  */
133                 double score(const SortAction& sa, const GeneOrder& go);
134
135                 /**
136                  * \see Model::name
137                  */
138                 const char* name();
139 };
140
141 }
142
143 #endif