Next version of JABA
[jabaws.git] / binaries / src / clustalw / src / alignment / Sequence.h
1 /**
2  * Author: Mark Larkin
3  * 
4  * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.  
5  */
6 /**
7  * This class contains the sequence information. It should also contain
8  * the sequence name, and the encoded version.
9  * A vector of Sequences is passed to the Alignment object to set it up.
10  * CHANGES:
11  * Mark 22-1-2007: Added a unique sequence identifier to help with correct output
12  * order of sequences.   
13  */
14  
15 #ifndef SEQUENCE_H
16 #define SEQUENCE_H
17
18 #include <vector>
19 #include <string>
20 #include "../general/userparams.h"
21 #include "../general/utils.h"
22
23 namespace clustalw
24 {
25
26 class Sequence
27 {
28     public:
29         /* Functions */
30         Sequence(std::string& seq, std::string& name, std::string& title);
31         Sequence(std::string& seq, std::string& name, std::string& title, 
32                  unsigned long id);
33         Sequence(std::vector<int>* encodedSequence, std::string& name, std::string& title, 
34                  unsigned long id);
35         void encodeSequence();
36         void printSequence();
37         std::vector<int>* getSequence();
38         bool isEmpty();
39         std::string getName();
40         std::string getTitle();
41         bool checkDNAFlag();
42         unsigned long getIdentifier(){return identifier;}
43         /* Attributes */
44
45     private:
46         /* Functions */
47         void checkIntegrity();
48         void copyStringIntoVector(std::vector<char>* _vectorTo, std::string* _stringFrom);
49         
50         /* Attributes */
51         std::vector<char> _sequence;
52         std::vector<int> _encodedSequence;
53         std::string _name;
54         std::string _title;
55         unsigned long identifier;
56 };
57
58 }
59 #endif