git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
domain + go output work begins
[jalview.git]
/
wiki
/
RubyExamples.wiki
diff --git
a/wiki/RubyExamples.wiki
b/wiki/RubyExamples.wiki
index
75d648b
..
3d50199
100644
(file)
--- a/
wiki/RubyExamples.wiki
+++ b/
wiki/RubyExamples.wiki
@@
-1,10
+1,10
@@
#summary Ruby examples
#summary Ruby examples
-= Introduction =
+= Ruby Examples =
-Various Ruby examples.
+Various simple 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.
Copyright (C) 2011 Christian M Zmasek. All rights reserved.
@@
-12,12
+12,14
@@
Copyright (C) 2011 Christian M Zmasek. All rights reserved.
= Using net/ftp to download all Proteomes from the Ensembl Database =
= 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'
{{{
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.
ftp = Net::FTP.new('ftp.ensembl.org', 'anonymous', EMAIL)
ftp.passive = true # To avoid "No route to host" error.
@@
-31,7
+33,8
@@
files.each do | file |
pepfiles = ftp.list()
pepfiles.each do | pepfile |
pepfile = pepfile.split().last
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
ftp.getbinaryfile(pepfile)
puts 'downloaded "' + pepfile + '"'
count += 1