X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=alignmentdb.cpp;h=5c758ecebb249710be141813a734eb571b88da32;hb=df92022fc75c08b91cefa2c6ca4fd7b23eb480b0;hp=6b05989d40a0184540a9397fb75efd79e49a14cc;hpb=ef3f6d42fe720cd6d91419e5e32f8c04d8765010;p=mothur.git diff --git a/alignmentdb.cpp b/alignmentdb.cpp index 6b05989..5c758ec 100644 --- a/alignmentdb.cpp +++ b/alignmentdb.cpp @@ -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();