]> git.donarmstrong.com Git - mothur.git/blob - sequence.hpp
94d7d29b6117da80862e9fc8b3d0855c4adb8edd
[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         //these constructors just set the unaligned string to save space
30         Sequence(string, string, string);  
31         Sequence(ifstream&, string);
32         Sequence(istringstream&, string);
33         
34         void setName(string);
35         void setUnaligned(string);
36         void setPairwise(string);
37         void setAligned(string);
38         void setLength();
39         void reverseComplement();
40         void trim(int);
41         
42         string convert2ints();
43         string getName();
44         string getAligned();
45         string getPairwise();
46         string getUnaligned();
47         string getInlineSeq();
48         int getNumBases();
49         int getStartPos();
50         int getEndPos();
51         void padToPos(int);
52         void padFromPos(int);
53         int getAlignLength();
54         int getAmbigBases();
55         void removeAmbigBases();
56         int getLongHomoPolymer();
57         bool getIsAligned();
58         void printSequence(ostream&);
59         
60 private:
61         MothurOut* m;
62         void initialize();
63         string getSequenceString(ifstream&);
64         string getCommentString(ifstream&);
65         string getSequenceString(istringstream&);
66         string getCommentString(istringstream&);
67         string name;
68         string unaligned;
69         string aligned;
70         string pairwise;
71         int numBases;
72         int alignmentLength;
73         bool isAligned;
74         int longHomoPolymer;
75         int ambigBases;
76         int startPos, endPos;
77 };
78
79 /**************************************************************************************************/
80
81 #endif