Changeset 1575 for branches/ralph/src/main/java/de/ugoe/cs/autoquest
- Timestamp:
- 06/25/14 16:12:05 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWatermanRepeated.java
r1574 r1575 5 5 import java.util.LinkedList; 6 6 import java.util.List; 7 import java.util.logging.Level; 7 8 8 9 import de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix; 10 import de.ugoe.cs.util.console.Console; 9 11 10 12 public class SmithWatermanRepeated { … … 95 97 for (int j = 1; j < length2; j++) { 96 98 matrix[0][j].setScore(0); 97 matrix[0][j].setPrevious(matrix[0][j-1]); 98 99 //We don't need to go back to [0][0] if we reached matrix[0][x], so just end here 100 //matrix[0][j].setPrevious(matrix[0][j-1]); 101 matrix[0][j].setPrevious(null); 99 102 } 100 103 … … 219 222 public void traceback() { 220 223 MatrixEntry tmp = matrix[length1+1][0]; 221 //TODO: Why do we need such long arrays, also, add a check if we reach the limit? 222 int aligned1[] = new int[2*length1+2*length2]; 223 int aligned2[] = new int[2*length1+2*length2]; 224 System.out.println("Aligned length: " + aligned1.length); 224 int aligned1[] = new int[length1+length2+2]; 225 int aligned2[] = new int[length1+length2+2]; 225 226 int count = 0; 226 227 do … … 234 235 tmp = tmp.getPrevious(); 235 236 count++; 236 System.out.println(count); 237 if (length1+length2+2 == count) { 238 Console.traceln(Level.WARNING, "Traceback longer than both sequences summed up!"); 239 break; 240 } 237 241 238 242 } while(tmp != null); 239 240 //reverse order 243 count--; 244 //reverse order of the alignment 241 245 int reversed1[] = new int[count]; 242 246 int reversed2[] = new int[count];
Note: See TracChangeset
for help on using the changeset viewer.