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}_alignment_metrics.txt"
    args = [
        "--INPUT",
        inputs.bam.output.bam.path,
        "--OUTPUT",
        metrics_file,
        "--REFERENCE_SEQUENCE",
        inputs.genome.output.fasta.path,
        "--VALIDATION_STRINGENCY",
        inputs.validation_stringency,
        "--MAX_INSERT_SIZE",
        inputs.insert_size,
        "--ASSUME_SORTED",
        inputs.assume_sorted,
        "--EXPECTED_PAIR_ORIENTATIONS",
        inputs.pair_orientation,
        "--IS_BISULFITE_SEQUENCED",
        inputs.bisulfite,
        "--TMP_DIR",
        TMPDIR,
    ]
    if inputs.adapters:
        adapters_list = self.get_sequences(inputs.adapters.output.fasta.path)
        args.extend(["--ADAPTER_SEQUENCE", [adapters_list]])
    else:
        # Clear the default adapter list implemented in Picard.
        args.extend(["--ADAPTER_SEQUENCE", "null"])
    return_code, _, _ = Cmd["gatk"]["CollectAlignmentSummaryMetrics"][args] & TEE(
        retcode=None
    )
    if return_code:
        self.error("CollectAlignmentSummaryMetrics tool failed.")
    outputs.report = metrics_file
    outputs.species = inputs.bam.output.species
    outputs.build = inputs.bam.output.build