]> git.donarmstrong.com Git - mothur.git/blob - sequence.hpp
fixed problem with class.fy.seqs where group totals did not add up. added constructo...
[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         int getLongHomoPolymer();
52         bool getIsAligned();
53         void printSequence(ostream&);
54         
55 private:
56         MothurOut* m;
57         void initialize();
58         string getSequenceString(ifstream&);
59         string getCommentString(ifstream&);
60         string getSequenceString(istringstream&);
61         string getCommentString(istringstream&);
62         string name;
63         string unaligned;
64         string aligned;
65         string pairwise;
66         int numBases;
67         int alignmentLength;
68         bool isAligned;
69         int longHomoPolymer;
70         int ambigBases;
71         int startPos, endPos;
72 };
73
74 /**************************************************************************************************/
75
76 #endif