Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (traceTwo > 0 && traceOne > 0)
- {
- int diag = 0;
- if (seqTwoArray[traceTwo - 1] == seqOneArray[traceOne - 1])
- diag = 3;
- else
- diag = -1;
- //Chck if diagnonal is best path
- if (traceTwo > 0 && traceOne > 0 && scoringMatrix[traceTwo][traceOne] == scoringMatrix[traceTwo - 1][traceOne - 1] + diag)
- {
- AlignmentA = seqOneArray[traceOne - 1] + AlignmentA;
- AlignmentB = seqTwoArray[traceTwo - 1] + AlignmentB;
- traceTwo = traceTwo - 1;
- traceOne = traceOne - 1;
- }
- //Mismatch is best option
- else if (traceOne > 0 && scoringMatrix[traceTwo][traceOne] == scoringMatrix[traceTwo][traceOne - 1] - 4)
- {
- AlignmentA = seqOneArray[traceOne - 1] + AlignmentA;
- AlignmentB = "-" + AlignmentB;
- traceOne = traceOne - 1;
- }
- else if (traceTwo > 0 && scoringMatrix[traceTwo][traceOne] == scoringMatrix[traceTwo - 1][traceOne] -4)
- {
- AlignmentA = "-" + AlignmentA;
- AlignmentB = seqTwoArray[traceTwo - 1] + AlignmentB;
- traceTwo = traceTwo - 4;
- //cout << endl << AlignmentA << endl << AlignmentB << endl;
- }
- }
- cout << endl << AlignmentA << endl << AlignmentB << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement