bin/reference_data.py
def download_data(self):
        """
        Download reference and variation file from Ensembl and decompress if necessary.
        """
        self.info('Downloading reference genome')
        base_dir = '%s/fasta/%s' % (self.ensembl_base_url, self.ftp_species)

        ls = self.ftp.nlst(base_dir)
        if os.path.join(base_dir, 'dna_index') in ls:
            ls = self.ftp.nlst(os.path.join(base_dir, 'dna_index'))
        else:
            ls = self.ftp.nlst(os.path.join(base_dir, 'dna'))

        files_to_download = [f for f in ls if 'dna.toplevel' in f]
        self.info('Reference genome: found %i files, downloading %i', len(ls), len(files_to_download))
        for f in files_to_download:
            self.download_file(f)

        # TODO: Add support multiple chromosome files if toplevel does not exist
        fa_gz = util.find_file(self.abs_data_dir, '*dna.toplevel.fa.gz')
        if not fa_gz:
            raise DownloadError('No fasta file found')

        subprocess.check_call(['gzip', '-d', fa_gz])
        self.reference_fasta = util.find_file(self.abs_data_dir, '*dna.toplevel.fa')

        ls = self.ftp.nlst(self.variation_url(self.ensembl_base_url))
        files_to_download = [f for f in ls if '%s.vcf.gz' % self.ftp_species in f.lower()]
        if not files_to_download:
            i = input('%i files found. Enter a basename for a single VCF to use, or nothing to continue without '
                      'variants. ' % len(ls))
            if i:
                files_to_download = [f for f in ls if i in f]  # this should include the index file

        self.info('Variation: found %i files, downloading %i', len(ls), len(files_to_download))
        for f in files_to_download:
            self.download_file(f)

        self.reference_variation = util.find_file(self.abs_data_dir, '*.vcf.gz') or input(
            'Could not identify a vcf.gz file to use - enter one here. ')

        Download reference and variation file from Ensembl and decompress if necessary.
        
Download reference and variation file from Ensembl and decompress if necessary.
Download reference and variation file from Ensembl and decompress if necessary .
def download_data(self):
        self.info('Downloading reference genome')
        base_dir = '%s/fasta/%s' % (self.ensembl_base_url, self.ftp_species)
        ls = self.ftp.nlst(base_dir)
        if os.path.join(base_dir, 'dna_index') in ls:
            ls = self.ftp.nlst(os.path.join(base_dir, 'dna_index'))
        else:
            ls = self.ftp.nlst(os.path.join(base_dir, 'dna'))
        files_to_download = [f for f in ls if 'dna.toplevel' in f]
        self.info('Reference genome: found %i files, downloading %i', len(ls), len(files_to_download))
        for f in files_to_download:
            self.download_file(f)
        fa_gz = util.find_file(self.abs_data_dir, '*dna.toplevel.fa.gz')
        if not fa_gz:
            raise DownloadError('No fasta file found')
        subprocess.check_call(['gzip', '-d', fa_gz])
        self.reference_fasta = util.find_file(self.abs_data_dir, '*dna.toplevel.fa')
        ls = self.ftp.nlst(self.variation_url(self.ensembl_base_url))
        files_to_download = [f for f in ls if '%s.vcf.gz' % self.ftp_species in f.lower()]
        if not files_to_download:
            i = input('%i files found. Enter a basename for a single VCF to use, or nothing to continue without '
                      'variants. ' % len(ls))
            if i:
                files_to_download = [f for f in ls if i in f]  
        self.info('Variation: found %i files, downloading %i', len(ls), len(files_to_download))
        for f in files_to_download:
            self.download_file(f)
        self.reference_variation = util.find_file(self.abs_data_dir, '*.vcf.gz') or input(
            'Could not identify a vcf.gz file to use - enter one here. ')
def download_data ( self ) : self . info ( 'Downloading reference genome' ) base_dir = '%s/fasta/%s' % ( self . ensembl_base_url , self . ftp_species ) ls = self . ftp . nlst ( base_dir ) if os . path . join ( base_dir , 'dna_index' ) in ls : ls = self . ftp . nlst ( os . path . join ( base_dir , 'dna_index' ) ) else : ls = self . ftp . nlst ( os . path . join ( base_dir , 'dna' ) ) files_to_download = [ f for f in ls if 'dna.toplevel' in f ] self . info ( 'Reference genome: found %i files, downloading %i' , len ( ls ) , len ( files_to_download ) ) for f in files_to_download : self . download_file ( f ) fa_gz = util . find_file ( self . abs_data_dir , '*dna.toplevel.fa.gz' ) if not fa_gz : raise DownloadError ( 'No fasta file found' ) subprocess . check_call ( [ 'gzip' , '-d' , fa_gz ] ) self . reference_fasta = util . find_file ( self . abs_data_dir , '*dna.toplevel.fa' ) ls = self . ftp . nlst ( self . variation_url ( self . ensembl_base_url ) ) files_to_download = [ f for f in ls if '%s.vcf.gz' % self . ftp_species in f . lower ( ) ] if not files_to_download : i = input ( '%i files found. Enter a basename for a single VCF to use, or nothing to continue without ' 'variants. ' % len ( ls ) ) if i : files_to_download = [ f for f in ls if i in f ] self . info ( 'Variation: found %i files, downloading %i' , len ( ls ) , len ( files_to_download ) ) for f in files_to_download : self . download_file ( f ) self . reference_variation = util . find_file ( self . abs_data_dir , '*.vcf.gz' ) or input ( 'Could not identify a vcf.gz file to use - enter one here. ' )
Download reference and variation file from Ensembl and decompress if necessary.
Download reference and variation file from Ensembl and decompress if necessary .
"""
        Download reference and variation file from Ensembl and decompress if necessary.
        """ # TODO: Add support multiple chromosome files if toplevel does not exist # this should include the index file
self