def _count(self, filename, idx):

        overlapping_genes = set()
        genes = set()
        # iterate over exons
        infile = IOTools.openFile(filename, "r")
        it = GTF.iterator(infile)

        for this in it:
            genes.add(this.gene_id)

            try:
                intervals = idx[this.contig].find(this.start, this.end)
            except __HOLE__:
                continue

            if len(intervals) == 0:
                continue
	
            overlapping_genes.add(this.gene_id)

        infile.close()

        return genes, overlapping_genes
dataset/ETHPy150Open CGATOxford/cgat/scripts/diff_gtf.py/CounterGenes._count