for sp in self.species:
            sc = self.scientific_names[sp].lower()
            spdir = 'pub/release-%d/gtf/%s' %(latest,sc)
            data = []
            #ftp.dir(spdir,data.append)
            cs_url = 'ftp://' + '/'.join([server,spdir,'CHECKSUMS'])
            print cs_url
            checksum = None
            with closing(urllib2.urlopen(cs_url)) as uh:
                checksum = uh.read()
            print sp,checksum; sys.stdout.flush()

def post(self):
        server = 'ftp.ensembl.org'
        #go_dir = 'pub/current_gtf'
        go_dir = 'pub'
        user = 'anonymous'

        # get directory listnig
        ftp = ftplib.FTP(server)
        ftp.login(user)

        data = []
        #ftp.cwd(go_dir)
        ftp.dir(go_dir, data.append)
        #ftp.quit()

        # find everything that ends in release-xx
        pat = re.compile(r'.* release-(\d+)$')
        release_numbers = []
        for d in data:
            m = pat.match(d)
            if m is not None:
                release_numbers.append(m.group(1))

        release_numbers = np.int64(release_numbers)
        latest = np.amax(release_numbers)

        """
        for sp in self.species:
            sc = self.scientific_names[sp].lower()
            spdir = 'pub/release-%d/gtf/%s' %(latest,sc)
            data = []
            #ftp.dir(spdir,data.append)
            cs_url = 'ftp://' + '/'.join([server,spdir,'CHECKSUMS'])
            print cs_url
            checksum = None
            with closing(urllib2.urlopen(cs_url)) as uh:
                checksum = uh.read()
            print sp,checksum; sys.stdout.flush()
        """
        for spec in self.species:

            spec_name = self.species_names[spec]

            # find the precise name of the GTF file that we're interested in
            spdir = 'pub/release-%d/gtf/%s' %(latest,spec.lower())
            data = []
            ftp.dir(spdir,data.append)
            gtf_file = []
            for d in data:
                i = d.rindex(' ')
                fn = d[(i+1):]
                if fn.endswith('.%d.gtf.gz' %(latest)):
                    gtf_file.append(fn)
            assert len(gtf_file) == 1
            gtf_file = gtf_file[0]
            #self.logger.debug(gtf_file)

            # download the CHECKSUMS file and create a mapping of file names to checksums
            data = []
            cs_path = '/'.join([spdir,'CHECKSUMS'])
            data = []
            ftp.retrbinary('RETR %s' %(cs_path),data.append)
            data = ''.join(data).split('\n')[:-1]
            checksums = {}
            for d in data:
                s,fn = d.split('\t')
                checksums[fn] = s

            # compare checksums to see if we need to download the file
            output_file = self.data_dir + os.sep + gtf_file
            if self.test_checksums(output_file,checksums[gtf_file]):
                logger.debug('Checksums agree!')
            else:
                logger.debug('Downloading %s...', output_file)
                gtf_path = '/'.join([spdir,gtf_file])
                with open(output_file,'w') as ofh:
                    ftp.retrbinary('RETR %s' %(gtf_path),ofh.write)

                logger.debug('done!')
                if not self.test_checksums(output_file,checksums[gtf_file]):
                    logger.debug('ERROR: Checksums don''t agree! Deleting downloaded file...')
                    if os.path.isfile(output_file): # race condition?
                        os.remove(output_file)
            
        # update gene annotations
        self.data['gene_annotations'] = GeneAnnotationData.find_gene_annotations(self.data_dir)