File: long-orfs.hh

package info (click to toggle)
tigr-glimmer 3.02b-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 13,948 kB
  • sloc: cpp: 24,416; awk: 232; csh: 220; makefile: 147; sh: 51
file content (122 lines) | stat: -rw-r--r-- 3,104 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
//  A. L. Delcher
//
//  File:  long-orfs.hh
//
//  Last Modified:  2 Aug 2005
//
//  Declarations for  long-orfs.cc



#ifndef  __LONG_ORFS_HH_INCLUDED
#define  __LONG_ORFS_HH_INCLUDED


#include  "delcher.hh"
#include  "fasta.hh"
#include  "gene.hh"
#include  <queue>


// Default values of global variables

static const bool  DEFAULT_GENOME_IS_CIRCULAR = true;
static const int  DEFAULT_MIN_GENE_LEN = 90;
static const int  DEFAULT_MAX_OLAP_BASES = 30;
static const double  LONG_ORF_SCORE_PER_BASE = 0.03;
  // artificially good score value for sufficiently long orfs


struct  Orf_Interval_t
  {
   int  lo, hi;
   int  frame;
   bool  deleted;
  };


static bool  Orf_Interval_Cmp
    (const Orf_Interval_t & a, const Orf_Interval_t & b)
  { return  (a . lo < b . lo || (a . lo == b . lo && a . hi < b . hi)); }


struct  Range_t
  {
   int  lo, hi;
  };


static bool  Range_Cmp
    (const Range_t & a, const Range_t & b)
  { return  (a . lo < b . lo || (a . lo == b . lo && a . hi < b . hi)); }


struct  Position_t
  {
   int  lo, hi, max_prev;
  };


struct  Start_t
  {
   int  j, pos, which;
   double  score, rate;
  };


// Function prototypes

static void  Echo_General_Settings
    (FILE * fp);
static void  Echo_Specific_Settings
    (FILE * fp, int len);
static void  Eliminate_Overlapping
    (vector <Orf_Interval_t> & orf_list, int max_olap);
static double  Entropy_Distance_Ratio
    (int start, int len, int fr);
static void  Entropy_Filter
    (vector <Orf_t> & orf_list, double cutoff);
static int  Find_Optimal_Len
    (const vector <Orf_Interval_t> & interval);
static void  Find_Orfs
    (vector <Orf_t> & orf_list);
static void  Finish_Orfs
    (bool use_wraparound, const int prev_rev_stop [3],
     const int last_rev_start [3], int last_position,
     vector <Orf_t> & orf_list);
static void  Get_Ignore_Regions
    (void);
static void  Get_Intervals
    (vector <Orf_Interval_t> & interval_list, const vector <Orf_t> & orf_list);
static void  Handle_First_Forward_Stop
     (int fr, int pos, int start_pos, int first_base, int & gene_len,
      int & orf_len, bool use_wraparound);
static void  Handle_Last_Reverse_Stop
     (int fr, const int prev_rev_stop [3], const int last_rev_start [3],
      int & gene_len, int & orf_len, bool use_wraparound, int last_position);
static int  Intersect_Size
    (int a, int b, int c, int d);
static int  On_Seq_0
    (int i);
static int  On_Seq_1
    (int i);
static void  Output_Orfs
    (FILE * fp, const vector <Orf_Interval_t> & interval, int & total_len);
static void  Parse_Command_Line
    (int argc, char * argv []);
static void  Print_Comma_Separated_Strings
    (const vector <const char *> & v, FILE * fp);
static void  Read_Entropy_Profiles
    (const char * fn, bool & errflg);
static void  Remove_Shorter
    (vector <Orf_Interval_t> & interval, int len);
static void  Set_Start_And_Stop_Codons
    (void);
static void  Usage
    (void);
static void  Wrap_Around_Back
    (int wfr, int pos, int & gene_len, int & orf_len);
static void  Wrap_Through_Front
    (int fr, int pos, int & gene_len, int & orf_len);

#endif