@staticmethod<EOL><INDENT>def compile(output_package_path, refpkg_path, hmm_path, diamond_database_file, max_range, <EOL>trusted_cutoff=False, search_hmm_files=None):<DEDENT>
if os.path.exists(output_package_path):<EOL><INDENT>raise Exception("<STR_LIT>" % output_package_path)<EOL><DEDENT>os.mkdir(output_package_path)<EOL>hmm_file_in_gpkg = os.path.basename(hmm_path)<EOL>shutil.copyfile(hmm_path, os.path.join(output_package_path, hmm_file_in_gpkg))<EOL>if diamond_database_file:<EOL><INDENT>diamond_database_file_in_gpkg = os.path.basename(diamond_database_file)<EOL>shutil.copyfile(diamond_database_file, os.path.join(output_package_path, diamond_database_file_in_gpkg))<EOL><DEDENT>refpkg_in_gpkg = os.path.basename(refpkg_path)<EOL>shutil.copytree(refpkg_path, os.path.join(output_package_path, refpkg_in_gpkg))<EOL>if search_hmm_files:<EOL><INDENT>search_hmm_files_in_gpkg_names =[os.path.basename(path) for path in search_hmm_files]<EOL>if hmm_file_in_gpkg in search_hmm_files_in_gpkg_names:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>if len(set(search_hmm_files_in_gpkg_names)) != len(search_hmm_files_in_gpkg_names):<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>for i, search_hmm in enumerate(search_hmm_files):<EOL><INDENT>shutil.copyfile(search_hmm, os.path.join(output_package_path, search_hmm_files_in_gpkg_names[i]))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>search_hmm_files_in_gpkg_names = [hmm_file_in_gpkg]<EOL><DEDENT>contents = {GraftMPackage.VERSION_KEY: GraftMPackageVersion2.version,<EOL>GraftMPackage.ALIGNMENT_HMM_KEY: hmm_file_in_gpkg,<EOL>GraftMPackage.SEARCH_HMM_KEY: search_hmm_files_in_gpkg_names,<EOL>GraftMPackage.REFERENCE_PACKAGE_KEY: refpkg_in_gpkg,<EOL>GraftMPackage.HMM_TRUSTED_CUTOFF_KEY: trusted_cutoff,<EOL>GraftMPackage.RANGE_KEY: max_range}<EOL>if diamond_database_file:<EOL><INDENT>contents[GraftMPackage.DIAMOND_DATABASE_KEY] = diamond_database_file_in_gpkg<EOL><DEDENT>json.dump(contents, open(os.path.join(output_package_path, GraftMPackage._CONTENTS_FILE_NAME), '<STR_LIT:w>'))<EOL>
Create a new GraftM package with the given inputs. Any files
        specified as parameters are copied into the final package so can
        be removed after calling this function.

        Parameters
        ----------
        output_package_path: str
            path to the package being created (must not exist)
        refpkg_path: str
            path to pplacer reference package
        hmm_path: str
            path to the align HMM. Used as the search HMM if search_hmm_files
            is None
        diamond_database_file: str
            path to diamond DB file, or None for nucleotide packages
        max_rage: str
            as per maximum_range()
        trusted_cutoff: boolean
            set TC in search HMM

        search_hmm_files: list of str or None
            use these HMMs for search instead of the hmm_path. All
            basenames of these paths must be unique, and not the same as
            hmm_path.

        Returns
        -------
        Nothing