def length(self,chrom=''):
        """Return the length of the wig file (similar to line number)"""
        
        if chrom:    
            try:
                return len(self.wig[chrom][0])
            except __HOLE__:
                return 0
        
        length=0
        for chrom in self.get_chroms():
            length+=len(self.wig[chrom][0])
            
        return length
dataset/ETHPy150Open taoliu/taolib/Assoc/inout.py/Wig.length