@T.timeit<EOL><INDENT>def aa_db_search(self, files, base, unpack, search_method,<EOL>maximum_range, threads, evalue, min_orf_length,<EOL>restrict_read_length, diamond_database):<DEDENT>
<EOL>if search_method == '<STR_LIT>':<EOL><INDENT>output_search_file = files.hmmsearch_output_path(base)<EOL><DEDENT>elif search_method == '<STR_LIT>':<EOL><INDENT>output_search_file = files.diamond_search_output_basename(base)<EOL><DEDENT>hit_reads_fasta = files.fa_output_path(base)<EOL>hit_reads_orfs_fasta = files.orf_fasta_output_path(base)<EOL>return self.search_and_extract_orfs_matching_protein_database(unpack,<EOL>search_method,<EOL>maximum_range,<EOL>threads,<EOL>evalue,<EOL>min_orf_length,<EOL>restrict_read_length,<EOL>diamond_database,<EOL>output_search_file,<EOL>hit_reads_fasta,<EOL>hit_reads_orfs_fasta)<EOL>
Amino acid database search pipeline - pipeline where reads are searched
as amino acids, and hits are identified using hmmsearch or diamond
searches

Parameters
----------
files : obj
    graftm_output_paths object.
base : str
    The name of the input file, stripped of all suffixes, and paths.
    Used for creating file names with 'files' object.
unpack : obj
    UnpackRawReads object, returns string command that will output
    sequences to stdout when called on command line
    (use: unpack.command_line())
search_method : str
    The method for searching, either 'hmmsearch' or 'diamond'
maximum_range : int
    Maximum range that a gene can extend within a contig. Any hits
    that extend beyond this length cannot be linked. max_range is defined
    as 1.5 X the average length of all full length genes used in the
    search database. This is defined in the CONTENTS.json file within a
    gpkg.
threads : int
    Number of threads for hmmer to use
evalue : str
    evalue cutoff for hmmer to use
min_orf_length : int
    minimum orf length for orfm to use
restrict_read_length : int
    orf length to retrict orfm to.
diamond_database : str
    Path to diamond database to use when searching. Set to 'None' if not
    using diamond pipeline
Returns
-------
String path to amino acid fasta file of reads that hit