Raises error if invalid B6/M8 format detected

    Args:
        entries (list): A list of B6Entry instances

        line (int): Line number of first entry

    Raises:
        FormatError: Error when B6/M8 format incorrect with descriptive message

    Example:
        >>> from bio_utils.iterators import b6_iter
        >>> import os
        >>> entries = 'query1\tsubject1\t86.03\t1782\t226\t18\t6038\t7812\t' \
        ...           '755762\t753997\t0.0\t1890{0}' \
        ...           'query2\tsubject2\t85.46\t1176\t165\t5\t1213\t2385\t' \
        ...           '1154754\t1153582\t0.0\t1219'.format(os.linesep)
        >>> b6_entries = b6_iter(iter(entries.split(os.linesep)))
        >>> b6_verifier(b6_entries)

def b6_verifier(entries, line=None):
    """Raises error if invalid B6/M8 format detected

    Args:
        entries (list): A list of B6Entry instances

        line (int): Line number of first entry

    Raises:
        FormatError: Error when B6/M8 format incorrect with descriptive message

    Example:
        >>> from bio_utils.iterators import b6_iter
        >>> import os
        >>> entries = 'query1\tsubject1\t86.03\t1782\t226\t18\t6038\t7812\t' \
        ...           '755762\t753997\t0.0\t1890{0}' \
        ...           'query2\tsubject2\t85.46\t1176\t165\t5\t1213\t2385\t' \
        ...           '1154754\t1153582\t0.0\t1219'.format(os.linesep)
        >>> b6_entries = b6_iter(iter(entries.split(os.linesep)))
        >>> b6_verifier(b6_entries)
    """

    regex = r'^.+\t.+\t\d+\.?\d*\t\d+\t\d+\t\d+\t\d+\t\d+\t\d+\t\d+\t' \
            + r'\d+\.?\d*(e-)?\d*\t\d+\.?\d*{0}$'.format(os.linesep)
    delimiter = r'\t'

    for entry in entries:
        try:
            entry_verifier([entry.write()], regex, delimiter)
        except FormatError as error:
            # Format info on what entry error came from
            if line:
                intro = 'Line {0}'.format(str(line))
            elif error.part == 0:
                intro = 'Entry with subject ID {0}'.format(entry.subject)
            else:
                intro = 'Entry with query ID {0}'.format(entry.query)

            # Generate error
            if error.part == 0:
                msg = '{0} has no query ID'.format(intro)
            elif error.part == 1:
                msg = '{0} has no subject ID'.format(intro)
            elif error.part == 2:
                msg = '{0} has non-numerical ' \
                      'characters in percent identity'.format(intro)
            elif error.part == 3:
                msg = '{0} has non-numerical ' \
                      'characters in alignment length'.format(intro)
            elif error.part == 4:
                msg = '{0} has non-numerical ' \
                      'characters in mismatches'.format(intro)
            elif error.part == 5:
                msg = '{0} has non-numerical ' \
                      'characters in gaps'.format(intro)
            elif error.part == 6:
                msg = '{0} has non-numerical ' \
                      'characters in query start'.format(intro)
            elif error.part == 7:
                msg = '{0} has non-numerical ' \
                      'characters in query end'.format(intro)
            elif error.part == 8:
                msg = '{0} has non-numerical ' \
                      'characters in subject start'.format(intro)
            elif error.part == 9:
                msg = '{0} has non-numerical ' \
                      'characters in subject end'.format(intro)
            elif error.part == 10:
                msg = '{0} has non-numerical ' \
                      'characters in E-value'.format(intro)
            elif error.part == 11:
                msg = '{0} has non-numerical ' \
                      'characters in bit score'.format(intro)
            else:
                msg = '{0}: Unknown Error: Likely a Bug'.format(intro)
            raise FormatError(message=msg)

        if line:
            line += 1