Example #1
0
  /**
   * ************************** readDataFile **************************** * Reads the input file and
   * gets the number of taxa and alignment * length * *
   * *********************************************************************
   */
  public static void getHeader(String infilenameComplete) {
    // needs the complete path to the file
    try {
      TextInputStream in = new TextInputStream(infilenameComplete);
      String line = in.readLine();
      in.close();
      StringTokenizer reader = new StringTokenizer(line);
      options.setNumTaxa(Integer.parseInt(reader.nextToken()));
      options.setNumSites(Integer.parseInt(reader.nextToken()));
    } catch (FileNotFoundException e) {
      JOptionPane.showMessageDialog(
          new JFrame(),
          "Could not read the input alignment",
          "jModelTest error",
          JOptionPane.ERROR_MESSAGE);
    }

    if (options.getNumTaxa() <= 4)
      JOptionPane.showMessageDialog(
          new JFrame(),
          "The number of taxa does not seem to be correct: " + options.getNumTaxa(),
          "jModelTest error",
          JOptionPane.ERROR_MESSAGE);

    if (options.getNumSites() <= 1)
      JOptionPane.showMessageDialog(
          new JFrame(),
          "The number of sites does not seem to be correct: " + options.getNumTaxa(),
          "jModelTest error",
          JOptionPane.ERROR_MESSAGE);
  }