'Determines whether the file is an axes format
The first line may have column headings.
The following lines have the name in the first column plus float columns for each axis.
==> 98_sq_phylip_amazon.fn.unique.pca.axes <==
group   axis1   axis2
forest  0.000000        0.145743
pasture 0.145743        0.000000
==> 98_sq_phylip_amazon.nmds.axes <==
axis1   axis2
U68589  0.262608        -0.077498
U68590  0.027118        0.195197
U68591  0.329854        0.014395
>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname( \'mothur_datatypetest_true.mothur.axes\' )
>>> Axes().sniff( fname )
True
>>> fname = get_test_fname( \'mothur_datatypetest_false.mothur.axes\' )
>>> Axes().sniff( fname )
False'

def sniff(self, filename):

    headers = iter_headers(filename, sep=' DCTB ')
    count = 0
    col_cnt = None
    all_integers = True
    for line in headers:
        if (count != 0):
            if (col_cnt is None):
                col_cnt = len(line)
                if (col_cnt < 2):
                    return False
            else:
                if (len(line) != col_cnt):
                    return False
                try:
                    for i in range(1, col_cnt):
                        check = float(line[i])
                        if (abs(check) > 1.0):
                            return False
                        try:
                            check = int(line[i])
                        except ValueError:
                            all_integers = False
                except ValueError:
                    return False
        count += 1
    if (count > 0):
        return (not all_integers)
    return False
