Ignore:
Timestamp:
06/30/14 08:51:09 (10 years ago)
Author:
rkrimmel
Message:

Adding simple smith waterman and changing alignment algorithm creation to factory pattern

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/pal/tree/UPGMAAligningTree.java

    r1585 r1586  
    1515 
    1616import java.util.ArrayList; 
    17 import java.util.Iterator; 
    1817import java.util.logging.Level; 
    1918 
     19import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.AlignmentAlgorithm; 
     20import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.AlignmentAlgorithmFactory; 
    2021import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.NumberSequence; 
    2122import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.SmithWatermanRepeated; 
     
    228229                                int maxIndex = 0; 
    229230                                for(int i=0;i<seqCount1;i++) { 
    230                                         tempStorage.set(i, 1, new SmithWatermanRepeated(node1.getSequence(i).getSequence(), node2.getSequence(0).getSequence() , submat, 5)); 
     231                                        tempStorage.set(i, 1, AlignmentAlgorithmFactory.create(node1.getSequence(i).getSequence(), node2.getSequence(0).getSequence() , submat, 5)); 
    231232                                        if(maxScore < tempStorage.get(i, 1).getAlignmentScore()) { 
    232233                                                maxScore = tempStorage.get(i, 1).getAlignmentScore(); 
     
    234235                                        } 
    235236                                } 
     237                                //if(maxScore > 0) 
    236238                                alignment.add(tempStorage.get(maxIndex, 1).getAlignment().get(1)); 
    237239                        } 
     
    243245                                int maxIndex = 0; 
    244246                                for(int i=0;i<seqCount2;i++) { 
    245                                         tempStorage.set(1, i, new SmithWatermanRepeated(node2.getSequence(i).getSequence(), node1.getSequence(0).getSequence() , submat, 5)); 
     247                                        tempStorage.set(1, i, AlignmentAlgorithmFactory.create(node2.getSequence(i).getSequence(), node1.getSequence(0).getSequence() , submat, 5)); 
    246248                                        if(maxScore < tempStorage.get(1, i).getAlignmentScore()) { 
    247249                                                maxScore = tempStorage.get(1, i).getAlignmentScore(); 
     
    249251                                        } 
    250252                                } 
     253                                //if(maxScore > 0) 
    251254                                alignment.add(tempStorage.get(1,maxIndex).getAlignment().get(1)); 
    252255                        } 
     
    261264                                        for(int i=0;i<seqCount1;i++) { 
    262265                                                for(int j=0;j<seqCount2;j++) { 
    263                                                         tempStorage1.set(j, 0, new SmithWatermanRepeated(node1.getSequence(i).getSequence(), node2.getSequence(j).getSequence() , submat, 5)); 
     266                                                        tempStorage1.set(j, 0, AlignmentAlgorithmFactory.create(node1.getSequence(i).getSequence(), node2.getSequence(j).getSequence() , submat, 5)); 
    264267                                                        if(maxScore1 < tempStorage1.get(j, 0).getAlignmentScore()) { 
    265268                                                                maxScore1 = tempStorage1.get(j, 0).getAlignmentScore(); 
     
    267270                                                        } 
    268271                                                } 
     272                                                //if(maxScore1 > 0) 
    269273                                                alignment.add(tempStorage1.get(maxIndex1,0).getAlignment().get(0)); 
    270274                                        } 
    271275                                        for(int i=0; i<seqCount2;i++) { 
    272276                                                for (int j=0;j<seqCount1;j++) { 
    273                                                         tempStorage2.set(j, 0, new SmithWatermanRepeated(node2.getSequence(i).getSequence(),node1.getSequence(j).getSequence(),submat,5)); 
     277                                                        tempStorage2.set(j, 0, AlignmentAlgorithmFactory.create(node2.getSequence(i).getSequence(),node1.getSequence(j).getSequence(),submat,5)); 
    274278                                                        if(maxScore2 < tempStorage2.get(j, 0).getAlignmentScore()) { 
    275279                                                                maxScore2 = tempStorage2.get(j, 0).getAlignmentScore(); 
     
    277281                                                        } 
    278282                                                } 
     283                                                //if(maxScore2 > 0) 
    279284                                                alignment.add(tempStorage2.get(maxIndex2,0).getAlignment().get(0)); 
    280285                                        } 
Note: See TracChangeset for help on using the changeset viewer.