Ignore:
Timestamp:
05/25/14 16:51:10 (10 years ago)
Author:
rkrimmel
Message:

Smith waterman working again

File:
1 edited

Legend:

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

    r1554 r1555  
    6969                this.submat = submat; 
    7070 
    71                 System.out.println("Starting SmithWaterman algorithm with a " 
    72                                 + submat.getClass() + " Substitution Matrix: " + submat.getClass().getCanonicalName()); 
     71                //System.out.println("Starting SmithWaterman algorithm with a " 
     72                //              + submat.getClass() + " Substitution Matrix: " + submat.getClass().getCanonicalName()); 
    7373                scoreThreshold = 20; 
    7474                score = new double[length1 + 1][length2 + 1]; 
     
    9090        private double similarity(int i, int j) { 
    9191                if (i == 0 || j == 0) { 
    92                         // it's a gap (indel) 
     92                        // it's a gap  
    9393                        return submat.getGapPenalty(); 
    9494                } 
     
    9797                // return (input1[i - 1] == input2[j - 1]) ? MATCH_SCORE : 
    9898                // MISMATCH_SCORE; 
    99                 return submat.getDistance(i - 1, j - 1); 
     99                return submat.getDistance(input1[i - 1], input2[j - 1]); 
    100100        } 
    101101 
     
    279279         */ 
    280280        public void printDPMatrix() { 
    281                 System.out.print("   "); 
     281                System.out.print("          "); 
    282282                for (int j = 1; j <= length2; j++) 
    283                         System.out.print("   " + input2[j - 1]); 
     283                        System.out.format("%5d", input2[j - 1]); 
    284284                System.out.println(); 
    285285                for (int i = 0; i <= length1; i++) { 
    286286                        if (i > 0) 
    287                                 System.out.print(input1[i - 1] + " "); 
    288                         else 
    289                                 System.out.print("  "); 
     287                                System.out.format("%5d ",input1[i - 1]); 
     288                        else{ 
     289                                System.out.print("      "); 
     290                        } 
    290291                        for (int j = 0; j <= length2; j++) { 
    291                                 System.out.print(score[i][j] + " "); 
     292                                System.out.format("%4.1f ",score[i][j]); 
    292293                        } 
    293294                        System.out.println(); 
Note: See TracChangeset for help on using the changeset viewer.