ec0e89cca987d5987c04edc923d228b51feaf9c0
[mussa.git] / sequence.hh
1 //                        ----------------------------------------
2 //                           ---------- sequence.hh -----------
3 //                        ----------------------------------------
4
5
6 #include <iostream>
7 #include <iomanip>
8 #include <list>
9 #include <vector>
10 #include <string>
11 #include <fstream>
12 #include <stdlib.h>
13 #include <algorithm>
14
15 // Sequence data class
16
17 using namespace std;
18
19 struct annot
20 {
21   int start, end;
22   string name, type;
23 };
24
25 class Sequence
26 {
27   friend class ConnView;
28   friend class SeqView;
29   private:
30     string sequence;
31     int length;
32     string header;
33     string species;
34     int species_num; 
35
36
37     list<annot> annots;
38
39     void motif_scan(string a_motif, vector<int> * motif_match_starts);
40     string rc_motif(string a_motif);
41     string motif_validate(string a_motif);
42
43   public:
44     Sequence();
45     string load_fasta(string file_path, int seq_num, 
46                     int start_index, int end_index);
47     string load_annot(string file_path, int start_index, int end_index);
48     string seq();
49     string subseq(int start, int end);
50     const char * c_seq();
51     string rev_comp();
52     int len();
53     string hdr();
54     void set_seq(string a_seq);
55     vector<int> find_motif(string a_motif);
56     string sp_name();
57     void clear();
58     void save(fstream &save_file);
59     void load_museq(string load_file_path, int seq_num); 
60 };