This checks to see if a sequence already exists in the reference data. If it does, then it'll return the known annotation.

        :return: The Annotation of associated with the input sequence
        :rtype: :ref:`ann`

        Example:

            >>> from Bio.Seq import Seq
            >>> from seqann.models.reference_data import ReferenceData
            >>> sequence = Seq('AGAGACTCTCCCGAGGATTTCGTGTACCAGTTTAAGGCCATGTGCTACTTCACC')
            >>> refdata = ReferenceData()
            >>> matched_annotation = refdata.search_refdata(sequence, locus)

def search_refdata(self, seq, locus):
        """
        This checks to see if a sequence already exists in the reference data. If it does, then it'll return the known annotation.

        :return: The Annotation of associated with the input sequence
        :rtype: :ref:`ann`

        Example:

            >>> from Bio.Seq import Seq
            >>> from seqann.models.reference_data import ReferenceData
            >>> sequence = Seq('AGAGACTCTCCCGAGGATTTCGTGTACCAGTTTAAGGCCATGTGCTACTTCACC')
            >>> refdata = ReferenceData()
            >>> matched_annotation = refdata.search_refdata(sequence, locus)

        """
        # TODO: ONLY MAKE ONE CONNECTION
        # TODO: add try statement
        # TODO: take password from environment variable
        if self.server_avail:
            hla, loc = locus.split('-')
            p1 = "SELECT ent.name "
            p2 = "FROM bioentry ent,biosequence seq,biodatabase dbb "
            p3 = "WHERE dbb.biodatabase_id = ent.biodatabase_id AND seq.bioentry_id = ent.bioentry_id "
            p4 = " AND dbb.name = \"" + self.dbversion + "_" + loc + "\""
            p5 = " AND seq.seq = \"" + str(seq.seq) + "\""
            select_stm = p1 + p2 + p3 + p4 + p5

            # TODO: add try statement
            conn = pymysql.connect(host=biosqlhost, port=biosqlport,
                                   user=biosqluser, passwd=biosqlpass,
                                   db=biosqldb)
            cur = conn.cursor()
            cur.execute(select_stm)

            typ = ''
            for row in cur:
                typ = row[0]

            cur.close()
            conn.close()

            if typ:
                if self.verbose:
                    self.logger.info("Exact typing found in BioSQL database")
                seqrecord = self.seqrecord(typ, loc)
                return self.seqannotation(seqrecord, typ, loc)
            else:
                return
        else:
            if str(seq.seq) in self.seqref:
                if self.verbose:
                    self.logger.info("Exact typing found in dat file")
                seqrec = self.hlaref[self.seqref[str(seq.seq)]]
                return self.seqannotation(seqrec,
                                          self.seqref[str(seq.seq)],
                                          locus)
            else:
                return