'Checks for \'pileup-ness\'
There are two main types of pileup: 6-column and 10-column. For both,
the first three and last two columns are the same. We only check the
first three to allow for some personalization of the format.
>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname( \'interval.interval\' )
>>> Pileup().sniff( fname )
False
>>> fname = get_test_fname( \'6col.pileup\' )
>>> Pileup().sniff( fname )
True
>>> fname = get_test_fname( \'10col.pileup\' )
>>> Pileup().sniff( fname )
True'

def sniff(self, filename):

    headers = iter_headers(filename, ' DCTB ')
    try:
        for hdr in headers:
            if (hdr and (not hdr[0].startswith('#'))):
                if (len(hdr) < 5):
                    return False
                try:
                    chrom = int(hdr[1])
                    assert (chrom >= 0)
                    assert (hdr[2] in ['A', 'C', 'G', 'T', 'N', 'a', 'c', 'g', 't', 'n'])
                except:
                    return False
        return True
    except:
        return False
