def readfile(self,filepath=''):
        """Read a table from a file
        
        Parameters:
        1. filepath: the path to a file to read
    
        """
        
        #open a file
        fn=os.path.join(filepath,self.get_name()+'.xls')
        try:
            f=open(fn,'r')
        except __HOLE__:
            raise Exception('No table, %s exists in %s' %(self.get_name(),filepath))
        
        # reset the current table
        if not self.isempty(): 
            warnings.warn("Resetting the current table, %s") %(self.get_name())
            self.table={}
         
        chrom=''
        for line in f.xreadlines():
            # obtaining the parameters
            line=line.strip()
            if line=='' or line[0]=="#": continue
                
            # get chromosomes
            elements=self.parse_line(line)
            newchrom=elements[0]
            # when new chromosome is met
            if chrom!=newchrom:
                chrom=newchrom
                self.init_table(chrom)
            self.add_row(chrom,elements[1:])
        
        f.close()
dataset/ETHPy150Open taoliu/taolib/Assoc/tables.py/Table.readfile