From d945488119ad368b180537f36ed40298ff170f39 Mon Sep 17 00:00:00 2001 From: westcott Date: Mon, 9 May 2011 11:54:45 +0000 Subject: [PATCH] 1.19.0 --- chimeraslayer.cpp | 6 +++--- chimeraslayercommand.cpp | 9 ++++----- getoturepcommand.cpp | 2 +- maligner.cpp | 8 ++++---- slayer.cpp | 16 ++++++++++------ trimseqscommand.cpp | 2 +- 6 files changed, 23 insertions(+), 20 deletions(-) diff --git a/chimeraslayer.cpp b/chimeraslayer.cpp index 423f7c0..729ef1f 100644 --- a/chimeraslayer.cpp +++ b/chimeraslayer.cpp @@ -773,7 +773,7 @@ int ChimeraSlayer::getChimeras(Sequence* query) { for (int i = 0; i < refSeqs.size(); i++) { delete refSeqs[i]; } if (chimeraFlag == "yes") { - + if (realign) { vector parents; for (int i = 0; i < Results.size(); i++) { @@ -1113,7 +1113,8 @@ vector ChimeraSlayer::getBlastSeqs(Sequence* q, vector& db seen[tempIndexesRight[i]] = tempIndexesRight[i]; } } - + //string qname = q->getName().substr(0, q->getName().find_last_of('_')); + //cout << qname << endl; for (int i = 0; i < mergedResults.size(); i++) { //cout << mergedResults[i] << '\t' << db[mergedResults[i]]->getName() << endl; @@ -1201,7 +1202,6 @@ vector ChimeraSlayer::getKmerSeqs(Sequence* q, vector& db, } } - for (int i = 0; i < mergedResults.size(); i++) { //cout << mergedResults[i] << '\t' << db[mergedResults[i]]->getName() << endl; if (db[mergedResults[i]]->getName() != q->getName()) { diff --git a/chimeraslayercommand.cpp b/chimeraslayercommand.cpp index 7dfebb0..8835290 100644 --- a/chimeraslayercommand.cpp +++ b/chimeraslayercommand.cpp @@ -25,7 +25,7 @@ vector ChimeraSlayerCommand::setParameters(){ CommandParameter pmincov("mincov", "Number", "", "70", "", "", "",false,false); parameters.push_back(pmincov); CommandParameter pminsnp("minsnp", "Number", "", "10", "", "", "",false,false); parameters.push_back(pminsnp); CommandParameter pminbs("minbs", "Number", "", "90", "", "", "",false,false); parameters.push_back(pminbs); - CommandParameter psearch("search", "Multiple", "kmer-blast-distance", "blast", "", "", "",false,false); parameters.push_back(psearch); + CommandParameter psearch("search", "Multiple", "kmer-blast", "blast", "", "", "",false,false); parameters.push_back(psearch); CommandParameter pprocessors("processors", "Number", "", "1", "", "", "",false,false); parameters.push_back(pprocessors); CommandParameter prealign("realign", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(prealign); CommandParameter ptrim("trim", "Boolean", "", "F", "", "", "",false,false); parameters.push_back(ptrim); @@ -77,7 +77,7 @@ string ChimeraSlayerCommand::getHelpString(){ helpString += "The mincov parameter allows you to specify minimum coverage by closest matches found in template. Default is 70, meaning 70%. \n"; helpString += "The minbs parameter allows you to specify minimum bootstrap support for calling a sequence chimeric. Default is 90, meaning 90%. \n"; helpString += "The minsnp parameter allows you to specify percent of SNPs to sample on each side of breakpoint for computing bootstrap support (default: 10) \n"; - helpString += "The search parameter allows you to specify search method for finding the closest parent. Choices are distance, blast, and kmer, default distance. \n"; + helpString += "The search parameter allows you to specify search method for finding the closest parent. Choices are blast, and kmer, default blast. \n"; helpString += "The realign parameter allows you to realign the query to the potential parents. Choices are true or false, default true. \n"; helpString += "The chimera.slayer command should be in the following format: \n"; helpString += "chimera.slayer(fasta=yourFastaFile, reference=yourTemplate, search=yourSearch) \n"; @@ -351,7 +351,7 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option) { temp = validParameter.validFile(parameters, "split", false); if (temp == "not found") { temp = "f"; } trimera = m->isTrue(temp); - search = validParameter.validFile(parameters, "search", false); if (search == "not found") { search = "distance"; } + search = validParameter.validFile(parameters, "search", false); if (search == "not found") { search = "blast"; } temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } convert(temp, iters); @@ -362,7 +362,7 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option) { temp = validParameter.validFile(parameters, "numwanted", false); if (temp == "not found") { temp = "15"; } convert(temp, numwanted); - if ((search != "distance") && (search != "blast") && (search != "kmer")) { m->mothurOut(search + " is not a valid search."); m->mothurOutEndLine(); abort = true; } + if ((search != "blast") && (search != "kmer")) { m->mothurOut(search + " is not a valid search."); m->mothurOutEndLine(); abort = true; } } } catch(exception& e) { @@ -732,7 +732,6 @@ int ChimeraSlayerCommand::driver(linePair* filePos, string outputFName, string f #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) unsigned long int pos = inFASTA.tellg(); - //cout << candidateSeq->getName() << '\t' << pos << endl; if ((pos == -1) || (pos >= filePos->end)) { break; } #else if (inFASTA.eof()) { break; } diff --git a/getoturepcommand.cpp b/getoturepcommand.cpp index 342190d..06a633e 100644 --- a/getoturepcommand.cpp +++ b/getoturepcommand.cpp @@ -645,7 +645,7 @@ string GetOTURepCommand::findRep(vector names) { try{ // if only 1 sequence in bin or processing the "unique" label, then // the first sequence of the OTU is the representative one - if ((names.size() == 1) || (list->getLabel() == "unique")) { + if ((names.size() == 1)) { return names[0]; }else{ vector seqIndex(names.size()); diff --git a/maligner.cpp b/maligner.cpp index 0cd8336..f4c4a98 100644 --- a/maligner.cpp +++ b/maligner.cpp @@ -42,7 +42,7 @@ string Maligner::getResults(Sequence* q, DeCalculator* decalc) { } int chimeraPenalty = computeChimeraPenalty(); - + //fills outputResults chimera = chimeraMaligner(chimeraPenalty, decalc); @@ -95,7 +95,7 @@ string Maligner::chimeraMaligner(int chimeraPenalty, DeCalculator* decalc) { if (m->control_pressed) { return chimera; } vector trace = mapTraceRegionsToAlignment(path, refSeqs); - + if (trace.size() > 1) { chimera = "yes"; } else { chimera = "no"; return chimera; } @@ -161,7 +161,7 @@ string Maligner::chimeraMaligner(int chimeraPenalty, DeCalculator* decalc) { temp.queryToParentLocal = computePercentID(queryInRegion, parentInRegion); -// cout << query->getName() << '\t' << temp.parent << '\t' << "NAST:" << temp.nastRegionStart << '-' << temp.nastRegionEnd << " G:" << temp.queryToParent << " L:" << temp.queryToParentLocal << ", " << temp.divR << endl; + //cout << query->getName() << '\t' << temp.parent << '\t' << "NAST:" << temp.nastRegionStart << '-' << temp.nastRegionEnd << " G:" << temp.queryToParent << " L:" << temp.queryToParentLocal << ", " << temp.divR << endl; outputResults.push_back(temp); } @@ -490,7 +490,7 @@ vector Maligner::mapTraceRegionsToAlignment(vector p for (int i = 1; i < path.size(); i++) { int next_region_index = path[i].row; -// cout << i << '\t' << next_region_index << endl; + //cout << i << '\t' << next_region_index << endl; if (next_region_index != region_index) { diff --git a/slayer.cpp b/slayer.cpp index 92b4673..4987d41 100644 --- a/slayer.cpp +++ b/slayer.cpp @@ -17,8 +17,7 @@ string Slayer::getResults(Sequence* query, vector refSeqs) { try { vector all; all.clear(); myQuery = *query; - - + for (int i = 0; i < refSeqs.size(); i++) { for (int j = i+1; j < refSeqs.size(); j++) { @@ -29,6 +28,11 @@ string Slayer::getResults(Sequence* query, vector refSeqs) { Sequence* q = new Sequence(query->getName(), query->getAligned()); Sequence* leftParent = new Sequence(refSeqs[i]->getName(), refSeqs[i]->getAligned()); Sequence* rightParent = new Sequence(refSeqs[j]->getName(), refSeqs[j]->getAligned()); + + //cout << q->getName() << endl << q->getAligned() << endl << endl; + //cout << leftParent->getName() << endl << leftParent->getAligned() << endl << endl; + //cout << rightParent->getName() << endl << rightParent->getAligned() << endl << endl; + //cout << " length = " << rightParent->getAligned().length() << endl; map spots; //map from spot in original sequence to spot in filtered sequence for query and both parents vector divs = runBellerophon(q, leftParent, rightParent, spots); @@ -149,13 +153,13 @@ vector Slayer::runBellerophon(Sequence* q, Sequence* pA, Sequence* int rightLength = length - leftLength; float QLA = computePercentID(query, parentA, 0, breakpoint); - float QRB = computePercentID(query, parentB, breakpoint+1, length); + float QRB = computePercentID(query, parentB, breakpoint+1, length-1); float QLB = computePercentID(query, parentB, 0, breakpoint); - float QRA = computePercentID(query, parentA, breakpoint+1, length); + float QRA = computePercentID(query, parentA, breakpoint+1, length-1); float LAB = computePercentID(parentA, parentB, 0, breakpoint); - float RAB = computePercentID(parentA, parentB, breakpoint+1, length); + float RAB = computePercentID(parentA, parentB, breakpoint+1, length-1); float AB = ((LAB*leftLength) + (RAB*rightLength)) / (float) length; float QA = ((QLA*leftLength) + (QRA*rightLength)) / (float) length; @@ -174,7 +178,7 @@ vector Slayer::runBellerophon(Sequence* q, Sequence* pA, Sequence* //cout << q->getName() << '\t'; //cout << pA->getName() << '\t'; //cout << pB->getName() << '\t'; - // cout << "bp: " << breakpoint << " CHIM_TYPE_A\t" << divR_QLA_QRB << "\tQLA: " << QLA << "\tQRB: " << QRB << "\tQLA_QRB: " << QLA_QRB; + //cout << "bp: " << breakpoint << " CHIM_TYPE_A\t" << divR_QLA_QRB << "\tQLA: " << QLA << "\tQRB: " << QRB << "\tQLA_QRB: " << QLA_QRB; //cout << "\tCHIM_TYPE_B\t" << divR_QLB_QRA << "\tQLB: " << QLB << "\tQRA: " << QRA << "\tQLB_QRA: " << QLB_QRA << endl; //cout << leftLength << '\t' << rightLength << '\t' << QLA << '\t' << QRB << '\t' << QLB << '\t' << QRA << '\t' << LAB << '\t' << RAB << '\t' << AB << '\t' << QA << '\t' << QB << '\t' << QLA_QRB << '\t' << QLB_QRA << endl; diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index a9979e7..f685a42 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -583,7 +583,7 @@ int TrimSeqsCommand::driverCreateTrim(string filename, string qFileName, string if(barcodes.size() != 0){ string thisGroup = barcodeNameVector[barcodeIndex]; - if (primers.size() != 0) { thisGroup += "." + primerNameVector[primerIndex]; } + if (primers.size() != 0) { if (primerNameVector[primerIndex] != "") { thisGroup += "." + primerNameVector[primerIndex]; } } outGroupsFile << currSeq.getName() << '\t' << thisGroup << endl; -- 2.39.2