X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sequence.hpp;h=6a50cb0b8aa31e4a3a3b6c9c97e77416f53eeeb1;hb=2bb9267aa4b4ecdf8488b06605cc9f3f36fa4332;hp=904e25aeb7a5b4d3476df576217d12820f95f358;hpb=544469443afe44920bdf279aefd26d29534cabaf;p=mothur.git diff --git a/sequence.hpp b/sequence.hpp index 904e25a..6a50cb0 100644 --- a/sequence.hpp +++ b/sequence.hpp @@ -13,10 +13,12 @@ * to set and get these values for the other classes where they are needed. * * */ -using namespace std; -#include "mothur.h" +//Data Structure for a fasta file. + +#include "mothur.h" +#include "mothurout.h" /**************************************************************************************************/ @@ -25,6 +27,14 @@ public: Sequence(); Sequence(string, string); Sequence(ifstream&); + Sequence(istringstream&); + Sequence(const Sequence& se) : name(se.name), unaligned(se.unaligned), aligned(se.aligned), pairwise(se.pairwise), numBases(se.numBases), startPos(se.startPos), endPos(se.endPos), + alignmentLength(se.alignmentLength), isAligned(se.isAligned), longHomoPolymer(se.longHomoPolymer), ambigBases(se.ambigBases) { m = MothurOut::getInstance(); } + + //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); @@ -32,23 +42,33 @@ public: void setAligned(string); void setLength(); void reverseComplement(); + void trim(int); string convert2ints(); 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&, int&); + string getCommentString(ifstream&); + string getSequenceString(istringstream&, int&); + string getCommentString(istringstream&); string name; string unaligned; string aligned;