def search_and_extract_nucleotides_matching_nucleotide_database(self,<EOL>unpack,<EOL>euk_check,<EOL>search_method,<EOL>maximum_range,<EOL>threads,<EOL>evalue,<EOL>hmmsearch_output_table,<EOL>hit_reads_fasta):
if search_method == "<STR_LIT>":<EOL><INDENT>search_result, table_list = self.nhmmer(<EOL>hmmsearch_output_table,<EOL>unpack,<EOL>threads,<EOL>evalue<EOL>)<EOL><DEDENT>elif search_method == '<STR_LIT>':<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>if maximum_range:  <EOL><INDENT>hits = self._get_read_names(<EOL>search_result,  <EOL>maximum_range<EOL>)<EOL><DEDENT>else:   <EOL><INDENT>hits = self._get_sequence_directions(search_result)<EOL><DEDENT>hit_readnames = hits.keys()<EOL>if euk_check:<EOL><INDENT>euk_reads = self._check_euk_contamination(table_list)<EOL>hit_readnames = set([read for read in hit_readnames if read not in euk_reads])<EOL>hits = {key:item for key, item in  hits.iteritems() if key in hit_readnames}<EOL>hit_read_count = [len(euk_reads), len(hit_readnames)]<EOL><DEDENT>else:<EOL><INDENT>hit_read_count = [<NUM_LIT:0>, len(hit_readnames)]<EOL><DEDENT>hit_reads_fasta, direction_information = self._extract_from_raw_reads(<EOL>hit_reads_fasta,<EOL>hit_readnames,<EOL>unpack.read_file,<EOL>unpack.format(),<EOL>hits<EOL>)<EOL>if not hit_readnames:<EOL><INDENT>result = DBSearchResult(None,<EOL>search_result,<EOL>hit_read_count,<EOL>None)<EOL><DEDENT>else:<EOL><INDENT>slash_endings=self._check_for_slash_endings(hit_readnames)<EOL>result = DBSearchResult(hit_reads_fasta,<EOL>search_result,<EOL>hit_read_count,<EOL>slash_endings)<EOL><DEDENT>if maximum_range:<EOL><INDENT>n_hits = sum([len(x["<STR_LIT>"]) for x in hits.values()])<EOL><DEDENT>else:<EOL><INDENT>n_hits = len(hits)<EOL><DEDENT>logging.info("<STR_LIT>" % n_hits)<EOL>return result, direction_information<EOL>
As per nt_db_search() except slightly lower level. Search an
        input read set (unpack) and then extract the sequences that hit.

        Parameters
        ----------
        hmmsearch_output_table: str
            path to hmmsearch output table
        hit_reads_fasta: str
            path to hit nucleotide sequences

        Returns
        -------
        direction_information: dict

            {read_1: False
             ...
             read n: True}

            where True = Forward direction
            and False = Reverse direction

        result: DBSearchResult object containing file locations and hit 
        information