Last change
on this file since 1586 was
1586,
checked in by rkrimmel, 10 years ago
|
Adding simple smith waterman and changing alignment algorithm creation to factory pattern
|
File size:
1000 bytes
|
Rev | Line | |
---|
[1582] | 1 | package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; |
---|
| 2 | |
---|
[1584] | 3 | |
---|
[1586] | 4 | import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.AlignmentAlgorithm; |
---|
[1584] | 5 | |
---|
[1582] | 6 | public class BinaryAlignmentStorage { |
---|
| 7 | |
---|
[1586] | 8 | private AlignmentAlgorithm[][] alignments; |
---|
[1584] | 9 | UPGMAMatrix sequenceDistances; |
---|
| 10 | |
---|
[1585] | 11 | public BinaryAlignmentStorage(int sizex, int sizey) { |
---|
[1586] | 12 | alignments = new AlignmentAlgorithm[sizex+1][sizey+1]; |
---|
[1585] | 13 | sequenceDistances = new UPGMAMatrix(Math.max(sizex,sizey)); |
---|
[1584] | 14 | sequenceDistances.initialize(Double.POSITIVE_INFINITY); |
---|
| 15 | } |
---|
| 16 | |
---|
[1586] | 17 | public void set(int i,int j,AlignmentAlgorithm sw) { |
---|
[1584] | 18 | alignments[i][j] = sw; |
---|
| 19 | } |
---|
| 20 | |
---|
[1586] | 21 | public AlignmentAlgorithm get(int i,int j) { |
---|
[1584] | 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 | } |
---|
[1582] | 36 | } |
---|
[1584] | 37 | |
---|
Note: See
TracBrowser
for help on using the repository browser.