'Determines whether the file is a otu (operational taxonomic unit)
Shared format
label<TAB>group<TAB>count[<TAB>value(1..n)]
The first line is column headings as of Mothur v 1.2
>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname( \'mothur_datatypetest_true.mothur.shared\' )
>>> GroupAbund().sniff( fname )
True
>>> fname = get_test_fname( \'mothur_datatypetest_false.mothur.shared\' )
>>> GroupAbund().sniff( fname )
False'

def sniff(self, filename, vals_are_int=False):

    headers = iter_headers(filename, sep=' DCTB ')
    count = 0
    for line in headers:
        if (not line[0].startswith('@')):
            if (len(line) < 3):
                return False
            if ((count > 0) or (line[0] != 'label')):
                try:
                    check = int(line[2])
                    if ((check + 3) != len(line)):
                        return False
                    for i in range(3, len(line)):
                        if vals_are_int:
                            int(line[i])
                        else:
                            float(line[i])
                except ValueError:
                    return False
            count += 1
    if (count > 1):
        return True
    return False
