'Determines wether the file is in wiggle format
The .wig format is line-oriented. Wiggle data is preceeded by a track definition line,
which adds a number of options for controlling the default display of this track.
Following the track definition line is the track data, which can be entered in several
different formats.
The track definition line begins with the word \'track\' followed by the track type.
The track type with version is REQUIRED, and it currently must be wiggle_0.  For example,
track type=wiggle_0...
For complete details see http://genome.ucsc.edu/goldenPath/help/wiggle.html
>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname( \'interval1.bed\' )
>>> Wiggle().sniff( fname )
False
>>> fname = get_test_fname( \'wiggle.wig\' )
>>> Wiggle().sniff( fname )
True'

def sniff(self, filename):

    try:
        headers = iter_headers(filename, None)
        for hdr in headers:
            if ((len(hdr) > 1) and (hdr[0] == 'track') and hdr[1].startswith('type=wiggle')):
                return True
        return False
    except:
        return False
