def METHOD_NAME(self, inputs, outputs):
    """Run analysis."""
    database_folder = "database"
    sample_map_file = "sample_map.txt"
    species = inputs.gvcfs[0].output.species
    if any(gvcf.output.species != species for gvcf in inputs.gvcfs):
        self.error("Not all of the input samples are of the same species.")
    build = inputs.gvcfs[0].output.build
    if any(gvcf.output.build != build for gvcf in inputs.gvcfs):
        self.error("Not all of the input samples have the same genome build.")
    with open(sample_map_file, "w") as sample_map:
        for gvcf in inputs.gvcfs:
            sample_map.write(f"{gvcf.entity_name}\t{gvcf.output.vcf.path}\n")
    if inputs.use_existing and inputs.existing_db is None:
        self.error(
            "GATK GenomicsDB object has to be provided to add GVCFs to the existing "
            "database."
        )
    elif inputs.use_existing and inputs.existing_db:
        if species != inputs.existing_db.output.species:
            self.error("The existing database and GVCFs species differ.")
        if build != inputs.existing_db.output.build:
            self.error("The existing database and GVCFs build differ.")
        shutil.copytree(inputs.existing_db.output.database.path, database_folder)
        db_import_args = [
            "--genomicsdb-update-workspace-path",
            database_folder,
        ]
        intervals = Path(inputs.existing_db.output.intervals.path)
    elif inputs.intervals:
        db_import_args = [
            "--genomicsdb-workspace-path",
            database_folder,
            "-L",
            inputs.intervals.output.bed.path,
        ]
        intervals = Path(inputs.intervals.output.bed.path)
    else:
        self.error("Intervals file is required for creating a new database.")
    java_memory = min(
        int(self.requirements.resources.memory / 1024),
        inputs.advanced_options.max_heap_size,
    )
    java_options = f"-Xmx{java_memory}g"
    if inputs.advanced_options.use_cms_gc:
        java_options += " -XX:+UseConcMarkSweepGC"
    db_import_args.extend(
        [
            "--sample-name-map",
            sample_map_file,
            "--batch-size",
            inputs.advanced_options.batch_size,
            "--reader-threads",
            min(self.requirements.resources.cores, 5),
            "--verbosity",
            "DEBUG",
            "--tmp-dir",
            os.environ.get("TMPDIR"),
            "--java-options",
            java_options,
        ]
    )
    if inputs.advanced_options.consolidate:
        db_import_args.append("--consolidate")
    return_code, stdout, stderr = Cmd["gatk"]["GenomicsDBImport"][
        db_import_args
    ] & TEE(retcode=None)
    if return_code:
        print(stdout, stderr)
        self.error("GATK GenomicsDBImport tool failed.")
    output_bed = f"./{intervals.name}"
    Path(output_bed).symlink_to(str(intervals))
    outputs.intervals = output_bed
    outputs.database = database_folder
    outputs.species = species
    outputs.build = build