def METHOD_NAME(self, inputs, outputs):
    """Run analysis."""
    TMPDIR = os.environ.get("TMPDIR")
    basename = os.path.basename(inputs.bam.output.bam.path)
    assert basename.endswith(".bam")
    name = basename[:-4]
    metrics_file = f"{name}_wgs_metrics.txt"
    args = [
        "--INPUT",
        inputs.bam.output.bam.path,
        "--OUTPUT",
        metrics_file,
        "--REFERENCE_SEQUENCE",
        inputs.genome.output.fasta.path,
        "--READ_LENGTH",
        inputs.read_length,
        "--INCLUDE_BQ_HISTOGRAM",
        inputs.create_histogram,
        "--MINIMUM_MAPPING_QUALITY",
        inputs.options.min_map_quality,
        "--MINIMUM_BASE_QUALITY",
        inputs.options.min_quality,
        "--COVERAGE_CAP",
        inputs.options.coverage_cap,
        "--LOCUS_ACCUMULATION_CAP",
        inputs.options.accumulation_cap,
        "--COUNT_UNPAIRED",
        inputs.options.count_unpaired,
        "--SAMPLE_SIZE",
        inputs.options.sample_size,
        "--VALIDATION_STRINGENCY",
        inputs.options.validation_stringency,
        "--TMP_DIR",
        TMPDIR,
    ]
    return_code, _, _ = Cmd["gatk"]["CollectWgsMetrics"][args] & TEE(retcode=None)
    if return_code:
        self.error("CollectWgsMetrics tool failed.")
    replace_metrics_class(metrics_file)
    outputs.report = metrics_file
    outputs.species = inputs.bam.output.species
    outputs.build = inputs.bam.output.build