+ //cout << q->getName() << endl << q->getAligned() << endl << endl;
+ //cout << leftParent.getName() << '\t' << leftParent.getAligned().length() << endl << endl;
+ //cout << rightParent.getName() << '\t' << rightParent.getAligned().length() << endl << endl;
+ //cout << q.getName() << '\t' << q.getAligned().length() << 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);
+
+ if (m->control_pressed) { return "no"; }
+// cout << "examining:\t" << refSeqs[i]->getName() << '\t' << refSeqs[j]->getName() << endl;
+ vector<data_struct> selectedDivs;
+ for (int k = 0; k < divs.size(); k++) {
+
+ vector<snps> snpsLeft = getSNPS(divs[k].parentA.getAligned(), divs[k].querySeq.getAligned(), divs[k].parentB.getAligned(), divs[k].winLStart, divs[k].winLEnd);
+ vector<snps> snpsRight = getSNPS(divs[k].parentA.getAligned(), divs[k].querySeq.getAligned(), divs[k].parentB.getAligned(), divs[k].winRStart, divs[k].winREnd);
+
+ if (m->control_pressed) { return "no"; }
+
+ int numSNPSLeft = snpsLeft.size();
+ int numSNPSRight = snpsRight.size();
+
+// cout << numSNPSLeft << '\t' << numSNPSRight << endl;
+ //require at least 4 SNPs on each side of the break
+ if ((numSNPSLeft >= 4) && (numSNPSRight >= 4)) {
+
+ float BS_A, BS_B;
+ bootstrapSNPS(snpsLeft, snpsRight, BS_A, BS_B, iters);
+
+ if (m->control_pressed) { return "no"; }
+
+ divs[k].bsa = BS_A;
+ divs[k].bsb = BS_B;
+ divs[k].bsMax = max(BS_A, BS_B);
+ divs[k].chimeraMax = max(divs[k].qla_qrb, divs[k].qlb_qra);
+
+
+ //are we within 10 points of the bootstrap cutoff?
+// if ((divs[k].bsMax >= (minBS-10)) && (iters < 1000)) {
+// bootstrapSNPS(snpsLeft, snpsRight, BS_A, BS_B, 1000);
+//
+// if (m->control_pressed) { delete q; delete leftParent; delete rightParent; return "no"; }
+//
+// divs[k].bsa = BS_A;
+// divs[k].bsb = BS_B;
+// divs[k].bsMax = max(BS_A, BS_B);
+// divs[k].chimeraMax = max(divs[k].qla_qrb, divs[k].qlb_qra);
+// }
+
+ //so results reflect orignal alignment
+ divs[k].winLStart = spots[divs[k].winLStart];
+ divs[k].winLEnd = spots[divs[k].winLEnd];
+ divs[k].winRStart = spots[divs[k].winRStart];
+ divs[k].winREnd = spots[divs[k].winREnd];
+
+ selectedDivs.push_back(divs[k]);
+ }
+ }
+
+ //save selected
+ for (int mi = 0; mi < selectedDivs.size(); mi++) { all.push_back(selectedDivs[mi]); }