Example #1
0
  // constructor
  public TQuery(String[] args) {
    try {
      long startTime = System.currentTimeMillis();
      processArgs(args);

      queryIndex = new QueryIndex(this);
      queryLoader = new QueryLoader(this);

      // print some stats on building the engine
      String diffTime =
          Num.formatNumberOneFraction(((double) (System.currentTimeMillis() - startTime)) / 1000);
      int numFiles = vcfDataFiles.length + bedDataFiles.length + mafDataFiles.length;
      System.err.println("\n" + diffTime + " Sec to build using " + IO.memory() + " of RAM");
      System.err.println("\t" + numFiles + "\tData sources loaded");
      System.err.println("\t" + dataSources.getRecordsLoaded() + "\tRecords indexed");
      System.err.println("\t" + dataSources.getRecordsSkipped() + "\tRecords skipped\n");

      // print summary of available filters
      System.err.println(dataSources.fetchSummary());

      queryFilesFromCmdLine();

      // release file handles
      queryLoader.closeTabixReaders();

    } catch (Exception e) {
      e.printStackTrace();
      System.err.println("\nProblem with executing the TQuery!");
    }
  }