]> git.donarmstrong.com Git - mothur.git/blobdiff - alignmentdb.cpp
test
[mothur.git] / alignmentdb.cpp
index 6b05989d40a0184540a9397fb75efd79e49a14cc..5c758ecebb249710be141813a734eb571b88da32 100644 (file)
@@ -17,7 +17,7 @@
 AlignmentDB::AlignmentDB(string fastaFileName, string method, int kmerSize, float gapOpen, float gapExtend, float match, float misMatch){              //      This assumes that the template database is in fasta format, may 
        try {                                                                                   //      need to alter this in the future?
                longest = 0;
-               
+
                ifstream fastaFile;
                openInputFile(fastaFileName, fastaFile);
                
@@ -25,14 +25,13 @@ AlignmentDB::AlignmentDB(string fastaFileName, string method, int kmerSize, floa
                mothurOut("Reading in the " + fastaFileName + " template sequences...\t");      cout.flush();
                
                while (!fastaFile.eof()) {
-                       Sequence temp(fastaFile);
-                       
-                       templateSequences.push_back(temp);
+                       Sequence temp(fastaFile);  gobble(fastaFile);
                        
-                       //save longest base
-                       if (temp.getUnaligned().length() > longest)  { longest = temp.getUnaligned().length(); }
-                       
-                       gobble(fastaFile);
+                       if (temp.getName() != "") {
+                               templateSequences.push_back(temp);
+                               //save longest base
+                               if (temp.getUnaligned().length() > longest)  { longest = temp.getUnaligned().length()+1; }
+                       }
                }
                
                numSeqs = templateSequences.size();