Changeset 1578 for branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWatermanRepeated.java
- Timestamp:
- 06/25/14 19:21:42 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWatermanRepeated.java
r1575 r1578 2 2 3 3 import java.util.ArrayList; 4 import java.util.Iterator;5 import java.util.LinkedList;6 4 import java.util.List; 7 5 import java.util.logging.Level; 8 6 9 7 import de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix; 8 import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.Constants; 10 9 import de.ugoe.cs.util.console.Console; 11 10 … … 79 78 */ 80 79 private double similarity(int i, int j) { 81 return submat.get Distance(input1[i - 1], input2[j - 1]);80 return submat.getScore(input1[i - 1], input2[j - 1]); 82 81 } 83 82 … … 129 128 130 129 } 131 132 130 133 131 tempMax -= scoreThreshold; … … 145 143 { 146 144 matrix[i][0].setXvalue(input1[i-1]); 147 matrix[i][0].setYvalue( -2);145 matrix[i][0].setYvalue(Constants.UNMATCHED_SYMBOL); 148 146 } 149 147 else { … … 161 159 162 160 // find the directions that give the maximum scores. 163 // Multiple directions are ignored TODO161 // TODO: Multiple directions are ignored, we choose the first maximum score 164 162 //True if we had a match 165 163 if (diagScore == matrix[i][j].getScore()) { … … 171 169 if (leftScore == matrix[i][j].getScore()) { 172 170 matrix[i][j].setXvalue(input1[i-1]); 173 matrix[i][j].setYvalue( -1);171 matrix[i][j].setYvalue(Constants.GAP_SYMBOL); 174 172 matrix[i][j].setPrevious(matrix[i-1][j]); 175 173 } 176 174 //true if we took an event from sequence y and not from x 177 175 if (upScore == matrix[i][j].getScore()) { 178 matrix[i][j].setXvalue( -1);176 matrix[i][j].setXvalue(Constants.GAP_SYMBOL); 179 177 matrix[i][j].setYvalue(input2[j-1]); 180 178 matrix[i][j].setPrevious(matrix[i][j-1]); … … 184 182 matrix[i][j].setPrevious(matrix[i][0]); 185 183 matrix[i][j].setXvalue(input1[i-1]); 186 matrix[i][j].setYvalue( -2);184 matrix[i][j].setYvalue(Constants.UNMATCHED_SYMBOL); 187 185 } 188 186 } … … 271 269 String append2=""; 272 270 273 if(tmp.getXvalue() == -1) {271 if(tmp.getXvalue() == Constants.GAP_SYMBOL) { 274 272 append1 = " ___"; 275 273 } 276 else if(tmp.getXvalue() == -2) {274 else if(tmp.getXvalue() == Constants.UNMATCHED_SYMBOL) { 277 275 append1 = " ..."; 278 276 } … … 281 279 } 282 280 283 if(tmp.getYvalue() == -1) {281 if(tmp.getYvalue() == Constants.GAP_SYMBOL) { 284 282 append2 = " ___"; 285 283 } 286 else if(tmp.getYvalue() == -2) {284 else if(tmp.getYvalue() == Constants.UNMATCHED_SYMBOL) { 287 285 append2 = " ..."; 288 286 }
Note: See TracChangeset
for help on using the changeset viewer.