]> git.donarmstrong.com Git - mothur.git/blob - sequence.hpp
c634f78b6522e43742800b0a4541d910eb7d6be3
[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         
41         string convert2ints();
42         string getName();
43         string getAligned();
44         string getPairwise();
45         string getUnaligned();
46         int getNumBases();
47         int getStartPos();
48         int getEndPos();
49         int getAlignLength();
50         int getAmbigBases();
51         void removeAmbigBases();
52         int getLongHomoPolymer();
53         bool getIsAligned();
54         void printSequence(ostream&);
55         
56 private:
57         MothurOut* m;
58         void initialize();
59         string getSequenceString(ifstream&);
60         string getCommentString(ifstream&);
61         string getSequenceString(istringstream&);
62         string getCommentString(istringstream&);
63         string name;
64         string unaligned;
65         string aligned;
66         string pairwise;
67         int numBases;
68         int alignmentLength;
69         bool isAligned;
70         int longHomoPolymer;
71         int ambigBases;
72         int startPos, endPos;
73 };
74
75 /**************************************************************************************************/
76
77 #endif