]> git.donarmstrong.com Git - mothur.git/blob - sequence.hpp
5f84d441c20d0fd8a0ed8f9284b7a32dfc9b4214
[mothur.git] / sequence.hpp
1 #ifndef SEQUENCE_H
2 #define SEQUENCE_H
3
4 /*
5  *  sequence.h
6  *  
7  *
8  *  Created by Pat Schloss on 12/15/08.
9  *  Copyright 2008 Patrick D. Schloss. All rights reserved.
10  *
11  *      A sequence object has three components: i) an accession number / name, ii) the unaligned primary sequence, iii) a
12  *      pairwise aligned sequence, and iv) a sequence that is aligned to a reference alignment.  This class has methods
13  *      to set and get these values for the other classes where they are needed.  *
14  *
15  */
16
17 #include "mothur.h"
18 #include "mothurout.h"
19
20 /**************************************************************************************************/
21
22 class Sequence {
23 public:
24         Sequence();
25         Sequence(string, string);
26         Sequence(ifstream&);
27         Sequence(istringstream&);
28         
29         void setName(string);
30         void setUnaligned(string);
31         void setPairwise(string);
32         void setAligned(string);
33         void setLength();
34         void reverseComplement();
35         
36         string convert2ints();
37         string getName();
38         string getAligned();
39         string getPairwise();
40         string getUnaligned();
41         int getNumBases();
42         int getStartPos();
43         int getEndPos();
44         int getAlignLength();
45         int getAmbigBases();
46         int getLongHomoPolymer();
47         bool getIsAligned();
48         void printSequence(ostream&);
49         
50 private:
51         MothurOut* m;
52         void initialize();
53         string getSequenceString(ifstream&);
54         string getCommentString(ifstream&);
55         string getSequenceString(istringstream&);
56         string getCommentString(istringstream&);
57         string name;
58         string unaligned;
59         string aligned;
60         string pairwise;
61         int numBases;
62         int alignmentLength;
63         bool isAligned;
64         int longHomoPolymer;
65         int ambigBases;
66         int startPos, endPos;
67 };
68
69 /**************************************************************************************************/
70
71 #endif