X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sequence.hpp;h=94d7d29b6117da80862e9fc8b3d0855c4adb8edd;hb=4de093e3b92bdab1579565cb2873553412f6671e;hp=e094fb520f7ad26c96cbcfa7226e194bd883f690;hpb=bfbc55964f1977da72c2cea984288a427d370a59;p=mothur.git diff --git a/sequence.hpp b/sequence.hpp index e094fb5..94d7d29 100644 --- a/sequence.hpp +++ b/sequence.hpp @@ -8,32 +8,72 @@ * Created by Pat Schloss on 12/15/08. * Copyright 2008 Patrick D. Schloss. All rights reserved. * + * A sequence object has three components: i) an accession number / name, ii) the unaligned primary sequence, iii) a + * pairwise aligned sequence, and iv) a sequence that is aligned to a reference alignment. This class has methods + * to set and get these values for the other classes where they are needed. * + * */ -using namespace std; #include "mothur.h" - +#include "mothurout.h" /**************************************************************************************************/ class Sequence { public: Sequence(); + Sequence(string, string); Sequence(ifstream&); + Sequence(istringstream&); + + //these constructors just set the unaligned string to save space + Sequence(string, string, string); + Sequence(ifstream&, string); + Sequence(istringstream&, string); + void setName(string); void setUnaligned(string); void setPairwise(string); void setAligned(string); + void setLength(); + void reverseComplement(); + void trim(int); + string convert2ints(); - string getSeqName(); + string getName(); string getAligned(); string getPairwise(); string getUnaligned(); + string getInlineSeq(); + int getNumBases(); + int getStartPos(); + int getEndPos(); + void padToPos(int); + void padFromPos(int); + int getAlignLength(); + int getAmbigBases(); + void removeAmbigBases(); + int getLongHomoPolymer(); + bool getIsAligned(); + void printSequence(ostream&); + private: + MothurOut* m; + void initialize(); + string getSequenceString(ifstream&); + string getCommentString(ifstream&); + string getSequenceString(istringstream&); + string getCommentString(istringstream&); string name; string unaligned; - string pairwise; string aligned; + string pairwise; + int numBases; + int alignmentLength; + bool isAligned; + int longHomoPolymer; + int ambigBases; + int startPos, endPos; }; /**************************************************************************************************/