def __getitem__(self,key):
        """Emulate __getitem__ method"""
        
        try:
            return self.wig[key]
        except TypeError:
            raise Exception('Empty wig')
        except __HOLE__:
            chroms=self.wig.keys()
            return_wig={}
            for chrom in chroms:
                if key=='coordinate':
                    return_wig[chrom]=self.wig[chrom][0]
                elif key=='value':
                    return_wig[chrom]=self.wig[chrom][1]
                else:
                    raise KeyError,key
            return return_wig
dataset/ETHPy150Open taoliu/taolib/Assoc/inout.py/Wig.__getitem__