Advertisement
Guest User

Untitled

a guest
May 4th, 2016
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1.  
  2.  
  3.  
  4. while (traceTwo > 0 && traceOne > 0)
  5. {
  6. int diag = 0;
  7.  
  8.  
  9. if (seqTwoArray[traceTwo - 1] == seqOneArray[traceOne - 1])
  10. diag = 3;
  11. else
  12. diag = -1;
  13.  
  14. //Chck if diagnonal is best path
  15.  
  16. if (traceTwo > 0 && traceOne > 0 && scoringMatrix[traceTwo][traceOne] == scoringMatrix[traceTwo - 1][traceOne - 1] + diag)
  17. {
  18.  
  19. AlignmentA = seqOneArray[traceOne - 1] + AlignmentA;
  20. AlignmentB = seqTwoArray[traceTwo - 1] + AlignmentB;
  21. traceTwo = traceTwo - 1;
  22. traceOne = traceOne - 1;
  23.  
  24.  
  25. }
  26.  
  27. //Mismatch is best option
  28. else if (traceOne > 0 && scoringMatrix[traceTwo][traceOne] == scoringMatrix[traceTwo][traceOne - 1] - 4)
  29. {
  30. AlignmentA = seqOneArray[traceOne - 1] + AlignmentA;
  31. AlignmentB = "-" + AlignmentB;
  32. traceOne = traceOne - 1;
  33.  
  34. }
  35.  
  36.  
  37. else if (traceTwo > 0 && scoringMatrix[traceTwo][traceOne] == scoringMatrix[traceTwo - 1][traceOne] -4)
  38. {
  39. AlignmentA = "-" + AlignmentA;
  40. AlignmentB = seqTwoArray[traceTwo - 1] + AlignmentB;
  41. traceTwo = traceTwo - 4;
  42. //cout << endl << AlignmentA << endl << AlignmentB << endl;
  43.  
  44. }
  45. }
  46.  
  47. cout << endl << AlignmentA << endl << AlignmentB << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement