def alignment_iterator(alignment_file):
    # replaced .readlines()
    for line in alignment_file:
        data = line[:-1].split("\t")
        ref = data[1].split("|")
        if len(ref) == 1:
            # set ref to reference and leave gi as None
            gi, ref = None, ref[0]
        else:
            gi, ref = ref[1], ref[3]
        read, ngaps, length, evalue, nmismatches, identity, score = data[0], data[5], data[3], data[10], data[4], data[2], data[11]
        yield Diamond().read(read,
                             gi,
                             ref,
                             ngaps,
                             length,
                             evalue,
                             nmismatches,
                             identity,
                             score)

#######################################################
#######################################################
#######################################################
return an alignment
dataset/ETHPy150Open CGATOxford/cgat/CGAT/Diamond.py/alignment_iterator