def sample(self,wig=None,resolution=100):
        """Doing sampling"""
        
        try:
            chroms=wig.get_chroms()
        except __HOLE__:
            raise Exception("Argument 'wig' must be given")
        
        coordinates={}
        for chrom in chroms:
            try:
                standardchrom=self.standard_chroms[chrom]
            except KeyError:
                standardchrom=chrom
            wigcoord=wig[chrom][0]
            coordinates[standardchrom]=[]
            for wc in wigcoord:
                coordinate=(int(round(1.0*wc/resolution)))*resolution+1
                
                if not coordinates[standardchrom] or coordinate!=coordinates[standardchrom][-1]: 
                    coordinates[standardchrom].append(coordinate)
        
        return coordinates
dataset/ETHPy150Open taoliu/taolib/Assoc/sampler.py/GenomeSampler.sample