Debian Codegraph @

atac-driver/libatac/atac.H

raw symbols SCIP
1 // This file is part of A2Amapper.
2 // Copyright (c) 2005 J. Craig Venter Institute
3 // Author: Brian Walenz
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 (LICENSE.txt) a copy of the GNU General Public
16 // License along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 #ifndef ATAC_COMMON_H
20 #define ATAC_COMMON_H
21
22 #include <string>
23 #include <map>
24 using namespace std;
25
26 #include "bio++.H"
27
28 #include "seqCache.H"
29
30 #include "atacMatch.H"
31 #include "atacMatchList.H"
32 #include "atacMatchOrder.H"
33
34 #include "atacFeature.H"
35 #include "atacFeatureList.H"
36
37 #include "fasta-accessor.H"
38
39 class atacFileBase {
40 public:
41 atacFileBase();
42 virtual ~atacFileBase();
43
44 char *labelA(void) { return(_labelA); };
45 char *labelB(void) { return(_labelB); };
46
47 char *assemblyFileA(void) { return(_fileA); };
48 char *assemblyFileB(void) { return(_fileB); };
49
50 seqCache *fastaA(void) { return(_seqA); };
51 seqCache *fastaB(void) { return(_seqB); };
52
53 protected:
54 void readHeader(char *inLine, FILE *in);
55 public:
56 void writeHeader(FILE *out);
57
58 protected:
59 char _fileA[1024]; // The name of our genome files
60 char _fileB[1024];
61
62 char _labelA[256]; // The label of each of the sequences
63 char _labelB[256];
64
65 map<string,string> _params;
66
67 seqCache *_seqA;
68 seqCache *_seqB;
69 };
70
71
72 class atacFileStream : public atacFileBase {
73 public:
74 atacFileStream(char const *filename);
75 ~atacFileStream();
76
77 atacMatch *nextMatch(char type);
78 atacFeature *nextFeature(char type[4]);
79
80 private:
81 FILE *_inFile;
82 char _inLine[1024];
83
84 uint32 _theMatchIID;
85 uint32 _theFeatureIID;
86
87 atacMatch _theMatch;
88 atacFeature _theFeature;
89 };
90
91
92 class afsm;
93 class atacFileStreamMerge : public atacFileBase {
94 public:
95 atacFileStreamMerge(void);
96 ~atacFileStreamMerge();
97
98 void addFile(char const *filename);
99
100 atacMatch *nextMatch(char type);
101 atacFeature *nextFeature(char type[4]);
102
103 void writeHeader(FILE *out);
104
105 private:
106 uint32 _filesLen;
107 uint32 _filesMax;
108 afsm *_files;
109
110 uint32 _theMatchIID;
111 uint32 _theFeatureIID;
112 };
113
114
115 class atacFile : public atacFileBase {
116 public:
117 atacFile(char const *filename);
118 ~atacFile();
119
120 atacMatchList *matches(void) { return(&_matches); };
121 atacMatchList *runs(void) { return(&_runs); };
122 atacMatchList *clumps(void) { return(&_clumps); };
123
124 private:
125 atacMatchList _matches;
126 atacMatchList _runs;
127 atacMatchList _clumps;
128 };
129
130 #endif // ATAC_COMMON_H