public static void main(String[] args) {
    File column = new File(args[0]);
    try {
      // how many different dbs are present
      LinkedHashMap dbs = new LinkedHashMap();
      BufferedReader in = new BufferedReader(new FileReader(column));
      String line;
      int index = 0;
      while ((line = in.readLine()) != null) {
        if (line.trim().length() == 0) continue;
        String[] tokens = line.split("\\|");
        for (int i = 0; i < tokens.length; i += 2) {
          if (dbs.containsKey(tokens[i]) == false) {
            dbs.put(tokens[i], new Integer(index++));
          }
        }
      }
      in.close();
      // print header
      Iterator it = dbs.keySet().iterator();
      while (it.hasNext()) {
        String c = (String) it.next();
        System.out.print("Reporter BioSequence DatabaseEntry [" + c + "]\t");
      }
      System.out.println();
      // print lines
      in = new BufferedReader(new FileReader(column));
      int numColumns = dbs.size();
      while ((line = in.readLine()) != null) {
        if (line.trim().length() == 0) {
          System.out.println();
        } else {
          String[] columns = new String[numColumns];
          String[] tokens = line.split("\\|");
          for (int i = 0; i < tokens.length; i += 2) {
            // System.out.println(line+"Tok"+tokens[i]);
            int columnIndex = ((Integer) dbs.get(tokens[i])).intValue();
            if (columns[columnIndex] == null) columns[columnIndex] = tokens[i + 1];
            else columns[columnIndex] = columns[columnIndex] + ";" + tokens[i + 1];
          }
          // print it
          for (int i = 0; i < numColumns; i++) {
            if (columns[i] == null) columns[i] = "";
          }
          System.out.println(Misc.stringArrayToString(columns, "\t"));
        }
      }
      in.close();

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  private void executePipelineJob() {
    String[] cmd = null;
    try {
      // write out tempTemplate
      File template = new File(outputDirectory, "pipelineTemplate.xml");
      if (IO.writeString(xmlTemplate, template) == false)
        Misc.printErrAndExit("Problem writing -> " + template);

      // build and execute cmd
      cmd =
          new String[] {
            "java",
            "-jar",
            "-Xmx2G",
            pJar.getCanonicalPath(),
            "-props",
            completePipelinePropFile.getCanonicalPath(),
            template.getCanonicalPath()
          };

      String stringCmd = Misc.stringArrayToString(cmd, " ");
      System.out.println("\nExecuting:\n" + stringCmd);
      System.out.println("\nPipelineOutput:");
      String[] out = IO.executeViaProcessBuilder(cmd, true);

      // check output for possible errors
      for (String line : out) {
        String lcLine = line.toLowerCase();
        // watch out for cases where error is mentioned in a warning output line.
        if (lcLine.contains("error") && lcLine.startsWith("warning") == false)
          Misc.printErrAndExit(
              "\n\nERROR found in Pipeline.jar output, see above. Aborting!\n" + line);
      }

    } catch (Exception e) {
      e.printStackTrace();
      Misc.printErrAndExit("ERROR: executing " + Misc.stringArrayToString(cmd, " "));
    }
  }
  /** This method will process each argument and assign new variables */
  public void processArgs(String[] args) {
    Pattern pat = Pattern.compile("-[a-z]");
    System.out.println(
        "\n" + IO.fetchUSeqVersion() + " Arguments: " + Misc.stringArrayToString(args, " ") + "\n");
    for (int i = 0; i < args.length; i++) {
      String lcArg = args[i].toLowerCase();
      Matcher mat = pat.matcher(lcArg);
      if (mat.matches()) {
        char test = args[i].charAt(1);
        try {
          switch (test) {
            case 'o':
              jobId = args[++i];
              break;
            case 's':
              sampleId = args[++i];
              break;
            case 'm':
              submitter = args[++i];
              break;
            case 'y':
              analysisType = args[++i];
              break;
            case 'w':
              webRootForLinks = new File(args[++i]);
              break;
            case 'e':
              snpEffGenome = args[++i];
              break;
            case 'i':
              minimumReadDepth = args[++i];
              break;
            case 't':
              threads = args[++i];
              break;
            case 'l':
              uploadVarsToNGSWeb = true;
              break;
            case 'j':
              pJar = new File(args[++i]);
              break;
            case 'p':
              truncPipePropFile = new File(args[++i]);
              break;
            case 'q':
              bedForCoverageQC = new File(args[++i]);
              break;
            case 'b':
              bedForVarCalling = new File(args[++i]);
              break;
            case 'r':
              fastaReference = new File(args[++i]);
              break;
            case 'u':
              unfilteredBam = new File(args[++i]);
              break;
            case 'f':
              finalBam = new File(args[++i]);
              break;
            case 'v':
              finalVcf = new File(args[++i]);
              break;
            case 'd':
              outputDirectory = new File(args[++i]);
              break;
            case 'c':
              referenceDir = new File(args[++i]);
              break;
            case 'h':
              printDocs();
              System.exit(0);
            default:
              Misc.printErrAndExit("\nProblem, unknown option! " + mat.group());
          }
        } catch (Exception e) {
          Misc.printErrAndExit(
              "\nSorry, something doesn't look right with this parameter: -" + test + "\n");
        }
      }
    }

    // check output dir and if needed set sampleId
    if (outputDirectory != null) {
      outputDirectory.mkdirs();
      if (sampleId.length() == 0) sampleId = outputDirectory.getName();
    }
    // check root directory if needed
    if (webRootForLinks != null) {
      if (webRootForLinks.exists() == false) webRootForLinks.mkdirs();
      // links dir?
      File links = new File(webRootForLinks, "links");
      if (links.exists() == false) links.mkdirs();
    }

    // look for required fields and files
    checkPrintFields();
    checkPrintFiles();
    checkForGzippedVcf();
  }