Changeset 1616 for branches/ralph/src
- Timestamp:
- 07/15/14 20:54:58 (10 years ago)
- Location:
- branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/AlignmentAlgorithmFactory.java
r1613 r1616 1 1 package de.ugoe.cs.autoquest.tasktrees.alignment.algorithms; 2 2 3 import java.lang.reflect.Constructor;4 import java.lang.reflect.InvocationTargetException;5 6 import de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix;7 3 8 4 public class AlignmentAlgorithmFactory { … … 25 21 26 22 } catch (ClassNotFoundException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException e) { 27 // TODO Auto-generated catch block28 23 e.printStackTrace(); 29 24 } -
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/NeedlemanWunsch.java
r1615 r1616 187 187 } 188 188 189 public void printAlignment() { 190 MatrixEntry tmp = matrix[length1][length2]; 191 String aligned1 = ""; 192 String aligned2 = ""; 193 int count = 0; 194 do { 195 System.out.println(tmp); 196 String append1 = ""; 197 String append2 = ""; 198 199 if (tmp.getXvalue() == Constants.GAP_SYMBOL) { 200 append1 = " ___"; 201 } else { 202 append1 = String.format("%5d", tmp.getXvalue()); 203 } 204 205 if (tmp.getYvalue() == Constants.GAP_SYMBOL) { 206 append2 = " ___"; 207 } else { 208 append2 = String.format("%5d", tmp.getYvalue()); 209 } 210 if (count != 0) { 211 aligned1 = append1 + aligned1; 212 aligned2 = append2 + aligned2; 213 } 214 215 tmp = tmp.getPrevious(); 216 count++; 217 218 } while (tmp != null); 219 System.out.println(aligned1); 220 System.out.println(aligned2); 221 } 222 189 223 190 /** 224 191 * print the dynmaic programming matrix … … 241 208 } 242 209 } 210 211 public void printAlignment() { 212 int[] tmp1 = alignment.get(0).getSequence(); 213 int[] tmp2 = alignment.get(1).getSequence(); 214 for (int i=0; i< tmp1.length;i++) { 215 if(tmp1[i] == Constants.GAP_SYMBOL) { 216 System.out.print(" ___"); 217 } 218 else if(tmp1[i] == Constants.UNMATCHED_SYMBOL) { 219 System.out.print(" ..."); 220 } 221 else { 222 System.out.format("%5d", tmp1[i]); 223 } 224 225 } 226 System.out.println(); 227 for (int i=0; i< tmp2.length;i++) { 228 if(tmp2[i] == Constants.GAP_SYMBOL) { 229 System.out.print(" ___"); 230 } 231 else if(tmp2[i] == Constants.UNMATCHED_SYMBOL) { 232 System.out.print(" ..."); 233 } 234 else { 235 System.out.format("%5d", tmp2[i]); 236 } 237 238 } 239 System.out.println(); 240 241 242 243 } 243 244 244 245 /*
Note: See TracChangeset
for help on using the changeset viewer.