File: gene-reader.h

package info (click to toggle)
transtermhp 2.09-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 536 kB
  • sloc: cpp: 4,665; python: 294; makefile: 203; sh: 115
file content (50 lines) | stat: -rw-r--r-- 1,101 bytes parent folder | download | duplicates (5)
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
/* This file is part of TransTerm v2.0 BETA and is covered by the GNU GPL
 * License version 2.0. See file LICENSE.txt for more details. */

#ifndef GENE_READER_H
#define GENE_READER_H
#include <iostream>
#include <fstream>
#include <string>
#include "seq.h"

using namespace std;

// abstract base class of all classes that can read annotation files
class GeneReader
{
public:
    virtual bool read_genes(Genome &) = 0;
    virtual ~GeneReader() {};
    virtual bool good() = 0;
};

// read a .coords file from TIGR CMR
class CoordsReader : public GeneReader
{
public:
    CoordsReader(const string &);
    virtual ~CoordsReader() {}
    bool read_genes(Genome &);
    bool good() { return _in.good(); }
private:
    ifstream _in;
};

// read a .ptt file from GenBank
class PTTReader : public GeneReader
{
public:
    PTTReader(const string &);
    virtual ~PTTReader() {}
    bool read_genes(Genome &);
    bool good() { return _in.good(); }
private:
    ifstream _in;
    string _id;
};

// return the correct reader class given a filename
GeneReader * gene_reader_factory(const string &);

#endif