7 Author: [http://www.cmzmasek.net/ Christian M Zmasek], Sanford-Burnham Medical Research Institute
10 Copyright (C) 2011 Christian M Zmasek. All rights reserved.
13 = Using net/ftp to download all Proteomes from the Ensembl Database =
19 PUB_RELEASE_DIR = '/pub/release-64/fasta'
22 ftp = Net::FTP.new('ftp.ensembl.org', 'anonymous', EMAIL)
23 ftp.passive = true # To avoid "No route to host" error.
24 ftp.chdir( PUB_RELEASE_DIR )
25 files = ftp.list('*_*') # To only look at files with an underscore.
27 files.each do | file |
28 species = file.split().last
30 ftp.chdir(species + PEP_DIR)
32 pepfiles.each do | pepfile |
33 pepfile = pepfile.split().last
34 if pepfile =~ /all.fa./
35 ftp.getbinaryfile(pepfile)
36 puts 'downloaded "' + pepfile + '"'
41 puts 'ignoring "' + species + '"'
43 ftp.chdir(PUB_RELEASE_DIR) # To go back to the starting directory.
46 puts 'done (downloaded ' + count.to_s + ' files)'