Class CommandLineProgram

    • Field Detail

      • MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH

        public static int MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH
        CommandLineProgramProperties oneLineSummary attribute must be shorted than this in order to maintain reasonable help output formatting.
      • TMP_DIR

        @Argument(doc="One or more directories with space available to be used by this program for temporary storage of working files",
                  common=true,
                  optional=true)
        public List<File> TMP_DIR
      • VERBOSITY

        @Argument(doc="Control verbosity of logging.",
                  common=true)
        public htsjdk.samtools.util.Log.LogLevel VERBOSITY
      • QUIET

        @Argument(doc="Whether to suppress job-summary info on System.err.",
                  common=true)
        public Boolean QUIET
      • VALIDATION_STRINGENCY

        @Argument(doc="Validation stringency for all SAM files read by this program.  Setting stringency to SILENT can improve performance when processing a BAM file in which variable-length data (read, qualities, tags) do not otherwise need to be decoded.",
                  common=true)
        public htsjdk.samtools.ValidationStringency VALIDATION_STRINGENCY
      • COMPRESSION_LEVEL

        @Argument(doc="Compression level for all compressed files created (e.g. BAM and VCF).",
                  common=true)
        public int COMPRESSION_LEVEL
      • MAX_RECORDS_IN_RAM

        @Argument(doc="When writing files that need to be sorted, this will specify the number of records stored in RAM before spilling to disk. Increasing this number reduces the number of file handles needed to sort the file, and increases the amount of RAM needed.",
                  optional=true,
                  common=true)
        public Integer MAX_RECORDS_IN_RAM
      • CREATE_INDEX

        @Argument(doc="Whether to create an index when writing VCF or coordinate sorted BAM output.",
                  common=true)
        public Boolean CREATE_INDEX
      • CREATE_MD5_FILE

        @Argument(doc="Whether to create an MD5 digest for any BAM or FASTQ files created.  ",
                  common=true)
        public boolean CREATE_MD5_FILE
      • REFERENCE_SEQUENCE

        protected File REFERENCE_SEQUENCE
      • GA4GH_CLIENT_SECRETS

        @Argument(doc="Google Genomics API client_secrets.json file path.",
                  common=true)
        public String GA4GH_CLIENT_SECRETS
      • specialArgumentsCollection

        @ArgumentCollection(doc="Special Arguments that have meaning to the argument parsing system.  It is unlikely these will ever need to be accessed by the command line program")
        public Object specialArgumentsCollection
      • USE_JDK_DEFLATER

        @Argument(shortName="use_jdk_deflater",
                  doc="Use the JDK Deflater instead of the Intel Deflater for writing compressed output",
                  common=true)
        public Boolean USE_JDK_DEFLATER
      • USE_JDK_INFLATER

        @Argument(shortName="use_jdk_inflater",
                  doc="Use the JDK Inflater instead of the Intel Inflater for reading compressed input",
                  common=true)
        public Boolean USE_JDK_INFLATER
    • Constructor Detail

      • CommandLineProgram

        public CommandLineProgram()
    • Method Detail

      • doWork

        protected abstract int doWork()
        Do the work after command line has been parsed. RuntimeException may be thrown by this method, and are reported appropriately.
        Returns:
        program exit status.
      • requiresReference

        protected boolean requiresReference()
      • instanceMainWithExit

        public void instanceMainWithExit​(String[] argv)
      • instanceMain

        public int instanceMain​(String[] argv)
      • customCommandLineValidation

        protected String[] customCommandLineValidation()
        Put any custom command-line validation in an override of this method. clp is initialized at this point and can be used to print usage and access argv. Any options set by command-line parser can be validated.
        Returns:
        null if command line is valid. If command line is invalid, returns an array of error message to be written to the appropriate place.
      • parseArgs

        protected boolean parseArgs​(String[] argv)
        Returns:
        true if command line is valid
      • getMetricsFile

        protected <A extends htsjdk.samtools.metrics.MetricBase,​B extends Comparable<?>> htsjdk.samtools.metrics.MetricsFile<A,​B> getMetricsFile()
        Gets a MetricsFile with default headers already written into it.
      • getStandardUsagePreamble

        public String getStandardUsagePreamble()
      • getCommandLineParserForArgs

        public org.broadinstitute.barclay.argparser.CommandLineParser getCommandLineParserForArgs​(String[] argv)
      • getCommandLineParser

        public org.broadinstitute.barclay.argparser.CommandLineParser getCommandLineParser()
        Returns:
        Return the command line parser to be used.
      • useLegacyParser

        public static boolean useLegacyParser()
        Return true if the legacy Picard command line parser should be used in place of the Barclay command line parser, otherwise, false. The legacy parser is enabled by opt-in only, via the presence of a (true-valued) boolean property "picard.useLegacyParser", either as a System property.
        Returns:
        true if the legacy parser should be used
      • getVersion

        public String getVersion()
        Returns:
        Version stored in the manifest of the jarfile.
      • getCommandLine

        public String getCommandLine()
      • setDefaultHeaders

        public void setDefaultHeaders​(List<htsjdk.samtools.metrics.Header> headers)
      • getPGRecord

        public htsjdk.samtools.SAMProgramRecord getPGRecord​(htsjdk.samtools.SAMFileHeader header)
      • getDefaultHeaders

        public List<htsjdk.samtools.metrics.Header> getDefaultHeaders()
      • getStandardUsagePreamble

        public static String getStandardUsagePreamble​(Class<?> mainClass)
        A typical command line program will call this to get the beginning of the usage message, and then typically append a description of the program, like this: public String USAGE = getStandardUsagePreamble(getClass()) + "Frobnicate the freebozle."
      • hasWebDocumentation

        public static boolean hasWebDocumentation​(Class<?> clazz)
        Determine if a class has web documentation based on its package name
        Parameters:
        clazz -
        Returns:
        true if the class has web documentation
      • getFaqLink

        public static String getFaqLink()
        Returns:
        the link to a FAQ