Ignore:
Timestamp:
07/14/14 23:27:01 (10 years ago)
Author:
rkrimmel
Message:

Removed parameters from alignmentalgorihm factory constructor and changed interface by adding a new align() method, which now gets all the data via parameter

File:
1 edited

Legend:

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

    r1589 r1612  
    1818import java.util.logging.Level; 
    1919 
     20import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.AlignmentAlgorithm; 
    2021import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.AlignmentAlgorithmFactory; 
    2122import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.NumberSequence; 
     
    221222                        //Align 2 sequences 
    222223                        if(seqCount1 == 1 && seqCount2 == 1) { 
    223                                 alignment = (alignments.get(node1.getNumber(), node2.getNumber())).getAlignment(); 
     224                                AlignmentAlgorithm aa = AlignmentAlgorithmFactory.create(); 
     225                                aa.align(node1.getSequence(0).getSequence(), node2.getSequence(0).getSequence(), submat, 5); 
     226                                alignment = aa.getAlignment(); 
    224227                                 
    225228                        } 
     
    231234                                double maxScore = 0.0; 
    232235                                int maxIndex = 0; 
    233                                 for(int i=0;i<seqCount1;i++) { 
    234                                         tempStorage.set(i, 1, AlignmentAlgorithmFactory.create(node1.getSequence(i).getSequence(), node2.getSequence(0).getSequence() , submat, 5)); 
     236                                for(int i=0;i<seqCount1;i++){ 
     237                                        AlignmentAlgorithm aa = AlignmentAlgorithmFactory.create(); 
     238                                        aa.align(node1.getSequence(i).getSequence(), node2.getSequence(0).getSequence() , submat, 5); 
     239                                        tempStorage.set(i, 1, aa); 
     240                                         
    235241                                        if(maxScore < tempStorage.get(i, 1).getAlignmentScore()) { 
    236242                                                maxScore = tempStorage.get(i, 1).getAlignmentScore(); 
     
    249255                                int maxIndex = 0; 
    250256                                for(int i=0;i<seqCount2;i++) { 
    251                                         tempStorage.set(1, i, AlignmentAlgorithmFactory.create(node2.getSequence(i).getSequence(), node1.getSequence(0).getSequence() , submat, 5)); 
     257                                        AlignmentAlgorithm aa = AlignmentAlgorithmFactory.create(); 
     258                                        aa.align(node2.getSequence(i).getSequence(), node1.getSequence(0).getSequence() , submat, 5); 
     259                                        tempStorage.set(1, i, aa); 
    252260                                        if(maxScore < tempStorage.get(1, i).getAlignmentScore()) { 
    253261                                                maxScore = tempStorage.get(1, i).getAlignmentScore(); 
     
    269277                                        for(int i=0;i<seqCount1;i++) { 
    270278                                                for(int j=0;j<seqCount2;j++) { 
    271                                                         tempStorage1.set(j, 0, AlignmentAlgorithmFactory.create(node1.getSequence(i).getSequence(), node2.getSequence(j).getSequence() , submat, 5)); 
     279                                                        AlignmentAlgorithm aa =AlignmentAlgorithmFactory.create(); 
     280                                                        aa.align(node1.getSequence(i).getSequence(), node2.getSequence(j).getSequence() , submat, 5); 
     281                                                        tempStorage1.set(j, 0, aa); 
    272282                                                        if(maxScore1 < tempStorage1.get(j, 0).getAlignmentScore()) { 
    273283                                                                maxScore1 = tempStorage1.get(j, 0).getAlignmentScore(); 
     
    280290                                        for(int i=0; i<seqCount2;i++) { 
    281291                                                for (int j=0;j<seqCount1;j++) { 
    282                                                         tempStorage2.set(j, 0, AlignmentAlgorithmFactory.create(node2.getSequence(i).getSequence(),node1.getSequence(j).getSequence(),submat,5)); 
     292                                                        AlignmentAlgorithm aa =AlignmentAlgorithmFactory.create(); 
     293                                                        aa.align(node2.getSequence(i).getSequence(),node1.getSequence(j).getSequence(),submat,5); 
     294                                                        tempStorage2.set(j, 0, aa); 
    283295                                                        if(maxScore2 < tempStorage2.get(j, 0).getAlignmentScore()) { 
    284296                                                                maxScore2 = tempStorage2.get(j, 0).getAlignmentScore(); 
Note: See TracChangeset for help on using the changeset viewer.