'Determines whether the file is in gff format
GFF lines have nine required fields that must be tab-separated.
For complete details see http://genome.ucsc.edu/FAQ/FAQformat#format3
>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname( \'gff_version_3.gff\' )
>>> Gff().sniff( fname )
False
>>> fname = get_test_fname( \'test.gff\' )
>>> Gff().sniff( fname )
True'

def sniff(self, filename):

    if (len(get_headers(filename, ' DCTB ', count=2)) < 2):
        return False
    try:
        headers = iter_headers(filename, ' DCTB ')
        for hdr in headers:
            if (hdr and hdr[0].startswith('##gff-version') and (hdr[0].find('2') < 0)):
                return False
            if (hdr and hdr[0] and (not hdr[0].startswith('#'))):
                if (len(hdr) != 9):
                    return False
                try:
                    int(hdr[3])
                    int(hdr[4])
                except:
                    return False
                if (hdr[5] != '.'):
                    try:
                        float(hdr[5])
                    except:
                        return False
                if (hdr[6] not in data.valid_strand):
                    return False
                if (hdr[7] not in self.valid_gff_frame):
                    return False
        return True
    except:
        return False
