for (int i = 0; i < refSeqs.size(); i++) { delete refSeqs[i]; }
if (chimeraFlag == "yes") {
-
+
if (realign) {
vector<string> parents;
for (int i = 0; i < Results.size(); i++) {
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;
}
}
-
for (int i = 0; i < mergedResults.size(); i++) {
//cout << mergedResults[i] << '\t' << db[mergedResults[i]]->getName() << endl;
if (db[mergedResults[i]]->getName() != q->getName()) {
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);
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";
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);
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) {
#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; }
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<int> seqIndex(names.size());
}
int chimeraPenalty = computeChimeraPenalty();
-
+
//fills outputResults
chimera = chimeraMaligner(chimeraPenalty, decalc);
if (m->control_pressed) { return chimera; }
vector<trace_struct> trace = mapTraceRegionsToAlignment(path, refSeqs);
-
+
if (trace.size() > 1) { chimera = "yes"; }
else { chimera = "no"; return chimera; }
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);
}
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) {
try {
vector<data_struct> all; all.clear();
myQuery = *query;
-
-
+
for (int i = 0; i < refSeqs.size(); i++) {
for (int j = i+1; j < refSeqs.size(); j++) {
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<int, int> spots; //map from spot in original sequence to spot in filtered sequence for query and both parents
vector<data_struct> divs = runBellerophon(q, leftParent, rightParent, spots);
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;
//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;
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;