Class CollectSamErrorMetrics


  • public class CollectSamErrorMetrics
    extends CommandLineProgram
    Program to collect error metrics on bases stratified in various ways.
    • Field Detail

      • INPUT

        @Argument(shortName="I",
                  doc="Input SAM or BAM file.")
        public File INPUT
      • OUTPUT

        @Argument(shortName="O",
                  doc="Base name for output files. Actual file names will be generated from the basename and suffixes from the ERROR and STRATIFIER by adding a \'.\' and then error_by_stratifier[_and_stratifier]* where \'error\' is ERROR\'s extension, and \'stratifier\' is STRATIFIER\'s suffix. For example, an ERROR_METRIC of ERROR:BASE_QUALITY:GC_CONTENT will produce an extension \'.error_by_base_quality_and_gc\'. The suffixes can be found in the documentation for ERROR_VALUE and SUFFIX_VALUE.")
        public File OUTPUT
      • ERROR_METRICS

        @Argument(doc="Errors to collect in the form of \"ERROR(:STRATIFIER)*\". To see the values available for ERROR and STRATIFIER look at the documentation for the arguments ERROR_VALUE and STRATIFIER_VALUE.")
        public List<String> ERROR_METRICS
      • ERROR_VALUE

        @Argument(doc="A fake argument used to show the options of ERROR (in ERROR_METRICS).",
                  optional=true)
        public picard.sam.SamErrorMetric.ErrorType ERROR_VALUE
      • STRATIFIER_VALUE

        @Argument(doc="A fake argument used to show the options of STRATIFIER (in ERROR_METRICS).",
                  optional=true)
        public picard.sam.SamErrorMetric.ReadBaseStratification.Stratifier STRATIFIER_VALUE
      • VCF

        @Argument(shortName="V",
                  doc="VCF of known variation for sample. program will skip over polymorphic sites in this VCF and avoid collecting data on these loci.")
        public File VCF
      • INTERVALS

        @Argument(shortName="L",
                  doc="Region(s) to limit analysis to. Supported formats are VCF or interval_list. Will intersect inputs if multiple are given. ",
                  optional=true)
        public List<File> INTERVALS
      • MIN_MAPPING_Q

        @Argument(shortName="MQ",
                  doc="Minimum mapping quality to include read.")
        public int MIN_MAPPING_Q
      • MIN_BASE_Q

        @Argument(shortName="BQ",
                  doc="Minimum base quality to include base.")
        public int MIN_BASE_Q
      • PRIOR_Q

        @Argument(shortName="PE",
                  doc="The prior error, in phred-scale (used for calculating empirical error rates).",
                  optional=true)
        public int PRIOR_Q
      • MAX_LOCI

        @Argument(shortName="MAX",
                  doc="Maximum number of loci to process (or unlimited if 0).",
                  optional=true)
        public long MAX_LOCI
      • LONG_HOMOPOLYMER

        @Argument(shortName="LH",
                  doc="Shortest homopolymer which is considered long.  Used by the BINNED_HOMOPOLYMER stratifier.",
                  optional=true)
        public int LONG_HOMOPOLYMER
      • PROBABILITY

        @Argument(shortName="P",
                  doc="The probability of selecting a locus for analysis (for downsampling).",
                  optional=true)
        public double PROBABILITY
    • Constructor Detail

      • CollectSamErrorMetrics

        public CollectSamErrorMetrics()
    • Method Detail

      • customCommandLineValidation

        protected String[] customCommandLineValidation()
        Description copied from class: CommandLineProgram
        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.
        Overrides:
        customCommandLineValidation in class CommandLineProgram
        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.
      • doWork

        protected int doWork()
        Description copied from class: CommandLineProgram
        Do the work after command line has been parsed. RuntimeException may be thrown by this method, and are reported appropriately.
        Specified by:
        doWork in class CommandLineProgram
        Returns:
        program exit status.
      • CompareVariantContextToLocus

        public static int CompareVariantContextToLocus​(htsjdk.samtools.SAMSequenceDictionary dictionary,
                                                       htsjdk.variant.variantcontext.VariantContext variantContext,
                                                       htsjdk.samtools.util.Locus locus)
        Compares a VariantContext to a Locus providing information regarding possible overlap, or relative location
        Parameters:
        dictionary - The SAMSequenceDictionary to use for ordering the sequences
        variantContext - the VariantContext to compare
        locus - the Locus to compare
        Returns:
        negative if variantContext comes before locus (with no overlap) zero if variantContext and locus overlap positive if variantContext comes after locus (with no overlap)

        if variantContext and locus are in the same contig the return value will be the number of bases apart they are, otherwise it will be MIN_INT/MAX_INT

      • parseDirective

        protected static BaseErrorAggregation parseDirective​(String stratifierDirective)
        Parses a "Directive" of the form "ERROR,STRATIFIER,STRATIFIER...etc." into a BaseErrorAggregation consisting of the appropriate BaseCalculator and the CollectionStratifier constructed from the various individual stratifiers. The conversion from string to object is performed by the enums Errors and Stratifier.
        Parameters:
        stratifierDirective - The string directive describing the error type and collection of stratifiers to use
        Returns:
        The appropriate BaseErrorAggregation.