import java.io.Writer;
import java.text.DecimalFormat;
import java.text.NumberFormat;
+import java.util.Arrays;
import org.forester.evoinference.matrix.distance.DistanceMatrix;
import org.forester.util.ForesterUtil;
this.jalviewMatrix = jalviewInputMatrix;
this.sequences = matrixSequences;
-
if (jalviewMatrix.width() != jalviewMatrix.height())
{
// some kind of warning?
}
+ int i = 0;
+
+ for (Sequence sequence : sequences)
+ {
+ identifiers[i] = sequence.getName();
+ i++;
+ }
}
{
// some kind of warning?
}
+ int i = 0;
+
+ for (String identifier : matrixIdentifiers)
+ {
+ identifiers[i] = identifier;
+ i++;
+ }
}
@Override
public String getIdentifier(int i)
{
- // TODO Auto-generated method stub
- return null;
+ return identifiers[i];
}
@Override
public int getIndex(String identifier)
{
- return 0;
+ return Arrays.asList(identifiers).indexOf(identifier);
}
/**
/**
* See {@link MatrixI#getValue(int,int)} except that the order of column, row
- * in the parameters is inverted here
+ * in the parameters is inverted here (as that is how forester demands it)
*/
@Override
public double getValue(int col, int row)
@Override
public void setIdentifier(int i, String identifier)
{
- // TODO Auto-generated method stub
+ identifiers[i] = identifier;
}
/**
* See {@link MatrixI#setValue()} except that the order of column, row in the
- * parameters is inverted here
+ * parameters is inverted here (as that is how forester demands it)
*/
@Override
public void setValue(int col, int row, double distance)