bio 0.7.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/bioruby +71 -27
- data/bin/br_biofetch.rb +5 -17
- data/bin/br_bioflat.rb +14 -26
- data/bin/br_biogetseq.rb +6 -18
- data/bin/br_pmfetch.rb +6 -16
- data/doc/Changes-0.7.rd +35 -0
- data/doc/KEGG_API.rd +287 -172
- data/doc/KEGG_API.rd.ja +273 -160
- data/doc/Tutorial.rd +18 -9
- data/doc/Tutorial.rd.ja +656 -138
- data/lib/bio.rb +6 -24
- data/lib/bio/alignment.rb +5 -5
- data/lib/bio/appl/blast.rb +132 -98
- data/lib/bio/appl/blast/format0.rb +9 -19
- data/lib/bio/appl/blast/wublast.rb +5 -18
- data/lib/bio/appl/emboss.rb +40 -47
- data/lib/bio/appl/hmmer.rb +116 -82
- data/lib/bio/appl/hmmer/report.rb +509 -364
- data/lib/bio/appl/spidey/report.rb +7 -18
- data/lib/bio/data/na.rb +3 -21
- data/lib/bio/db.rb +3 -21
- data/lib/bio/db/aaindex.rb +147 -52
- data/lib/bio/db/embl/common.rb +27 -6
- data/lib/bio/db/embl/embl.rb +18 -10
- data/lib/bio/db/embl/sptr.rb +87 -67
- data/lib/bio/db/embl/swissprot.rb +32 -3
- data/lib/bio/db/embl/trembl.rb +32 -3
- data/lib/bio/db/embl/uniprot.rb +32 -3
- data/lib/bio/db/fasta.rb +327 -289
- data/lib/bio/db/medline.rb +25 -4
- data/lib/bio/db/nbrf.rb +12 -20
- data/lib/bio/db/pdb.rb +4 -1
- data/lib/bio/db/pdb/chemicalcomponent.rb +240 -0
- data/lib/bio/db/pdb/pdb.rb +13 -8
- data/lib/bio/db/rebase.rb +93 -97
- data/lib/bio/feature.rb +2 -31
- data/lib/bio/io/ddbjxml.rb +167 -139
- data/lib/bio/io/fastacmd.rb +89 -56
- data/lib/bio/io/flatfile.rb +994 -278
- data/lib/bio/io/flatfile/index.rb +257 -194
- data/lib/bio/io/flatfile/indexer.rb +37 -29
- data/lib/bio/reference.rb +147 -64
- data/lib/bio/sequence.rb +57 -417
- data/lib/bio/sequence/aa.rb +64 -0
- data/lib/bio/sequence/common.rb +175 -0
- data/lib/bio/sequence/compat.rb +68 -0
- data/lib/bio/sequence/format.rb +134 -0
- data/lib/bio/sequence/generic.rb +24 -0
- data/lib/bio/sequence/na.rb +189 -0
- data/lib/bio/shell.rb +9 -23
- data/lib/bio/shell/core.rb +130 -125
- data/lib/bio/shell/demo.rb +143 -0
- data/lib/bio/shell/{session.rb → interface.rb} +42 -40
- data/lib/bio/shell/object.rb +52 -0
- data/lib/bio/shell/plugin/codon.rb +4 -22
- data/lib/bio/shell/plugin/emboss.rb +23 -0
- data/lib/bio/shell/plugin/entry.rb +34 -25
- data/lib/bio/shell/plugin/flatfile.rb +5 -23
- data/lib/bio/shell/plugin/keggapi.rb +11 -24
- data/lib/bio/shell/plugin/midi.rb +5 -23
- data/lib/bio/shell/plugin/obda.rb +4 -22
- data/lib/bio/shell/plugin/seq.rb +6 -24
- data/lib/bio/shell/rails/Rakefile +10 -0
- data/lib/bio/shell/rails/app/controllers/application.rb +4 -0
- data/lib/bio/shell/rails/app/controllers/shell_controller.rb +94 -0
- data/lib/bio/shell/rails/app/helpers/application_helper.rb +3 -0
- data/lib/bio/shell/rails/app/models/shell_connection.rb +30 -0
- data/lib/bio/shell/rails/app/views/layouts/shell.rhtml +37 -0
- data/lib/bio/shell/rails/app/views/shell/history.rhtml +5 -0
- data/lib/bio/shell/rails/app/views/shell/index.rhtml +2 -0
- data/lib/bio/shell/rails/app/views/shell/show.rhtml +13 -0
- data/lib/bio/shell/rails/config/boot.rb +19 -0
- data/lib/bio/shell/rails/config/database.yml +85 -0
- data/lib/bio/shell/rails/config/environment.rb +53 -0
- data/lib/bio/shell/rails/config/environments/development.rb +19 -0
- data/lib/bio/shell/rails/config/environments/production.rb +19 -0
- data/lib/bio/shell/rails/config/environments/test.rb +19 -0
- data/lib/bio/shell/rails/config/routes.rb +19 -0
- data/lib/bio/shell/rails/doc/README_FOR_APP +2 -0
- data/lib/bio/shell/rails/public/404.html +8 -0
- data/lib/bio/shell/rails/public/500.html +8 -0
- data/lib/bio/shell/rails/public/dispatch.cgi +10 -0
- data/lib/bio/shell/rails/public/dispatch.fcgi +24 -0
- data/lib/bio/shell/rails/public/dispatch.rb +10 -0
- data/lib/bio/shell/rails/public/favicon.ico +0 -0
- data/lib/bio/shell/rails/public/images/icon.png +0 -0
- data/lib/bio/shell/rails/public/images/rails.png +0 -0
- data/lib/bio/shell/rails/public/index.html +277 -0
- data/lib/bio/shell/rails/public/javascripts/controls.js +750 -0
- data/lib/bio/shell/rails/public/javascripts/dragdrop.js +584 -0
- data/lib/bio/shell/rails/public/javascripts/effects.js +854 -0
- data/lib/bio/shell/rails/public/javascripts/prototype.js +1785 -0
- data/lib/bio/shell/rails/public/robots.txt +1 -0
- data/lib/bio/shell/rails/public/stylesheets/main.css +187 -0
- data/lib/bio/shell/rails/script/about +3 -0
- data/lib/bio/shell/rails/script/breakpointer +3 -0
- data/lib/bio/shell/rails/script/console +3 -0
- data/lib/bio/shell/rails/script/destroy +3 -0
- data/lib/bio/shell/rails/script/generate +3 -0
- data/lib/bio/shell/rails/script/performance/benchmarker +3 -0
- data/lib/bio/shell/rails/script/performance/profiler +3 -0
- data/lib/bio/shell/rails/script/plugin +3 -0
- data/lib/bio/shell/rails/script/process/reaper +3 -0
- data/lib/bio/shell/rails/script/process/spawner +3 -0
- data/lib/bio/shell/rails/script/process/spinner +3 -0
- data/lib/bio/shell/rails/script/runner +3 -0
- data/lib/bio/shell/rails/script/server +42 -0
- data/lib/bio/shell/rails/test/test_helper.rb +28 -0
- data/lib/bio/shell/web.rb +90 -0
- data/lib/bio/util/contingency_table.rb +231 -225
- data/sample/any2fasta.rb +59 -0
- data/test/data/HMMER/hmmpfam.out +64 -0
- data/test/data/HMMER/hmmsearch.out +88 -0
- data/test/data/aaindex/DAYM780301 +30 -0
- data/test/data/aaindex/PRAM900102 +20 -0
- data/test/data/bl2seq/cd8a_cd8b_blastp.bl2seq +53 -0
- data/test/data/bl2seq/cd8a_p53_e-5blastp.bl2seq +37 -0
- data/test/data/blast/{eco:b0002.faa → b0002.faa} +0 -0
- data/test/data/blast/{eco:b0002.faa.m0 → b0002.faa.m0} +2 -2
- data/test/data/blast/{eco:b0002.faa.m7 → b0002.faa.m7} +1 -1
- data/test/data/blast/{eco:b0002.faa.m8 → b0002.faa.m8} +0 -0
- data/test/unit/bio/appl/bl2seq/test_report.rb +134 -0
- data/test/unit/bio/appl/blast/test_report.rb +15 -12
- data/test/unit/bio/appl/blast/test_xmlparser.rb +4 -4
- data/test/unit/bio/appl/hmmer/test_report.rb +355 -0
- data/test/unit/bio/appl/test_blast.rb +5 -5
- data/test/unit/bio/data/test_na.rb +9 -18
- data/test/unit/bio/db/pdb/test_pdb.rb +169 -0
- data/test/unit/bio/db/test_aaindex.rb +197 -0
- data/test/unit/bio/io/test_fastacmd.rb +55 -0
- data/test/unit/bio/sequence/test_aa.rb +102 -0
- data/test/unit/bio/sequence/test_common.rb +178 -0
- data/test/unit/bio/sequence/test_compat.rb +82 -0
- data/test/unit/bio/sequence/test_na.rb +242 -0
- data/test/unit/bio/shell/plugin/test_seq.rb +29 -19
- data/test/unit/bio/test_alignment.rb +15 -7
- data/test/unit/bio/test_reference.rb +198 -0
- data/test/unit/bio/test_sequence.rb +4 -49
- data/test/unit/bio/test_shell.rb +2 -2
- metadata +118 -15
- data/lib/bio/io/brdb.rb +0 -103
- data/lib/bioruby.rb +0 -34
data/bin/bioruby
CHANGED
|
@@ -2,32 +2,12 @@
|
|
|
2
2
|
#
|
|
3
3
|
# = BioRuby shell - command line interface for the BioRuby library
|
|
4
4
|
#
|
|
5
|
-
# Copyright::
|
|
6
|
-
#
|
|
7
|
-
# License::
|
|
5
|
+
# Copyright:: Copyright (C) 2005, 2006
|
|
6
|
+
# Toshiaki Katayama <k@bioruby.org>
|
|
7
|
+
# License:: Ruby's
|
|
8
8
|
#
|
|
9
|
-
# $Id: bioruby,v 1.
|
|
9
|
+
# $Id: bioruby,v 1.15 2006/02/27 09:41:54 k Exp $
|
|
10
10
|
#
|
|
11
|
-
#--
|
|
12
|
-
#
|
|
13
|
-
# This library is free software; you can redistribute it and/or
|
|
14
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
15
|
-
# License as published by the Free Software Foundation; either
|
|
16
|
-
# version 2 of the License, or (at your option) any later version.
|
|
17
|
-
#
|
|
18
|
-
# This library is distributed in the hope that it will be useful,
|
|
19
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
21
|
-
# Lesser General Public License for more details.
|
|
22
|
-
#
|
|
23
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
24
|
-
# License along with this library; if not, write to the Free Software
|
|
25
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
26
|
-
#
|
|
27
|
-
#++
|
|
28
|
-
#
|
|
29
|
-
|
|
30
|
-
# $: << File.dirname(__FILE__)+'/../lib'
|
|
31
11
|
|
|
32
12
|
begin
|
|
33
13
|
require 'rubygems'
|
|
@@ -35,13 +15,41 @@ begin
|
|
|
35
15
|
rescue LoadError
|
|
36
16
|
end
|
|
37
17
|
|
|
18
|
+
|
|
19
|
+
### BioRuby shell setup
|
|
20
|
+
|
|
38
21
|
require 'bio/shell'
|
|
39
22
|
|
|
40
23
|
include Bio::Shell
|
|
41
24
|
|
|
25
|
+
# command line argument (working directory or bioruby shell script file)
|
|
26
|
+
script = nil
|
|
27
|
+
if arg = ARGV.shift
|
|
28
|
+
if File.directory?(arg)
|
|
29
|
+
# directory or symlink to directory
|
|
30
|
+
Dir.chdir(arg)
|
|
31
|
+
elsif File.exists?(arg)
|
|
32
|
+
# BioRuby shell script (load script after the previous session is restored)
|
|
33
|
+
dir = File.dirname(arg)
|
|
34
|
+
script = File.basename(arg)
|
|
35
|
+
Dir.chdir(dir)
|
|
36
|
+
elsif arg
|
|
37
|
+
Dir.mkdir(arg)
|
|
38
|
+
Dir.chdir(arg)
|
|
39
|
+
end
|
|
40
|
+
else
|
|
41
|
+
unless File.exists?(Bio::Shell.history)
|
|
42
|
+
message = "Are you sure to start new session in this directory? [y/n] "
|
|
43
|
+
unless Bio::Shell.ask_yes_or_no(message)
|
|
44
|
+
exit
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
42
49
|
# loading configuration and plugins
|
|
43
50
|
Bio::Shell.setup
|
|
44
51
|
|
|
52
|
+
|
|
45
53
|
### IRB setup
|
|
46
54
|
|
|
47
55
|
require 'irb'
|
|
@@ -84,7 +92,8 @@ IRB.conf[:ECHO] = Bio::Shell.config[:echo] || false
|
|
|
84
92
|
# not beautifully works
|
|
85
93
|
#IRB.conf[:AUTO_INDENT] = true
|
|
86
94
|
|
|
87
|
-
|
|
95
|
+
|
|
96
|
+
### Start IRB
|
|
88
97
|
|
|
89
98
|
irb = IRB::Irb.new
|
|
90
99
|
|
|
@@ -92,8 +101,32 @@ irb = IRB::Irb.new
|
|
|
92
101
|
IRB.conf[:MAIN_CONTEXT] = irb.context
|
|
93
102
|
|
|
94
103
|
# loading workspace and command history
|
|
95
|
-
Bio::Shell.
|
|
104
|
+
Bio::Shell.load_session
|
|
96
105
|
|
|
106
|
+
if script
|
|
107
|
+
load script
|
|
108
|
+
exit
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
Bio::Shell.create_save_dir
|
|
112
|
+
|
|
113
|
+
$history_file = File.open(Bio::Shell.history, "a")
|
|
114
|
+
$history_file.sync = true
|
|
115
|
+
|
|
116
|
+
# overwrite gets to store history with time stamp
|
|
117
|
+
io = IRB.conf[:MAIN_CONTEXT].io
|
|
118
|
+
|
|
119
|
+
io.class.class_eval do
|
|
120
|
+
alias_method :irb_original_gets, :gets
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def io.gets
|
|
124
|
+
line = irb_original_gets
|
|
125
|
+
$history_file.puts "#{Time.now}\t#{line}" if line
|
|
126
|
+
line
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# main loop
|
|
97
130
|
Signal.trap("SIGINT") do
|
|
98
131
|
irb.signal_handle
|
|
99
132
|
end
|
|
@@ -102,6 +135,17 @@ catch(:IRB_EXIT) do
|
|
|
102
135
|
irb.eval_input
|
|
103
136
|
end
|
|
104
137
|
|
|
138
|
+
$history_file.close if $history_file
|
|
139
|
+
|
|
140
|
+
# shut down the rails server
|
|
141
|
+
if $web_server
|
|
142
|
+
$web_server.each do |io|
|
|
143
|
+
io.close
|
|
144
|
+
end
|
|
145
|
+
$web_access_log.close if $web_access_log
|
|
146
|
+
$web_error_log.close if $web_error_log
|
|
147
|
+
end
|
|
148
|
+
|
|
105
149
|
# saving workspace, command history and configuration before exit
|
|
106
|
-
Bio::Shell.
|
|
150
|
+
Bio::Shell.save_session
|
|
107
151
|
|
data/bin/br_biofetch.rb
CHANGED
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
#
|
|
3
|
-
# biofetch - BioFetch client
|
|
3
|
+
# = biofetch - BioFetch client
|
|
4
4
|
#
|
|
5
|
-
# Copyright (C) 2002
|
|
5
|
+
# Copyright:: Copyright (C) 2002
|
|
6
|
+
# Toshiaki Katayama <k@bioruby.org>
|
|
7
|
+
# License:: Ruby's
|
|
6
8
|
#
|
|
7
|
-
#
|
|
8
|
-
# it under the terms of the GNU General Public License as published by
|
|
9
|
-
# the Free Software Foundation; either version 2 of the License, or
|
|
10
|
-
# (at your option) any later version.
|
|
11
|
-
#
|
|
12
|
-
# This program is distributed in the hope that it will be useful,
|
|
13
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
-
# GNU General Public License for more details.
|
|
16
|
-
#
|
|
17
|
-
# You should have received a copy of the GNU General Public License
|
|
18
|
-
# along with this program; if not, write to the Free Software
|
|
19
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
20
|
-
#
|
|
21
|
-
# $Id: br_biofetch.rb,v 1.2 2002/12/03 18:54:43 k Exp $
|
|
9
|
+
# $Id: br_biofetch.rb,v 1.3 2006/02/09 16:29:41 k Exp $
|
|
22
10
|
#
|
|
23
11
|
|
|
24
12
|
require 'bio/io/fetch'
|
data/bin/br_bioflat.rb
CHANGED
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
#
|
|
3
|
-
# bioflat - OBDA flat file indexer (executable)
|
|
3
|
+
# = bioflat - OBDA flat file indexer (executable)
|
|
4
4
|
#
|
|
5
|
-
# Copyright (C) 2002
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
# (at your option) any later version.
|
|
11
|
-
#
|
|
12
|
-
# This program is distributed in the hope that it will be useful,
|
|
13
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
-
# GNU General Public License for more details.
|
|
16
|
-
#
|
|
17
|
-
# You should have received a copy of the GNU General Public License
|
|
18
|
-
# along with this program; if not, write to the Free Software
|
|
19
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
20
|
-
#
|
|
21
|
-
# $Id: br_bioflat.rb,v 1.14 2003/08/27 17:28:30 ng Exp $
|
|
5
|
+
# Copyright:: Copyright (C) 2002
|
|
6
|
+
# Naohisa Goto <ng@bioruby.org>
|
|
7
|
+
# License:: Ruby's
|
|
8
|
+
#
|
|
9
|
+
# $Id: br_bioflat.rb,v 1.16 2006/02/22 07:01:05 ngoto Exp $
|
|
22
10
|
#
|
|
23
11
|
|
|
24
12
|
require 'bio'
|
|
@@ -151,7 +139,7 @@ def do_index(mode = :create)
|
|
|
151
139
|
options['renew'] = true
|
|
152
140
|
|
|
153
141
|
else
|
|
154
|
-
|
|
142
|
+
$stderr.print "Warning: ignoring invalid option #{x.inspect}\n"
|
|
155
143
|
end
|
|
156
144
|
end
|
|
157
145
|
|
|
@@ -191,9 +179,9 @@ def do_search
|
|
|
191
179
|
dbname = File.join(location, dbname) unless location.to_s.empty?
|
|
192
180
|
db = Bio::FlatFileIndex.open(dbname)
|
|
193
181
|
ARGV.each do |key|
|
|
194
|
-
|
|
182
|
+
$stderr.print "Searching for \'#{key}\'...\n"
|
|
195
183
|
#r = db.search(key)
|
|
196
|
-
|
|
184
|
+
#$stderr.print "OK, #{r.size} entry found\n"
|
|
197
185
|
#if r.size > 0 then
|
|
198
186
|
# print r
|
|
199
187
|
#end
|
|
@@ -204,11 +192,11 @@ def do_search
|
|
|
204
192
|
r = db.include_in_namespaces?(key, *names)
|
|
205
193
|
end
|
|
206
194
|
rescue RuntimeError
|
|
207
|
-
|
|
195
|
+
$stderr.print "ERROR: #{$!}\n"
|
|
208
196
|
next
|
|
209
197
|
end
|
|
210
198
|
r = [] unless r
|
|
211
|
-
|
|
199
|
+
$stderr.print "OK, #{r.size} entry found\n"
|
|
212
200
|
r.each do |i|
|
|
213
201
|
print db.search_primary(i)
|
|
214
202
|
end
|
|
@@ -252,14 +240,14 @@ def do_show_namespaces
|
|
|
252
240
|
break if k
|
|
253
241
|
end
|
|
254
242
|
if k then
|
|
255
|
-
|
|
243
|
+
$stderr.print "Format: #{k.to_s}\n"
|
|
256
244
|
format = k
|
|
257
245
|
else
|
|
258
|
-
|
|
246
|
+
$stderr.print "ERROR: couldn't determine file format\n"
|
|
259
247
|
return
|
|
260
248
|
end
|
|
261
249
|
end
|
|
262
|
-
|
|
250
|
+
$stderr.print "Namespaces: (first line: primary namespace)\n"
|
|
263
251
|
if format then
|
|
264
252
|
parser = Bio::FlatFileIndex::Indexer::Parser.new(format)
|
|
265
253
|
print parser.primary.name, "\n"
|
data/bin/br_biogetseq.rb
CHANGED
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
#
|
|
3
|
-
# biogetseq - OBDA sequence data retrieval (executable)
|
|
3
|
+
# = biogetseq - OBDA sequence data retrieval (executable)
|
|
4
4
|
#
|
|
5
|
-
# Copyright (C) 2003
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
# (at your option) any later version.
|
|
11
|
-
#
|
|
12
|
-
# This program is distributed in the hope that it will be useful,
|
|
13
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
-
# GNU General Public License for more details.
|
|
16
|
-
#
|
|
17
|
-
# You should have received a copy of the GNU General Public License
|
|
18
|
-
# along with this program; if not, write to the Free Software
|
|
19
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
20
|
-
#
|
|
21
|
-
# $Id: br_biogetseq.rb,v 1.2 2003/02/21 02:44:22 k Exp $
|
|
5
|
+
# Copyright:: Copyright (C) 2003
|
|
6
|
+
# Toshiaki Katayama <k@bioruby.org>
|
|
7
|
+
# License:: Ruby's
|
|
8
|
+
#
|
|
9
|
+
# $Id: br_biogetseq.rb,v 1.3 2006/02/09 16:29:41 k Exp $
|
|
22
10
|
#
|
|
23
11
|
|
|
24
12
|
require 'bio'
|
data/bin/br_pmfetch.rb
CHANGED
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
#
|
|
3
|
-
# pmfetch - PubMed client
|
|
3
|
+
# = pmfetch - PubMed client
|
|
4
4
|
#
|
|
5
|
-
#
|
|
5
|
+
# Copyright:: Copyright (C) 2004, 2005
|
|
6
|
+
# Toshiaki Katayama <k@bioruby.org>
|
|
7
|
+
# License:: Ruby's
|
|
6
8
|
#
|
|
7
|
-
#
|
|
8
|
-
# it under the terms of the GNU General Public License as published by
|
|
9
|
-
# the Free Software Foundation; either version 2 of the License, or
|
|
10
|
-
# (at your option) any later version.
|
|
11
|
-
#
|
|
12
|
-
# This program is distributed in the hope that it will be useful,
|
|
13
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
-
# GNU General Public License for more details.
|
|
16
|
-
#
|
|
17
|
-
# You should have received a copy of the GNU General Public License
|
|
18
|
-
# along with this program; if not, write to the Free Software
|
|
19
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
9
|
+
# $Id: br_pmfetch.rb,v 1.6 2006/02/09 16:29:41 k Exp $
|
|
20
10
|
#
|
|
21
11
|
|
|
22
|
-
PROG_VER = '$Id: br_pmfetch.rb,v 1.
|
|
12
|
+
PROG_VER = '$Id: br_pmfetch.rb,v 1.6 2006/02/09 16:29:41 k Exp $'
|
|
23
13
|
PROG_NAME = File.basename($0)
|
|
24
14
|
|
|
25
15
|
|
data/doc/Changes-0.7.rd
CHANGED
|
@@ -49,6 +49,19 @@ or newly added.
|
|
|
49
49
|
|
|
50
50
|
--- Bio::Sequence
|
|
51
51
|
|
|
52
|
+
Bio::Sequence is completely refactored to be a container class for
|
|
53
|
+
any sequence annotations. Functionalities are separated into several
|
|
54
|
+
files under the lib/bio/sequence/ directory as
|
|
55
|
+
|
|
56
|
+
* common.rb : module provides common methods for NA and AA sequences
|
|
57
|
+
* compat.rb : methods for backward compatibility
|
|
58
|
+
* aa.rb : Bio::Sequence::AA class
|
|
59
|
+
* na.rb : Bio::Sequence::NA class
|
|
60
|
+
* format.rb : module for format conversion
|
|
61
|
+
|
|
62
|
+
Bio::Sequence is no longer a sub-class of String, instead,
|
|
63
|
+
Bio::Sequence::NA and AA inherits String directly.
|
|
64
|
+
|
|
52
65
|
* Bio::Sequence::NA#gc_percent returns integer instead of float
|
|
53
66
|
* Bio::Sequence::NA#gc (was aliased to gc_percent) is removed
|
|
54
67
|
|
|
@@ -226,6 +239,28 @@ In 0.7.1:
|
|
|
226
239
|
a nucleic acid sequence.
|
|
227
240
|
* There are more and more changes to be written...
|
|
228
241
|
|
|
242
|
+
--- Bio::FlatFile
|
|
243
|
+
|
|
244
|
+
In 0.7.2:
|
|
245
|
+
|
|
246
|
+
* Bio::FlatFile.open, Bio::FlatFile.auto and Bio::FlatFile.new are changed
|
|
247
|
+
not to accept the last argument to specify raw mode, e.g. :raw => true,
|
|
248
|
+
:raw => false, true or false. Instead, please use Bio::FlatFile#raw=
|
|
249
|
+
method after creating a new object.
|
|
250
|
+
* Now, first argument of Bio::FlatFile.open, which shall be a database
|
|
251
|
+
class or nil, can be omitted, and you can do
|
|
252
|
+
Bio::FlatFile.open(filename, ...). Note that
|
|
253
|
+
Bio::FlatFile.open(dbclass, filaname, ...) is still available.
|
|
254
|
+
* Bio::FlatFile#io is obsoleted. Please use Bio::FlatFile#to_io instead.
|
|
255
|
+
* When reading GenBank or GenPept files, comments at the head of the file
|
|
256
|
+
before the first "LOCUS" lines are now skipped by default.
|
|
257
|
+
When reading other file formats, white space characters are skipped.
|
|
258
|
+
* File format autodetection routine is completely rewritten.
|
|
259
|
+
If it fails to determine data format which was previously determined,
|
|
260
|
+
please report us with the data.
|
|
261
|
+
* Internal structure is now completely changed. Codes depend on the internal
|
|
262
|
+
structure (which is not recommended) would not work.
|
|
263
|
+
|
|
229
264
|
=== Deleted files
|
|
230
265
|
|
|
231
266
|
: lib/bio/db/genbank.rb
|
data/doc/KEGG_API.rd
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
|
|
3
|
-
$Id: KEGG_API.rd,v 1.
|
|
3
|
+
$Id: KEGG_API.rd,v 1.2 2006/02/23 04:51:23 k Exp $
|
|
4
4
|
|
|
5
|
-
Copyright (C) 2003-
|
|
5
|
+
Copyright (C) 2003-2006 Toshiaki Katayama <k@bioruby.org>
|
|
6
6
|
|
|
7
7
|
= KEGG API
|
|
8
8
|
|
|
@@ -79,6 +79,7 @@ page at GenomeNet:
|
|
|
79
79
|
* ((<MotifResult>)), ((<ArrayOfMotifResult>))
|
|
80
80
|
* ((<Definition>)), ((<ArrayOfDefinition>))
|
|
81
81
|
* ((<LinkDBRelation>)), ((<ArrayOfLinkDBRelation>))
|
|
82
|
+
* ((<PathwayElement>)), ((<ArrayOfPathwayElement>))
|
|
82
83
|
* ((<Methods>))
|
|
83
84
|
* ((<Meta information>))
|
|
84
85
|
* ((<list_databases>)),
|
|
@@ -88,9 +89,22 @@ page at GenomeNet:
|
|
|
88
89
|
* ((<binfo>)),
|
|
89
90
|
((<bfind>)),
|
|
90
91
|
((<bget>)),
|
|
91
|
-
((<btit>))
|
|
92
|
+
((<btit>)),
|
|
93
|
+
((<bconv>))
|
|
92
94
|
* ((<LinkDB>))
|
|
93
95
|
* ((<get_linkdb_by_entry>))
|
|
96
|
+
* ((<get_genes_by_enzyme>)),
|
|
97
|
+
((<get_enzymes_by_gene>))
|
|
98
|
+
* ((<get_enzymes_by_compound>)),
|
|
99
|
+
((<get_enzymes_by_glycan>)),
|
|
100
|
+
((<get_enzymes_by_reaction>)),
|
|
101
|
+
((<get_compounds_by_enzyme>)),
|
|
102
|
+
((<get_compounds_by_reaction>)),
|
|
103
|
+
((<get_glycans_by_enzyme>)),
|
|
104
|
+
((<get_glycans_by_reaction>)),
|
|
105
|
+
((<get_reactions_by_enzyme>)),
|
|
106
|
+
((<get_reactions_by_compound>)),
|
|
107
|
+
((<get_reactions_by_glycan>))
|
|
94
108
|
* ((<SSDB>))
|
|
95
109
|
* ((<get_best_best_neighbors_by_gene>)),
|
|
96
110
|
((<get_best_neighbors_by_gene>)),
|
|
@@ -112,9 +126,12 @@ page at GenomeNet:
|
|
|
112
126
|
* ((<PATHWAY>))
|
|
113
127
|
* ((<mark_pathway_by_objects>)),
|
|
114
128
|
((<color_pathway_by_objects>)),
|
|
129
|
+
((<color_pathway_by_elements>)),
|
|
115
130
|
((<get_html_of_marked_pathway_by_objects>)),
|
|
116
|
-
((<get_html_of_colored_pathway_by_objects>))
|
|
117
|
-
|
|
131
|
+
((<get_html_of_colored_pathway_by_objects>)),
|
|
132
|
+
((<get_html_of_colored_pathway_by_elements>))
|
|
133
|
+
* ((<get_elements_by_pathway>)),
|
|
134
|
+
((<get_genes_by_pathway>)),
|
|
118
135
|
((<get_enzymes_by_pathway>)),
|
|
119
136
|
((<get_compounds_by_pathway>)),
|
|
120
137
|
((<get_glycans_by_pathway>)),
|
|
@@ -127,18 +144,6 @@ page at GenomeNet:
|
|
|
127
144
|
((<get_pathways_by_reactions>)),
|
|
128
145
|
((<get_pathways_by_kos>))
|
|
129
146
|
* ((<get_linked_pathways>))
|
|
130
|
-
* ((<get_genes_by_enzyme>)),
|
|
131
|
-
((<get_enzymes_by_gene>))
|
|
132
|
-
* ((<get_enzymes_by_compound>)),
|
|
133
|
-
((<get_enzymes_by_glycan>)),
|
|
134
|
-
((<get_enzymes_by_reaction>)),
|
|
135
|
-
((<get_compounds_by_enzyme>)),
|
|
136
|
-
((<get_compounds_by_reaction>)),
|
|
137
|
-
((<get_glycans_by_enzyme>)),
|
|
138
|
-
((<get_glycans_by_reaction>)),
|
|
139
|
-
((<get_reactions_by_enzyme>)),
|
|
140
|
-
((<get_reactions_by_compound>)),
|
|
141
|
-
((<get_reactions_by_glycan>))
|
|
142
147
|
* ((<GENES>))
|
|
143
148
|
* ((<get_genes_by_organism>))
|
|
144
149
|
* ((<GENOME>))
|
|
@@ -507,8 +512,9 @@ the KEGG API can be found at:
|
|
|
507
512
|
|
|
508
513
|
=== Terminology
|
|
509
514
|
|
|
510
|
-
* 'org' is a three-letter organism code used in KEGG.
|
|
511
|
-
found at (see the description of the list_organisms
|
|
515
|
+
* 'org' is a three-letter (or four-letter) organism code used in KEGG.
|
|
516
|
+
The list can be found at (see the description of the list_organisms
|
|
517
|
+
method below):
|
|
512
518
|
|
|
513
519
|
* ((<URL:http://www.genome.jp/kegg/catalog/org_list.html>))
|
|
514
520
|
|
|
@@ -622,7 +628,7 @@ The following methods had been affected by this bug:
|
|
|
622
628
|
* get_paralogs_by_gene
|
|
623
629
|
# * get_similarity_between_genes
|
|
624
630
|
|
|
625
|
-
This problem is fixed in the version 3.2.
|
|
631
|
+
This problem is fixed in the KEGG API version 3.2.
|
|
626
632
|
|
|
627
633
|
+ ArrayOfSSDBRelation
|
|
628
634
|
|
|
@@ -671,6 +677,20 @@ LinkDBRelation data type contains the following fields:
|
|
|
671
677
|
|
|
672
678
|
ArrayOfLinkDBRelation data type is a list of the LinkDBRelation data type.
|
|
673
679
|
|
|
680
|
+
+ PathwayElement
|
|
681
|
+
|
|
682
|
+
PathwayElement data type contains the following fields:
|
|
683
|
+
|
|
684
|
+
element_id unique identifier of the object on the pathway (int)
|
|
685
|
+
type type of the object ("gene", "enzyme" etc.) (string)
|
|
686
|
+
names array of names of the object (ArrayOfstring)
|
|
687
|
+
components array of element_ids of the group components (ArrayOfint)
|
|
688
|
+
|
|
689
|
+
+ ArrayOfPathwayElement
|
|
690
|
+
|
|
691
|
+
ArrayOfPathwayElement data type is a list of the PathwayElement data type.
|
|
692
|
+
|
|
693
|
+
|
|
674
694
|
=== Methods
|
|
675
695
|
|
|
676
696
|
==== Meta information
|
|
@@ -769,6 +789,19 @@ Example:
|
|
|
769
789
|
# "mmu:13478", "dme:CG5287-PA" and cel:Y60A3A.14".
|
|
770
790
|
btit("hsa:1798 mmu:13478 dme:CG5287-PA cel:Y60A3A.14")
|
|
771
791
|
|
|
792
|
+
--- bconv(string)
|
|
793
|
+
|
|
794
|
+
The bconv command converts external IDs (NCBI GI, NCBI GeneID, GenBank ID,
|
|
795
|
+
and UniProt ID) to KEGG IDs. The result is the tab separated pair of the
|
|
796
|
+
given ID and the converted ID in each line.
|
|
797
|
+
|
|
798
|
+
Return value:
|
|
799
|
+
string
|
|
800
|
+
|
|
801
|
+
Example:
|
|
802
|
+
# Convert NCBI GI and NCBI GeneID to KEGG genes_id
|
|
803
|
+
serv.bconv("ncbi-gi:10047086 ncbi-gi:10047090 ncbi-geneid:14751")
|
|
804
|
+
|
|
772
805
|
==== LinkDB
|
|
773
806
|
|
|
774
807
|
--- get_linkdb_by_entry(entry_id, db, start, max_results)
|
|
@@ -784,6 +817,155 @@ Example:
|
|
|
784
817
|
get_linkdb_by_entry('eco:b0002', 'pathway', 1, 10)
|
|
785
818
|
get_linkdb_by_entry('eco:b0002', 'pathway', 11, 10)
|
|
786
819
|
|
|
820
|
+
+ Relation among genes and enzymes
|
|
821
|
+
|
|
822
|
+
--- get_genes_by_enzyme(enzyme_id, org)
|
|
823
|
+
|
|
824
|
+
Retrieve all genes of the given organism.
|
|
825
|
+
|
|
826
|
+
Return value:
|
|
827
|
+
ArrayOfstring (genes_id)
|
|
828
|
+
|
|
829
|
+
Example:
|
|
830
|
+
# Returns all the GENES entry IDs in E.coli genome which are assigned
|
|
831
|
+
# EC number ec:1.2.1.1
|
|
832
|
+
get_genes_by_enzyme('ec:1.2.1.1', 'eco')
|
|
833
|
+
|
|
834
|
+
--- get_enzymes_by_gene(genes_id)
|
|
835
|
+
|
|
836
|
+
Retrieve all the EC numbers which are assigned to the given gene.
|
|
837
|
+
|
|
838
|
+
Return value:
|
|
839
|
+
ArrayOfstring (enzyme_id)
|
|
840
|
+
|
|
841
|
+
Example:
|
|
842
|
+
# Returns the EC numbers which are assigned to E.coli genes b0002
|
|
843
|
+
get_enzymes_by_gene('eco:b0002')
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
+ Relation among enzymes, compounds and reactions
|
|
847
|
+
|
|
848
|
+
--- get_enzymes_by_compound(compound_id)
|
|
849
|
+
|
|
850
|
+
Retrieve all enzymes which have a link to the given compound_id.
|
|
851
|
+
|
|
852
|
+
Return value:
|
|
853
|
+
ArrayOfstring (enzyme_id)
|
|
854
|
+
|
|
855
|
+
Example:
|
|
856
|
+
# Returns the ENZYME entry IDs which have a link to the COMPOUND entry,
|
|
857
|
+
# 'cpd:C00345'
|
|
858
|
+
get_enzymes_by_compound('cpd:C00345')
|
|
859
|
+
|
|
860
|
+
--- get_enzymes_by_glycan(glycan_id)
|
|
861
|
+
|
|
862
|
+
Retrieve all enzymes which have a link to the given glycan_id.
|
|
863
|
+
|
|
864
|
+
Return value:
|
|
865
|
+
ArrayOfstring (enzyme_id)
|
|
866
|
+
|
|
867
|
+
Example
|
|
868
|
+
# Returns the ENZYME entry IDs which have a link to the GLYCAN entry,
|
|
869
|
+
# 'gl:G00001'
|
|
870
|
+
get_enzymes_by_glycan('gl:G00001')
|
|
871
|
+
|
|
872
|
+
--- get_enzymes_by_reaction(reaction_id)
|
|
873
|
+
|
|
874
|
+
Retrieve all enzymes which have a link to the given reaction_id.
|
|
875
|
+
|
|
876
|
+
Return value:
|
|
877
|
+
ArrayOfstring (enzyme_id)
|
|
878
|
+
|
|
879
|
+
Example:
|
|
880
|
+
# Returns the ENZYME entry IDs which have a link to the REACTION entry,
|
|
881
|
+
# 'rn:R00100'.
|
|
882
|
+
get_enzymes_by_reaction('rn:R00100')
|
|
883
|
+
|
|
884
|
+
--- get_compounds_by_enzyme(enzyme_id)
|
|
885
|
+
|
|
886
|
+
Retrieve all compounds which have a link to the given enzyme_id.
|
|
887
|
+
|
|
888
|
+
Return value:
|
|
889
|
+
ArrayOfstring (compound_id)
|
|
890
|
+
|
|
891
|
+
Example:
|
|
892
|
+
# Returns the COMPOUND entry IDs which have a link to the ENZYME entry,
|
|
893
|
+
# 'ec:2.7.1.12'.
|
|
894
|
+
get_compounds_by_enzyme('ec:2.7.1.12')
|
|
895
|
+
|
|
896
|
+
--- get_compounds_by_reaction(reaction_id)
|
|
897
|
+
|
|
898
|
+
Retrieve all compounds which have a link to the given reaction_id.
|
|
899
|
+
|
|
900
|
+
Return value:
|
|
901
|
+
ArrayOfstring (compound_id)
|
|
902
|
+
|
|
903
|
+
Example:
|
|
904
|
+
# Returns the COMPOUND entry IDs which have a link to the REACTION entry,
|
|
905
|
+
# 'rn:R00100'
|
|
906
|
+
get_compounds_by_reaction('rn:R00100')
|
|
907
|
+
|
|
908
|
+
--- get_glycans_by_enzyme(enzyme_id)
|
|
909
|
+
|
|
910
|
+
Retrieve all glycans which have a link to the given enzyme_id.
|
|
911
|
+
|
|
912
|
+
Return value:
|
|
913
|
+
ArrayOfstring (glycan_id)
|
|
914
|
+
|
|
915
|
+
Example
|
|
916
|
+
# Returns the GLYCAN entry IDs which have a link to the ENZYME entry,
|
|
917
|
+
# 'ec:2.4.1.141'
|
|
918
|
+
get_glycans_by_enzyme('ec:2.4.1.141')
|
|
919
|
+
|
|
920
|
+
--- get_glycans_by_reaction(reaction_id)
|
|
921
|
+
|
|
922
|
+
Retrieve all glycans which have a link to the given reaction_id.
|
|
923
|
+
|
|
924
|
+
Return value:
|
|
925
|
+
ArrayOfstring (glycan_id)
|
|
926
|
+
|
|
927
|
+
Example
|
|
928
|
+
# Returns the GLYCAN entry IDs which have a link to the REACTION entry,
|
|
929
|
+
# 'rn:R06164'
|
|
930
|
+
get_glycans_by_reaction('rn:R06164')
|
|
931
|
+
|
|
932
|
+
--- get_reactions_by_enzyme(enzyme_id)
|
|
933
|
+
|
|
934
|
+
Retrieve all reactions which have a link to the given enzyme_id.
|
|
935
|
+
|
|
936
|
+
Return value:
|
|
937
|
+
ArrayOfstring (reaction_id)
|
|
938
|
+
|
|
939
|
+
Example:
|
|
940
|
+
# Returns the REACTION entry IDs which have a link to the ENZYME entry,
|
|
941
|
+
# 'ec:2.7.1.12'
|
|
942
|
+
get_reactions_by_enzyme('ec:2.7.1.12')
|
|
943
|
+
|
|
944
|
+
--- get_reactions_by_compound(compound_id)
|
|
945
|
+
|
|
946
|
+
Retrieve all reactions which have a link to the given compound_id.
|
|
947
|
+
|
|
948
|
+
Return value:
|
|
949
|
+
ArrayOfstring (reaction_id)
|
|
950
|
+
|
|
951
|
+
Example:
|
|
952
|
+
# Returns the REACTION entry IDs which have a link to the COMPOUND entry,
|
|
953
|
+
# 'cpd:C00199'
|
|
954
|
+
get_reactions_by_compound('cpd:C00199')
|
|
955
|
+
|
|
956
|
+
--- get_reactions_by_glycan(glycan_id)
|
|
957
|
+
|
|
958
|
+
Retrieve all reactions which have a link to the given glycan_id.
|
|
959
|
+
|
|
960
|
+
Return value:
|
|
961
|
+
ArrayOfstring (reaction_id)
|
|
962
|
+
|
|
963
|
+
Example
|
|
964
|
+
# Returns the REACTION entry IDs which have a link to the GLYCAN entry,
|
|
965
|
+
# 'gl:G00001'
|
|
966
|
+
get_reactions_by_glycan('gl:G00001')
|
|
967
|
+
|
|
968
|
+
|
|
787
969
|
==== SSDB
|
|
788
970
|
|
|
789
971
|
This section describes the APIs for SSDB database. For more details
|
|
@@ -1030,6 +1212,42 @@ Example:
|
|
|
1030
1212
|
bg_list = ['#ffff00', 'yellow']
|
|
1031
1213
|
color_pathway_by_objects('path:eco00260', obj_list, fg_list, bg_list)
|
|
1032
1214
|
|
|
1215
|
+
--- color_pathway_by_elements(pathway_id, element_id_list, fg_color_list, bg_color_list)
|
|
1216
|
+
|
|
1217
|
+
Color the objects (rectangles and circles on a pathway map) corresponding
|
|
1218
|
+
to the given 'element_id_list' with the specified colors and return the
|
|
1219
|
+
URL of the colored image. 'fg_color_list' is used for specifying the
|
|
1220
|
+
color of text and border of the objects with given 'element_id_list' and
|
|
1221
|
+
'bg_color_list' is used for its background area. The order of colors in
|
|
1222
|
+
these lists correspond with the order of objects in the 'element_id_list'
|
|
1223
|
+
list.
|
|
1224
|
+
|
|
1225
|
+
This method is useful to specify which graphical object on the pathway
|
|
1226
|
+
to be colored as there are some cases that multiple genes are assigned to
|
|
1227
|
+
one rectangle or a gene is assigned to more than one rectangle on the
|
|
1228
|
+
pathway map. The 'element_id' is an unique numerical identifier on the
|
|
1229
|
+
pathway defined by the KGML (XML represeentation of the KEGG PATHWAY)
|
|
1230
|
+
in the <entry> tag. List of the 'element_id's can be obtained by the
|
|
1231
|
+
'get_elements_by_pathway' method.
|
|
1232
|
+
|
|
1233
|
+
For more details on KGML, see:
|
|
1234
|
+
|
|
1235
|
+
* ((<URL:http://www.genome.jp/kegg/xml/>))
|
|
1236
|
+
|
|
1237
|
+
Return value:
|
|
1238
|
+
string (URL)
|
|
1239
|
+
|
|
1240
|
+
Example:
|
|
1241
|
+
# Returns the URL of the colored image of given pathway 'path:bsu00010' with
|
|
1242
|
+
# * gene bsu:BG11350 (element_id 78, ec:3.2.1.86) colored in red on yellow
|
|
1243
|
+
# * gene bsu:BG11203 (element_id 79, ec:3.2.1.86) colored in blue on yellow
|
|
1244
|
+
# * gene bsu:BG11685 (element_id 51, ec:2.7.1.2) colored in red on orange
|
|
1245
|
+
# * gene bsu:BG11685 (element_id 47, ec:2.7.1.2) colored in blue on orange
|
|
1246
|
+
element_id_list = [ 78, 79, 51, 47 ]
|
|
1247
|
+
fg_list = [ '#ff0000', '#0000ff', '#ff0000', '#0000ff' ]
|
|
1248
|
+
bg_list = [ '#ffff00', '#ffff00', '#ffcc00', '#ffcc00' ]
|
|
1249
|
+
color_pathway_by_elements('path:bsu00010', element_id_list, fg_list, bg_list)
|
|
1250
|
+
|
|
1033
1251
|
--- get_html_of_marked_pathway_by_objects(pathway_id, object_id_list)
|
|
1034
1252
|
|
|
1035
1253
|
HTML version of the 'mark_pathway_by_objects' method.
|
|
@@ -1059,17 +1277,63 @@ Return value:
|
|
|
1059
1277
|
|
|
1060
1278
|
Example:
|
|
1061
1279
|
# Returns the URL of the HTML which can be passed to the web browser
|
|
1062
|
-
# as a clickable map of
|
|
1280
|
+
# as a clickable map of colored image of the given pathway 'path:eco00970'
|
|
1063
1281
|
# with a gene 'eco:b4258' colored in gray/red, a compound 'cpd:C00135'
|
|
1064
|
-
#
|
|
1282
|
+
# colored in green/yellow and a KO 'ko:K01881' colored in blue/orange.
|
|
1065
1283
|
obj_list = ['eco:b4258', 'cpd:C00135', 'ko:K01881']
|
|
1066
1284
|
fg_list = ['gray', '#00ff00', 'blue']
|
|
1067
1285
|
bg_list = ['#ff0000', 'yellow', 'orange']
|
|
1068
1286
|
get_html_of_colored_pathway_by_objects('path:eco00970', obj_list, fg_list, bg_list)
|
|
1069
1287
|
|
|
1288
|
+
--- get_html_of_colored_pathway_by_elements(pathway_id, element_id_list, fg_color_list, bg_color_list)
|
|
1289
|
+
|
|
1290
|
+
HTML version of the 'color_pathway_by_elements' method.
|
|
1291
|
+
Color the objects corresponding to the given 'element_id_list' on the pathway
|
|
1292
|
+
map with the specified colors and return the URL of the HTML containing the
|
|
1293
|
+
colored image as a clickable map.
|
|
1294
|
+
|
|
1295
|
+
Return value:
|
|
1296
|
+
string (URL)
|
|
1297
|
+
|
|
1298
|
+
Example:
|
|
1299
|
+
# Returns the URL of the HTML which can be passed to the web browser as a
|
|
1300
|
+
# clickable map of colored image of the given pathway 'path:bsu00010' with
|
|
1301
|
+
# * gene bsu:BG11350 (element_id 78, ec:3.2.1.86) colored in red on yellow
|
|
1302
|
+
# * gene bsu:BG11203 (element_id 79, ec:3.2.1.86) colored in blue on yellow
|
|
1303
|
+
# * gene bsu:BG11685 (element_id 51, ec:2.7.1.2) colored in red on orange
|
|
1304
|
+
# * gene bsu:BG11685 (element_id 47, ec:2.7.1.2) colored in blue on orange
|
|
1305
|
+
element_id_list = [ 78, 79, 51, 47 ]
|
|
1306
|
+
fg_list = [ '#ff0000', '#0000ff', '#ff0000', '#0000ff' ]
|
|
1307
|
+
bg_list = [ '#ffff00', '#ffff00', '#ffcc00', '#ffcc00' ]
|
|
1308
|
+
get_html_of_colored_pathway_by_elements('path:bsu00010', element_id_list, fg_list, bg_list)
|
|
1070
1309
|
|
|
1071
1310
|
+ Objects on the pathway
|
|
1072
1311
|
|
|
1312
|
+
--- get_elements_by_pathway(pathway_id)
|
|
1313
|
+
|
|
1314
|
+
Search all objects on the specified pathway. This method will be used in
|
|
1315
|
+
combination with the color_pathway_by_elements method to distingish graphical
|
|
1316
|
+
objects on the pathway sharing the same name.
|
|
1317
|
+
|
|
1318
|
+
Return value:
|
|
1319
|
+
ArrayOfPathwayElement
|
|
1320
|
+
|
|
1321
|
+
Example:
|
|
1322
|
+
# Returns list of PathwayElement on the pathway map 'path:bsu00010'
|
|
1323
|
+
get_elements_by_pathway('path:bsu00010')
|
|
1324
|
+
|
|
1325
|
+
# Find entry_ids for genes 'bsu:BG11350', 'bsu:BG11203' and 'bsu:BG11685'
|
|
1326
|
+
# in Ruby language
|
|
1327
|
+
elems = serv.get_elements_by_pathway('path:bsu00010')
|
|
1328
|
+
genes = [ 'bsu:BG11350', 'bsu:BG11203', 'bsu:BG11685' ]
|
|
1329
|
+
elems.each do |elem|
|
|
1330
|
+
genes.each do |gene|
|
|
1331
|
+
if elem.names.include?(gene)
|
|
1332
|
+
puts gene, elem.element_id
|
|
1333
|
+
end
|
|
1334
|
+
end
|
|
1335
|
+
end
|
|
1336
|
+
|
|
1073
1337
|
--- get_genes_by_pathway(pathway_id)
|
|
1074
1338
|
|
|
1075
1339
|
Search all genes on the specified pathway. Organism name is given by
|
|
@@ -1226,155 +1490,6 @@ Example:
|
|
|
1226
1490
|
get_linked_pathways('path:eco00620')
|
|
1227
1491
|
|
|
1228
1492
|
|
|
1229
|
-
+ Relation among genes and enzymes
|
|
1230
|
-
|
|
1231
|
-
--- get_genes_by_enzyme(enzyme_id, org)
|
|
1232
|
-
|
|
1233
|
-
Retrieve all genes of the given organism.
|
|
1234
|
-
|
|
1235
|
-
Return value:
|
|
1236
|
-
ArrayOfstring (genes_id)
|
|
1237
|
-
|
|
1238
|
-
Example:
|
|
1239
|
-
# Returns all the GENES entry IDs in E.coli genome which are assigned
|
|
1240
|
-
# EC number ec:1.2.1.1
|
|
1241
|
-
get_genes_by_enzyme('ec:1.2.1.1', 'eco')
|
|
1242
|
-
|
|
1243
|
-
--- get_enzymes_by_gene(genes_id)
|
|
1244
|
-
|
|
1245
|
-
Retrieve all the EC numbers which are assigned to the given gene.
|
|
1246
|
-
|
|
1247
|
-
Return value:
|
|
1248
|
-
ArrayOfstring (enzyme_id)
|
|
1249
|
-
|
|
1250
|
-
Example:
|
|
1251
|
-
# Returns the EC numbers which are assigned to E.coli genes b0002
|
|
1252
|
-
get_enzymes_by_gene('eco:b0002')
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
+ Relation among enzymes, compounds and reactions
|
|
1256
|
-
|
|
1257
|
-
--- get_enzymes_by_compound(compound_id)
|
|
1258
|
-
|
|
1259
|
-
Retrieve all enzymes which have a link to the given compound_id.
|
|
1260
|
-
|
|
1261
|
-
Return value:
|
|
1262
|
-
ArrayOfstring (enzyme_id)
|
|
1263
|
-
|
|
1264
|
-
Example:
|
|
1265
|
-
# Returns the ENZYME entry IDs which have a link to the COMPOUND entry,
|
|
1266
|
-
# 'cpd:C00345'
|
|
1267
|
-
get_enzymes_by_compound('cpd:C00345')
|
|
1268
|
-
|
|
1269
|
-
--- get_enzymes_by_glycan(glycan_id)
|
|
1270
|
-
|
|
1271
|
-
Retrieve all enzymes which have a link to the given glycan_id.
|
|
1272
|
-
|
|
1273
|
-
Return value:
|
|
1274
|
-
ArrayOfstring (enzyme_id)
|
|
1275
|
-
|
|
1276
|
-
Example
|
|
1277
|
-
# Returns the ENZYME entry IDs which have a link to the GLYCAN entry,
|
|
1278
|
-
# 'gl:G00001'
|
|
1279
|
-
get_enzymes_by_glycan('gl:G00001')
|
|
1280
|
-
|
|
1281
|
-
--- get_enzymes_by_reaction(reaction_id)
|
|
1282
|
-
|
|
1283
|
-
Retrieve all enzymes which have a link to the given reaction_id.
|
|
1284
|
-
|
|
1285
|
-
Return value:
|
|
1286
|
-
ArrayOfstring (enzyme_id)
|
|
1287
|
-
|
|
1288
|
-
Example:
|
|
1289
|
-
# Returns the ENZYME entry IDs which have a link to the REACTION entry,
|
|
1290
|
-
# 'rn:R00100'.
|
|
1291
|
-
get_enzymes_by_reaction('rn:R00100')
|
|
1292
|
-
|
|
1293
|
-
--- get_compounds_by_enzyme(enzyme_id)
|
|
1294
|
-
|
|
1295
|
-
Retrieve all compounds which have a link to the given enzyme_id.
|
|
1296
|
-
|
|
1297
|
-
Return value:
|
|
1298
|
-
ArrayOfstring (compound_id)
|
|
1299
|
-
|
|
1300
|
-
Example:
|
|
1301
|
-
# Returns the COMPOUND entry IDs which have a link to the ENZYME entry,
|
|
1302
|
-
# 'ec:2.7.1.12'.
|
|
1303
|
-
get_compounds_by_enzyme('ec:2.7.1.12')
|
|
1304
|
-
|
|
1305
|
-
--- get_compounds_by_reaction(reaction_id)
|
|
1306
|
-
|
|
1307
|
-
Retrieve all compounds which have a link to the given reaction_id.
|
|
1308
|
-
|
|
1309
|
-
Return value:
|
|
1310
|
-
ArrayOfstring (compound_id)
|
|
1311
|
-
|
|
1312
|
-
Example:
|
|
1313
|
-
# Returns the COMPOUND entry IDs which have a link to the REACTION entry,
|
|
1314
|
-
# 'rn:R00100'
|
|
1315
|
-
get_compounds_by_reaction('rn:R00100')
|
|
1316
|
-
|
|
1317
|
-
--- get_glycans_by_enzyme(enzyme_id)
|
|
1318
|
-
|
|
1319
|
-
Retrieve all glycans which have a link to the given enzyme_id.
|
|
1320
|
-
|
|
1321
|
-
Return value:
|
|
1322
|
-
ArrayOfstring (glycan_id)
|
|
1323
|
-
|
|
1324
|
-
Example
|
|
1325
|
-
# Returns the GLYCAN entry IDs which have a link to the ENZYME entry,
|
|
1326
|
-
# 'ec:2.4.1.141'
|
|
1327
|
-
get_glycans_by_enzyme('ec:2.4.1.141')
|
|
1328
|
-
|
|
1329
|
-
--- get_glycans_by_reaction(reaction_id)
|
|
1330
|
-
|
|
1331
|
-
Retrieve all glycans which have a link to the given reaction_id.
|
|
1332
|
-
|
|
1333
|
-
Return value:
|
|
1334
|
-
ArrayOfstring (glycan_id)
|
|
1335
|
-
|
|
1336
|
-
Example
|
|
1337
|
-
# Returns the GLYCAN entry IDs which have a link to the REACTION entry,
|
|
1338
|
-
# 'rn:R06164'
|
|
1339
|
-
get_glycans_by_reaction('rn:R06164')
|
|
1340
|
-
|
|
1341
|
-
--- get_reactions_by_enzyme(enzyme_id)
|
|
1342
|
-
|
|
1343
|
-
Retrieve all reactions which have a link to the given enzyme_id.
|
|
1344
|
-
|
|
1345
|
-
Return value:
|
|
1346
|
-
ArrayOfstring (reaction_id)
|
|
1347
|
-
|
|
1348
|
-
Example:
|
|
1349
|
-
# Returns the REACTION entry IDs which have a link to the ENZYME entry,
|
|
1350
|
-
# 'ec:2.7.1.12'
|
|
1351
|
-
get_reactions_by_enzyme('ec:2.7.1.12')
|
|
1352
|
-
|
|
1353
|
-
--- get_reactions_by_compound(compound_id)
|
|
1354
|
-
|
|
1355
|
-
Retrieve all reactions which have a link to the given compound_id.
|
|
1356
|
-
|
|
1357
|
-
Return value:
|
|
1358
|
-
ArrayOfstring (reaction_id)
|
|
1359
|
-
|
|
1360
|
-
Example:
|
|
1361
|
-
# Returns the REACTION entry IDs which have a link to the COMPOUND entry,
|
|
1362
|
-
# 'cpd:C00199'
|
|
1363
|
-
get_reactions_by_compound('cpd:C00199')
|
|
1364
|
-
|
|
1365
|
-
--- get_reactions_by_glycan(glycan_id)
|
|
1366
|
-
|
|
1367
|
-
Retrieve all reactions which have a link to the given glycan_id.
|
|
1368
|
-
|
|
1369
|
-
Return value:
|
|
1370
|
-
ArrayOfstring (reaction_id)
|
|
1371
|
-
|
|
1372
|
-
Example
|
|
1373
|
-
# Returns the REACTION entry IDs which have a link to the GLYCAN entry,
|
|
1374
|
-
# 'gl:G00001'
|
|
1375
|
-
get_reactions_by_glycan('gl:G00001')
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
1493
|
==== GENES
|
|
1379
1494
|
|
|
1380
1495
|
This section describes the APIs for GENES database. For more details
|
|
@@ -1431,7 +1546,7 @@ Example:
|
|
|
1431
1546
|
|
|
1432
1547
|
== Notes
|
|
1433
1548
|
|
|
1434
|
-
Last updated:
|
|
1549
|
+
Last updated: Feb 17, 2006
|
|
1435
1550
|
|
|
1436
1551
|
=end
|
|
1437
1552
|
|