public ParsingResult parse(List<String> strings) {
    String name = getName(strings);
    strings = beforeEmptyLine(withoutHeader(strings));
    List<double[]> matrix = new ArrayList<double[]>();
    if (strings.size() != alphabet_size) {
      throw new RuntimeException("Incorrect number of weight lines in the transposed matrix input file.");
    }

    int lenghtOfMotif = strings.get(0).split("\\s+").length;
    for (int positionIndex = 0; positionIndex < lenghtOfMotif; ++positionIndex) {
      matrix.add(new double[alphabet_size]);
    }

    for (int letterIndex = 0; letterIndex < alphabet_size; letterIndex ++) {
      String[] weights = strings.get(letterIndex).split("\\s+");
      if (weights.length != lenghtOfMotif) {
        throw new RuntimeException("Different number of elements in positions of transposed matrix input file.");
      }
      for (int positionIndex = 0; positionIndex < lenghtOfMotif; ++positionIndex) {
        matrix.get(positionIndex)[letterIndex] = Double.parseDouble(weights[positionIndex]);
      }
    }
    return new ParsingResult(matrix, name);
  }