Method: Ensembl::FTP.ftp_name_for

Defined in:
lib/rbbt/sources/ensembl_ftp.rb

.ftp_name_for(organism) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rbbt/sources/ensembl_ftp.rb', line 16

def self.ftp_name_for(organism)
  code, build = organism.split "/"
  build ||= "current"

  if build.to_s == "current"
    release = 'current'
    name = Organism.scientific_name(organism)
    ftp = Net::FTP.new(Ensembl::FTP::SERVER)
    ftp.passive = true
    ftp.
    ftp.chdir(File.join('pub', 'current_mysql'))
    file = ftp.list(name.downcase.gsub(" ",'_') + "_core_*").collect{|l| l.split(" ").last}.last
    ftp.close
  else
    release = Ensembl.releases[build]
    name = Organism.scientific_name(organism)
    ftp = Net::FTP.new(Ensembl::FTP::SERVER)
    ftp.passive = true
    ftp.
    ftp.chdir(File.join('pub', release, 'mysql'))
    file = ftp.list(name.downcase.gsub(" ",'_') + "_core_*").collect{|l| l.split(" ").last}.last
    ftp.close
  end
  [release, file]
end