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