]> git.donarmstrong.com Git - mothur.git/blobdiff - sequence.cpp
worked on trim.seqs
[mothur.git] / sequence.cpp
index b73bfab7caefdb0a97e5f7cc8f3271ec3e51cb57..136e8934419c45182ae2116d2aead2b7374eea3d 100644 (file)
@@ -38,19 +38,15 @@ Sequence::Sequence(string newName, string sequence) {
 Sequence::Sequence(istringstream& fastaString){
        try {
                m = MothurOut::getInstance();
-       int pid;
-       MPI_Comm_rank(MPI_COMM_WORLD, &pid); 
-       cout << pid << " after mothur instance " << &name << endl;
+       
                initialize();
-       cout << "after mothur initialize" << endl;
                fastaString >> name;
-       cout << "after name "  << endl;
                name = name.substr(1);
                string sequence;
-               
+       
                //read comments
                while ((name[0] == '#') && fastaString) { 
-                       while (fastaString)     {       char c = fastaString.get(); if (c == 10 || c == 13){    break;  }       } // get rest of line if there's any crap there
+                       while (!fastaString.eof())      {       char c = fastaString.get(); if (c == 10 || c == 13){    break;  }       } // get rest of line if there's any crap there
                        sequence = getCommentString(fastaString);
                        
                        if (fastaString) {  
@@ -61,12 +57,10 @@ Sequence::Sequence(istringstream& fastaString){
                                break;
                        }
                }
-       cout << "after mothur comment" << endl; 
-               //read real sequence
-               while (fastaString)     {       char c = fastaString.get(); if (c == 10 || c == 13){    break;  }       } // get rest of line if there's any crap there
-       cout << "after mothur name" << endl;    
+               
+               while (!fastaString.eof())      {       char c = fastaString.get();  if (c == 10 || c == 13){   break;  }       } // get rest of line if there's any crap there
+               
                sequence = getSequenceString(fastaString);              
-       cout << "after mothur sequence" << endl;        
                setAligned(sequence);   
                //setUnaligned removes any gap characters for us                                                
                setUnaligned(sequence);         
@@ -169,8 +163,9 @@ string Sequence::getSequenceString(istringstream& fastaFile) {
                char letter;
                string sequence = "";   
                
-               while(fastaFile){
+               while(!fastaFile.eof()){
                        letter= fastaFile.get();
+       
                        if(letter == '>'){
                                fastaFile.putback(letter);
                                break;
@@ -448,5 +443,31 @@ void Sequence::reverseComplement(){
        aligned = temp;
        
 }
-
+#ifdef USE_MPI 
 //********************************************************************************************************************
+int Sequence::MPISend(int receiver) {
+       try {
+               
+       
+               return 0;
+
+       }
+       catch(exception& e) {
+               m->errorOut(e, "Sequence", "MPISend");
+               exit(1);
+       }
+}
+/**************************************************************************************************/
+int Sequence::MPIRecv(int sender) {
+       try {
+               
+               return 0;
+
+       }
+       catch(exception& e) {
+               m->errorOut(e, "Sequence", "MPIRecv");
+               exit(1);
+       }
+}
+#endif
+/**************************************************************************************************/