'Determines whether the file is in axt format
axt alignment files are produced from Blastz, an alignment tool available from Webb Miller\'s lab
at Penn State University.
Each alignment block in an axt file contains three lines: a summary line and 2 sequence lines.
Blocks are separated from one another by blank lines.
The summary line contains chromosomal position and size information about the alignment. It
consists of 9 required fields.
The sequence lines contain the sequence of the primary assembly (line 2) and aligning assembly
(line 3) with inserts.  Repeats are indicated by lower-case letters.
For complete details see http://genome.ucsc.edu/goldenPath/help/axt.html
>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname( \'alignment.axt\' )
>>> Axt().sniff( fname )
True
>>> fname = get_test_fname( \'alignment.lav\' )
>>> Axt().sniff( fname )
False'

def sniff(self, filename):

    headers = get_headers(filename, None)
    if (len(headers) < 4):
        return False
    for hdr in headers:
        if ((len(hdr) > 0) and hdr[0].startswith('##matrix=axt')):
            return True
        if ((len(hdr) > 0) and (not hdr[0].startswith('#'))):
            if (len(hdr) != 9):
                return False
            try:
                map(int, [hdr[0], hdr[2], hdr[3], hdr[5], hdr[6], hdr[8]])
            except:
                return False
            if (hdr[7] not in data.valid_strand):
                return False
            else:
                return True
