]> git.donarmstrong.com Git - mothur.git/blobdiff - sequence.hpp
modified mpi code to save ram by writing out every 10 seqs.
[mothur.git] / sequence.hpp
index 03cbab7ffddce5531e272cf6116069edfa0ebade..5f84d441c20d0fd8a0ed8f9284b7a32dfc9b4214 100644 (file)
@@ -8,11 +8,14 @@
  *  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"
 
 /**************************************************************************************************/
 
@@ -20,28 +23,47 @@ class Sequence {
 public:
        Sequence();
        Sequence(string, string);
+       Sequence(ifstream&);
+       Sequence(istringstream&);
        
        void setName(string);
        void setUnaligned(string);
        void setPairwise(string);
        void setAligned(string);
        void setLength();
+       void reverseComplement();
        
        string convert2ints();
        string getName();
        string getAligned();
        string getPairwise();
        string getUnaligned();
-       int getLength();
+       int getNumBases();
+       int getStartPos();
+       int getEndPos();
+       int getAlignLength();
+       int getAmbigBases();
+       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 aligned;
        string pairwise;
-       int length;
-       int lengthAligned;
+       int numBases;
+       int alignmentLength;
+       bool isAligned;
+       int longHomoPolymer;
+       int ambigBases;
+       int startPos, endPos;
 };
 
 /**************************************************************************************************/