X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=wiki%2FRubyExamples.wiki;h=7e49fce59afad4a065a222eda84505495aedac65;hb=1f9eafcd1707bc0e05e16ddc1c3389d69a085e35;hp=c6dcb886d6b83ab4417529026b6a83aa62a6ba93;hpb=1c30c3b5ecf6d82d6c8695cd8031e2fbc4751187;p=jalview.git diff --git a/wiki/RubyExamples.wiki b/wiki/RubyExamples.wiki index c6dcb88..7e49fce 100644 --- a/wiki/RubyExamples.wiki +++ b/wiki/RubyExamples.wiki @@ -1,10 +1,8 @@ #summary Ruby examples += Ruby Examples = - -= Introduction = - -Various Ruby examples +Various simple Ruby examples. Author: [http://www.cmzmasek.net/ Christian M Zmasek], Sanford-Burnham Medical Research Institute @@ -14,12 +12,14 @@ Copyright (C) 2011 Christian M Zmasek. All rights reserved. = Using net/ftp to download all Proteomes from the Ensembl Database = +This, or something like it, can be used to download from Ensembl all "pep.all.fa.gz" files. + {{{ require 'net/ftp' EMAIL = 'myemail' PUB_RELEASE_DIR = '/pub/release-64/fasta' -PEP_DIR = '/pep' +PEP_DIR = '/pep' ftp = Net::FTP.new('ftp.ensembl.org', 'anonymous', EMAIL) ftp.passive = true # To avoid "No route to host" error. @@ -33,7 +33,8 @@ files.each do | file | pepfiles = ftp.list() pepfiles.each do | pepfile | pepfile = pepfile.split().last - if pepfile =~ /all.fa./ + if pepfile =~ /all.fa.gz/ # Only want the "all.fa.gz" files (and not the + # "abinitio" files). ftp.getbinaryfile(pepfile) puts 'downloaded "' + pepfile + '"' count += 1