Ignore:
Timestamp:
06/18/14 21:24:30 (10 years ago)
Author:
rkrimmel
Message:

Adding FitchMargaliash? Class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java

    r1568 r1570  
    2727import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.FengDoolittle; 
    2828import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.NumberSequence; 
    29 import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.SmithWaterman; 
    3029import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.SmithWatermanRepeated; 
    3130import de.ugoe.cs.autoquest.tasktrees.alignment.substitution.ObjectDistanceSubstitionMatrix; 
     
    163162 
    164163                TriangleMatrix sequenceDistances = new TriangleMatrix(numberseqs.size()); 
     164                sequenceDistances.initialize(Double.POSITIVE_INFINITY); 
    165165 
    166166                for (int i = 0; i < numberseqs.size(); i++) { 
     
    190190                                         
    191191                                        double score = twoSequences.getAlignmentScore(); 
    192                                         // Scores of the sequence beeing aligned to itself 
     192                                        // Scores of the sequence being aligned to itself 
    193193                                        double sSelf1 = sameSequence1.getAlignmentScore(); 
    194194                                        double sSelf2 = sameSequence2.getAlignmentScore(); 
     
    198198                                        double sMax = (sSelf1 + sSelf2) / 2; 
    199199                                        double sEff = (score - sRand)/ (sMax - sRand); 
     200                                        if(sEff < 0) { 
     201                                                sEff = 0; 
     202                                        } 
    200203                                        double distance = -Math.log(sEff); 
    201                                  
    202                                         System.out.println("Score: " + score + " sRand: " + sRand + " sMax: " + sMax + " sEff: " + sEff + " distance: " + distance); 
    203204                                         
    204                                         sequenceDistances.set(i,j,distance ); 
     205                                         
     206                                        if(!Double.isInfinite(distance) && !Double.isNaN(distance)) { 
     207                                                //System.out.println("Score: " + String.format("%5.1f", score) + " sRand: " + String.format("%5.1f", sRand) + " sMax: " + String.format("%6.1f", sMax)  + " distance: " + String.format("%2.3f",distance)); 
     208                                                if(distance < sequenceDistances.get(i, j)) {     
     209                                                        sequenceDistances.set(i,j,distance ); 
     210                                                } 
     211                                        } 
    205212 
    206213                                        if (score > 0) { 
     
    227234                        } 
    228235                } 
    229                 //System.out.println(sequenceDistances.toString()); 
     236                System.out.println(sequenceDistances.toString()); 
    230237                 
    231238                do { 
    232239                        System.out.println(); 
    233                         FengDoolittle fd = new FengDoolittle(); 
     240                        //FengDoolittle fd = new FengDoolittle(); 
    234241 
    235242                        // appData.getStopWatch().start("whole loop"); 
Note: See TracChangeset for help on using the changeset viewer.