Ejemplo n.º 1
0
  public static UMatrix createUMatrix(String[] amino, int[][] pam) {
    UMatrix s = new UMatrix(pam.length);

    for (int i = 0; i < pam.length; ++i) {
      for (int j = 0; j <= i; ++j) {
        AnceWPair max = new AnceWPair(null, Integer.MIN_VALUE);
        for (int k = 0; k < pam.length; ++k) {
          AnceWPair temp = new AnceWPair("" + k, pam[k][i] + pam[k][j]);
          if (max.compare(temp) < 0) max = temp;
        }
        max.set_name(amino[Integer.parseInt(max.name())]);
        s.set_e_at(i, j, max);
      }
    }

    return s;
  }
Ejemplo n.º 2
0
 public static String prettyPrint(AnceWPair[][] matrix) {
   return prettyPrint(AnceWPair.ancePart(matrix)) + "\n" + prettyPrint(AnceWPair.wPart(matrix));
 }