'>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname( \'sequence.fasta\' )
>>> QualityScore454().sniff( fname )
False
>>> fname = get_test_fname( \'sequence.qual454\' )
>>> QualityScore454().sniff( fname )
True'

def sniff(self, filename):

    try:
        fh = open(filename)
        while True:
            line = fh.readline()
            if (not line):
                break
            line = line.strip()
            if (line and (not line.startswith('#'))):
                if line.startswith('>'):
                    line = fh.readline().strip()
                    if ((line == '') or line.startswith('>')):
                        break
                    try:
                        [int(x) for x in line.split()]
                    except:
                        break
                    return True
                else:
                    break
        fh.close()
    except:
        pass
    return False
