- Timestamp:
- 06/27/14 15:25:25 (10 years ago)
- Location:
- branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/BinaryAlignmentStorage.java
r1582 r1584 1 1 package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; 2 3 4 import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.SmithWatermanRepeated; 2 5 3 6 public class BinaryAlignmentStorage { 4 7 8 private SmithWatermanRepeated[][] alignments; 9 UPGMAMatrix sequenceDistances; 10 11 public BinaryAlignmentStorage(int size) { 12 alignments = new SmithWatermanRepeated[size][size]; 13 sequenceDistances = new UPGMAMatrix(size); 14 sequenceDistances.initialize(Double.POSITIVE_INFINITY); 15 } 16 17 public void set(int i,int j,SmithWatermanRepeated sw) { 18 alignments[i][j] = sw; 19 } 20 21 public SmithWatermanRepeated get(int i,int j) { 22 return alignments[i][j]; 23 } 24 25 public void setDistance(int i,int j,double distance) { 26 sequenceDistances.set(i, j, distance); 27 } 28 29 public double getDistance(int i,int j) { 30 return sequenceDistances.get(i,j); 31 } 32 33 public UPGMAMatrix getDistanceMatrix() { 34 return sequenceDistances; 35 } 5 36 } 37 -
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/pal/tree/UPGMAAligningTree.java
r1579 r1584 17 17 18 18 import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.NumberSequence; 19 import de.ugoe.cs.autoquest.tasktrees.alignment.matrix.BinaryAlignmentStorage; 19 20 import de.ugoe.cs.autoquest.tasktrees.alignment.matrix.UPGMAMatrix; 20 21 import de.ugoe.cs.autoquest.tasktrees.alignment.pal.misc.Identifier; … … 41 42 * @param m distance matrix 42 43 */ 43 public UPGMAAligningTree(ArrayList<NumberSequence> numberseqs, UPGMAMatrix m)44 { 45 if ( m.size() < 2)44 public UPGMAAligningTree(ArrayList<NumberSequence> numberseqs, BinaryAlignmentStorage alignments) 45 { 46 if (alignments.getDistanceMatrix().size() < 2) 46 47 { 47 48 new IllegalArgumentException("LESS THAN 2 TAXA IN DISTANCE MATRIX"); … … 49 50 50 51 this.numberseqs = numberseqs; 51 init(m); 52 this.alignments = alignments; 53 init(alignments.getDistanceMatrix()); 52 54 53 55 while (true) … … 73 75 // 74 76 private ArrayList<NumberSequence> numberseqs; 77 private BinaryAlignmentStorage alignments; 75 78 private int numClusters; 76 79 private int besti, abi;
Note: See TracChangeset
for help on using the changeset viewer.