def get_exon_intron_lens(self, chrom=''):
        """Return exon and introns lengths from a given GeneTable.
    
        Parameters:
        1. chrom: chromosome to investigate. If not given, do about all the chromosomes.
        """
    
        # if exonStarts and exonEnds are not in the GeneTable, just return empty lists
        if 'exonStarts' not in self.columns or 'exonEnds' not in self.columns:
            return [],[]
    
        if chrom =='': 
            elengths=[]
            ilengths=[]
            for chrom in self.get_chroms():
                for es,ee in itertools.izip(self[chrom]['exonStarts'], self[chrom]['exonEnds']):
                    elengths.extend(array_adder(ee,map(lambda x: -1*x, es))[0])
                    ilengths.extend(array_adder(es[1:],map(lambda x: -1*x,ee[:-1]))[0])
        else:
            # if the given chromosome is not in the GeneTable, just return empty lists.
            if chrom not in self.get_chroms(): 
                return [],[]
            elengths=[]
            ilengths=[]
            for es,ee in itertools.izip(self[chrom]['exonStarts'], self[chrom]['exonEnds']):
                elengths.extend(array_adder(ee,map(lambda x: -1*x, es))[0])
                ilengths.extend(array_adder(es[1:],map(lambda x: -1*x,ee[:-1]))[0])
            
        elengths.sort()
        ilengths.sort()
        
        return elengths, ilengths
dataset/ETHPy150Open taoliu/taolib/Assoc/inout.py/GeneTable.get_exon_intron_lens/original