X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=trimseqscommand.cpp;h=16d83de2596b9cf84ab4069789917878fa89559e;hp=7140b56c6b5866321a763675b7b4f75bd1d618e7;hb=a8e2df1b96a57f5f29576b08361b86a96a8eff4f;hpb=859e3a473a3e63e0060c49be70b80f9289253da2 diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index 7140b56..16d83de 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -422,7 +422,7 @@ int TrimSeqsCommand::execute(){ if (countfile != "") { CountTable ct; - ct.readTable(countfile); + ct.readTable(countfile, true); nameCount = ct.getNameMap(); outputNames.push_back(trimCountFile); outputNames.push_back(scrapCountFile); @@ -540,7 +540,7 @@ int TrimSeqsCommand::execute(){ if (countfile != "") { //create countfile with group info included CountTable* ct = new CountTable(); - ct->readTable(trimCountFile); + ct->readTable(trimCountFile, true); map justTrimmedNames = ct->getNameMap(); delete ct; @@ -1391,9 +1391,7 @@ int TrimSeqsCommand::setLines(string filename, string qfilename) { string sname = ""; nameStream >> sname; sname = sname.substr(1); - for (int i = 0; i < sname.length(); i++) { - if (sname[i] == ':') { sname[i] = '_'; m->changedSeqNames = true; } - } + m->checkName(sname); map::iterator it = firstSeqNames.find(sname); @@ -1533,7 +1531,7 @@ bool TrimSeqsCommand::getOligos(vector >& fastaFileNames, vector< // get rest of line in case there is a primer name while (!inOligos.eof()) { char c = inOligos.get(); - if (c == 10 || c == 13){ break; } + if (c == 10 || c == 13 || c == -1){ break; } else if (c == 32 || c == 9){;} //space or tab else { group += c; } } @@ -1648,7 +1646,7 @@ bool TrimSeqsCommand::getOligos(vector >& fastaFileNames, vector< if (hasPairedBarcodes || hasPrimer) { pairedOligos = true; if ((primers.size() != 0) || (barcodes.size() != 0) || (linker.size() != 0) || (spacer.size() != 0) || (revPrimer.size() != 0)) { m->control_pressed = true; m->mothurOut("[ERROR]: cannot mix paired primers and barcodes with non paired or linkers and spacers, quitting."); m->mothurOutEndLine(); return 0; } - } + }else if (reorient) { m->mothurOut("[Warning]: cannot use checkorient without paired barcodes or primers, ignoring.\n"); m->mothurOutEndLine(); reorient = false; } if(barcodeNameVector.size() == 0 && primerNameVector[0] == ""){ allFiles = 0; } @@ -1852,7 +1850,13 @@ bool TrimSeqsCommand::keepFirstTrim(Sequence& sequence, QualityScores& qscores){ if(qscores.getName() != ""){ qscores.trimQScores(-1, keepFirst); } + +// sequence.printSequence(cout);cout << endl; + sequence.trim(keepFirst); + +// sequence.printSequence(cout);cout << endl << endl;; + return success; } catch(exception& e) {