sim4.h
Go to the documentation of this file.00001 #ifndef SIM4_H
00002 #define SIM4_H
00003 #include <iostream.h>
00004
00005
00006
00007 #define DEFAULT_NUM_I 3
00008 #define DIST_CUTOFF 3
00009 #define DEFAULT_MIN_COV .8
00010
00011 #define MININT -99999
00012 #define MIN_INTRON 30
00013 #define MAX_INTRON 20000
00014 #define MAX_GRINIT 500
00015 #define MAX_INTERNAL_GAP 50
00016 #define LL 60
00017
00018 #define DEFAULT_DRANGE 10
00019 #define DEFAULT_WEIGHT 100
00020 #define DEFAULT_W 15
00021 #define DEFAULT_X 12
00022 #define DEFAULT_K 18
00023 #define DEFAULT_C 16
00024 #define P .2
00025
00026 #define min(x,y) ((x>y) ? (y):(x))
00027 #define max(x,y) ((x<y) ? (y):(x))
00028 #define START_SIG ((G_score >= abs(C_score)) ? "GT" : "CT")
00029 #define END_SIG ((G_score >= abs(C_score)) ? "AG" : "AC")
00030
00031 #define MATCH 1
00032 #define MISMATCH -5
00033 #define L 8
00034
00035 #define DELETE 1
00036 #define INSERT 2
00037 #define SUBSTITUTE 3
00038 #define INTRON 4
00039 #define O_INTRON 5
00040
00041 enum { FALSE = 0, TRUE = 1};
00042 enum { INIT = 0, PERM = 1, TEMP = 2};
00043 enum comparisonType { EST_GEN = 1, GEN_EST = 2 };
00044
00045 enum { FWD = 0, BWD = 1, BOTH = 2 };
00046 enum { OK = 0, FREE_START = 1, FREE_END = 2, FREE_BOTH_ENDS = 3};
00047
00048
00049
00050
00051 typedef struct msp {
00052 int len, pos1, pos2;
00053 int score;
00054 int Score;
00055 int prev;
00056 struct msp *next_msp;
00057 } *Msp_ptr;
00058
00059 class exon
00060 {
00061 public:
00062 exon();
00063 friend ostream& operator<<(ostream &os, const exon& ex);
00064 bool isEmpty() const { return length == 0; }
00065 int sumLength(int matchCut=90) const;
00066
00067 int from1, from2, to1, to2;
00068 int min_diag, max_diag;
00069 int match;
00070 char ori;
00071 int length;
00072 int flag;
00073 int ematches;
00074 int edist;
00075 Msp_ptr msps;
00076 exon *next_exon;
00077 };
00078 typedef exon *Exon_ptr;
00079
00080 typedef struct intron {
00081 int from1, from2, to1, to2;
00082 int length;
00083 char orientation;
00084 struct intron *next_intron;
00085 } *Intron_ptr, Intron;
00086
00087 typedef struct exon Exon;
00088
00089 typedef struct coordinates {
00090 int pos1;
00091 int pos2;
00092 } coords;
00093
00094
00095 class edit_script
00096 {
00097 public:
00098 char op_type;
00099 int num;
00100 edit_script *next;
00101 };
00102
00103 class edit_script_list
00104 {
00105 public:
00106 edit_script_list();
00107 friend ostream& operator<<(ostream &os, const edit_script_list &esl);
00108 int offset1, offset2;
00109 int len1, len2;
00110 int score;
00111 edit_script *script;
00112 edit_script_list *next_script;
00113 };
00114
00115 struct edit {
00116 struct edit *link;
00117 char type[2];
00118 int accumulation;
00119 char op;
00120 int line1;
00121 int line2;
00122 };
00123
00124 typedef void *Pointer;
00125
00126 typedef struct ValNode {
00127 Pointer data;
00128 struct ValNode *next;
00129 } *ValNodePtr;
00130
00131 typedef int signal_t[4][4];
00132
00133 typedef struct spliced {
00134 int xs, xe, ys, ye, score;
00135 char type;
00136 struct spliced *next;
00137 } splice_t;
00138
00139 class sim4_stats
00140 {
00141 public:
00142 sim4_stats();
00143 friend ostream &operator<<(ostream &os, const sim4_stats &ss);
00144
00145 int internal;
00146 int icoverage;
00147 int mult;
00148 int nmatches;
00149 double fcoverage;
00150
00151 double marginals;
00152 };
00153 typedef sim4_stats sim4_stats_t;
00154
00155 class sim4Args {
00156 public:
00157 int ali_flag,
00158 poly_flag,
00159 acc_flag,
00160
00161
00162 reverse,
00163 DRANGE,
00164 weight,
00165 cutoff;
00166 bool set_K, set_C;
00167 int W, K, C, X, B, CDS_from, CDS_to;
00168 char *S;
00169
00170 void getArg(int agc, char *agv[]);
00171 sim4Args();
00172 ~sim4Args();
00173 };
00174
00175
00176 #endif