sim4.h

Go to the documentation of this file.
00001 #ifndef SIM4_H
00002 #define SIM4_H
00003 #include <iostream.h>
00004 
00005 /* $Id: sim4.h,v 1.1.1.1 2007-07-13 03:44:06 kzhou Exp $ */
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   /* 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 };  //kemin zhou
00044 //EST can be either 5' or 3'!!!
00045 enum { FWD = 0, BWD = 1, BOTH = 2 };
00046 enum { OK = 0, FREE_START = 1, FREE_END = 2, FREE_BOTH_ENDS = 3};
00047 
00048 /* data structures */
00049 
00050 /* used in select_path() */
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                 //get the total matching length with 90% default cut
00067       int  from1, from2, to1, to2;
00068       int  min_diag, max_diag;
00069       int  match;               //percent 0-100%
00070       char ori;                 //C E G N  ?
00071       int  length;              //length of the matches region
00072       int  flag;
00073       int  ematches;
00074       int  edist;  //what is this?
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 /* used only in the alignment stage */
00095 class edit_script 
00096 {
00097         public:
00098           char op_type;   /* SUB, INS, or DEL */
00099      int num;        /* Number of operations */
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;  //length of each match
00110       int    score;  //total number of INS, DEL, SUB
00111       edit_script *script;
00112       edit_script_list *next_script;
00113 };
00114 
00115 struct edit {
00116         struct edit *link;            /* previous edit instruction */
00117         char   type[2];
00118         int    accumulation;
00119         char   op;                    /* INSERT, DELETE or INTRON */
00120         int    line1;                 /* line number in file1 */
00121         int    line2;                 /* line number in file2 */
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         //for testing purpose
00145    int internal;
00146         int icoverage; //siez of the match
00147         int mult;      //I don't know what is it
00148         int nmatches;  //number of identical bases in icoverage
00149    double fcoverage;  //fraction of coverage icoverage/cDNA.len
00150         // or nmatch/cDNA.len
00151         double marginals;
00152 };
00153 typedef sim4_stats sim4_stats_t;
00154 
00155 class sim4Args {
00156         public:
00157    int ali_flag, 
00158                 poly_flag, // 0 display PolyA or T in alignment
00159                 acc_flag,  //N Request an additional search for small 
00160                 //marginal exons (N=1) guided by the splice_site 
00161                 //recognition signals.  default is 0
00162                 reverse,  // 0 plus strand, 1 - strand, 2 both
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;  //stores the CDS S=123..2000 text info
00169         //may not be needed
00170         void getArg(int agc, char *agv[]);
00171         sim4Args();
00172         ~sim4Args();
00173 };
00174 
00175 
00176 #endif

Generated on Wed Aug 10 11:56:59 2011 for Softwares from Orpara by  doxygen 1.5.6