def filterGenes(genes, gtf, strand, orientation='sense', singlefeats=False):
    """ filters genes on whether they are sense or anti-sense to a feature """
    filteredgenes = list()
    for gene in genes:
        if gene in gtf.genes:
            if orientation == 'sense':
                if gtf.strand(gene) == strand:
                    filteredgenes.append(gene)
            elif gtf.strand(gene) != strand:
                filteredgenes.append(gene)
            if singlefeats and len(filteredgenes) > 1:
                filteredgenes = list()
    return filteredgenes
