def iterator_filtered(gff_iterator, feature=None,
                      source=None, contig=None,
                      interval=None, strand=None):
    if interval:
        start, end = interval
    if strand == ".":
        strand = None

    for gff in gff_iterator:
        if feature and gff.feature != feature:
            continue
        if source and gff.source != source:
            continue
        if contig and gff.contig != contig:
            continue
        if strand and gff.strand != strand:
            continue
        if interval and min(end, gff.end) - max(start, gff.start) < 0:
            continue
        yield gff
iterate over the contents of a gff file.
dataset/ETHPy150Open CGATOxford/cgat/CGAT/GTF.py/iterator_filtered