Ejemplo n.º 1
0
  /**
   * Gets the appropriately formatted header for a VCF file describing this GATK run
   *
   * @param engine the GATK engine that holds the walker name, GATK version, and other information
   * @param argumentSources contains information on the argument values provided to the GATK for
   *     converting to a command line string. Should be provided from the data in the parsing
   *     engine. Can be empty in which case the command line will be the empty string.
   * @return VCF header line describing this run of the GATK.
   */
  public static VCFHeaderLine getCommandLineArgumentHeaderLine(
      final GenomeAnalysisEngine engine, final Collection<Object> argumentSources) {
    if (engine == null) throw new IllegalArgumentException("engine cannot be null");
    if (argumentSources == null)
      throw new IllegalArgumentException("argumentSources cannot be null");

    final Map<String, String> attributes = new LinkedHashMap<>();
    attributes.put("ID", engine.getWalkerName());
    attributes.put("Version", CommandLineGATK.getVersionNumber());
    final Date date = new Date();
    attributes.put("Date", date.toString());
    attributes.put("Epoch", Long.toString(date.getTime()));
    attributes.put(
        "CommandLineOptions",
        engine.createApproximateCommandLineArgumentString(argumentSources.toArray()));
    return new VCFSimpleHeaderLine(GATK_COMMAND_LINE_KEY, attributes);
  }