def METHOD_NAME(self, inputs, outputs):
    """Run the analysis."""
    if inputs.alignment.entity_name != inputs.peaks.entity_name:
        self.error(
            "Sample names of aligned reads and called peaks do not "
            f" match. Alignment has {inputs.alignment.entity_name}, "
            f"while called peaks have {inputs.peaks.entity_name}."
        )
    basename = Path(inputs.alignment.output.bam.path).name
    assert basename.endswith(".bam")
    name = basename[:-4]
    report_folder = f"{name}_ChIPQCreport"
    if inputs.peaks.type == "data:chipseq:callpeak:macs14:":
        peaks_basename = Path(inputs.peaks.output.peaks_bed.path).name
        assert peaks_basename.endswith(".bed.gz")
        peaks_name = peaks_basename[:-7]
        peaks_file = f"{peaks_name}.bed"
        (Cmd["pigz"]["-cd", inputs.peaks.output.peaks_bed.path] > peaks_file)()
    elif inputs.peaks.type == "data:chipseq:callpeak:macs2:":
        peaks_file = inputs.peaks.output.called_peaks.path
    if inputs.alignment.output.build != inputs.peaks.output.build:
        self.error(
            "All input files must share the same build. "
            f"Aligment is based on {inputs.alignment.output.build} while "
            f"called peaks are based on {inputs.peaks.output.build}."
        )
    build = inputs.alignment.output.build
    genome_list = ["hg19", "hg38", "hg18", "mm10", "mm9", "rn4", "ce6", "dm3"]
    annotation = "NULL"
    if inputs.calculate_enrichment:
        if build in genome_list:
            annotation = f'"{build}"'
        else:
            self.warning(
                f"Annotation for {build} is not supported. "
                f'Supported builds are: {", ".join(genome_list)}.'
            )
    if inputs.blacklist:
        blacklist = f'"{inputs.blacklist.output.bed.path}"'
    else:
        blacklist = "NULL"
    r_input = (
        'library("ChIPQC"); '
        "sample <- ChIPQCsample("
        f'"{inputs.alignment.output.bam.path}",'
        f'peaks="{peaks_file}",'
        f"annotation={annotation},"
        f"mapQCth={inputs.advanced.quality_threshold},"
        f"blacklist={blacklist},"
        f"profileWin={inputs.advanced.profile_window},"
        f"shifts={inputs.advanced.shift_size});"
        "ChIPQCreport("
        "sample,"
        f'reportName="{name}_ChIPQC",'
        f'reportFolder="{report_folder}")'
    )
    return_code, _, _ = Cmd["Rscript"]["-e"][r_input] & TEE(retcode=None)
    if return_code:
        self.error("Error while running ChIPQC.")
    plots = Path(report_folder).glob("*.png")
    for plot_path in plots:
        copyfile(plot_path, f"{plot_path.stem}_mqc.png")
    outputs.ccplot = "CCPlot_mqc.png"
    outputs.coverage_histogram = "CoverageHistogramPlot_mqc.png"
    outputs.peak_profile = "PeakProfile_mqc.png"
    outputs.peaks_barplot = "Rip_mqc.png"
    outputs.peaks_density_plot = "Rap_mqc.png"
    outputs.report_folder = report_folder
    outputs.species = inputs.alignment.output.species
    outputs.build = build
    if Path("GenomicFeatureEnrichment_mqc.png").is_file():
        outputs.enrichment_heatmap = "GenomicFeatureEnrichment_mqc.png"