def chrom_length(self,chrom):
        """Return a very simply calculated chromosome legnth of this wig file.
        
        Simple chromosome length=the last wig point - the first wig point
        
        If there are only one or even zero point in the chromosome, just returns 0"""

        try:
            if len(self.wig[chrom][0])==0 or len(self.wig[chrom][0])==1:
                return 0
            else:
                return self.wig[chrom][0][-1]-self.wig[chrom][0][0]
        except KeyError:
            return 0
dataset/ETHPy150Open taoliu/taolib/Assoc/inout.py/Wig.chrom_length/original