X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=wiki%2FRubyExamples.wiki;h=3d501995a8d88358fc5ea2f01799b6bc95758bc8;hb=44268696695fe4454ddbd06791c4067f219b75fe;hp=f653629510713ff9de0d31d6cbab62c768eb08ca;hpb=3f2baabae128a88580c3ea98b27083f8126ab5ee;p=jalview.git diff --git a/wiki/RubyExamples.wiki b/wiki/RubyExamples.wiki index f653629..3d50199 100644 --- a/wiki/RubyExamples.wiki +++ b/wiki/RubyExamples.wiki @@ -1,25 +1,25 @@ #summary Ruby examples += Ruby Examples = +Various simple Ruby examples. -= Introduction = - -Various Ruby examples - -Author: [http://www.cmzmasek.net/ Christian M Zmasek], Sanford-Burnham Medical Research Institute +Author: [https://sites.google.com/site/cmzmasek/ Christian Zmasek], Sanford-Burnham Medical Research Institute Copyright (C) 2011 Christian M Zmasek. All rights reserved. -= Multiple Sequence Alignment = += 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 = 'czmasek@burnham.org' +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 @@ -46,4 +47,4 @@ files.each do | file | end ftp.close puts 'done (downloaded ' + count.to_s + ' files)' -}}} +}}} \ No newline at end of file