Ignore:
Timestamp:
07/04/14 00:38:41 (10 years ago)
Author:
rkrimmel
Message:

Adding needleman wunsch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWatermanRepeated.java

    r1586 r1587  
    102102                 
    103103                 
    104                 for (int i = 1; i <= length1 + 1; i++) { 
     104                for (int i = 1; i < length1 + 2; i++) { 
    105105                 
    106106                        // Formula for first row: 
     
    220220        public void traceback() { 
    221221                MatrixEntry tmp = matrix[length1+1][0]; 
    222                 int aligned1[] = new int[length1+length2+2]; 
    223                 int aligned2[] = new int[length1+length2+2]; 
     222                int aligned1[] = new int[length1+1+length2+2]; 
     223                int aligned2[] = new int[length1+1+length2+2]; 
    224224                int count = 0; 
    225225                do 
     
    227227                        if(count != 0) 
    228228                        { 
    229                                 if (length1+length2+2 == count) {        
     229                                if (length1+1+length2+2 == count) {      
    230230                                        Console.traceln(Level.WARNING, "Traceback longer than both sequences summed up!"); 
    231231                                        break; 
     
    312312                        System.out.format("%5d", input1[i - 1]); 
    313313                System.out.println(); 
    314                 for (int j = 0; j < length2; j++) { 
     314                for (int j = 0; j <= length2; j++) { 
    315315                        if (j > 0) 
    316316                                System.out.format("%5d ",input2[j - 1]); 
Note: See TracChangeset for help on using the changeset viewer.