bio 0.7.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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/lib/bio/io/brdb.rb
DELETED
@@ -1,103 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# bio/io/brdb.rb - BioRuby-DB access module
|
3
|
-
#
|
4
|
-
# Copyright (C) 2001 KATAYAMA Toshiaki <k@bioruby.org>
|
5
|
-
#
|
6
|
-
# This library is free software; you can redistribute it and/or
|
7
|
-
# modify it under the terms of the GNU Lesser General Public
|
8
|
-
# License as published by the Free Software Foundation; either
|
9
|
-
# version 2 of the License, or (at your option) any later version.
|
10
|
-
#
|
11
|
-
# This library is distributed in the hope that it will be useful,
|
12
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
-
# Lesser General Public License for more details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU Lesser General Public
|
17
|
-
# License along with this library; if not, write to the Free Software
|
18
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
-
#
|
20
|
-
# $Id: brdb.rb,v 1.4 2005/09/26 13:00:08 k Exp $
|
21
|
-
#
|
22
|
-
|
23
|
-
begin
|
24
|
-
require 'dbi'
|
25
|
-
rescue LoadError
|
26
|
-
end
|
27
|
-
|
28
|
-
module Bio
|
29
|
-
|
30
|
-
class BRDB
|
31
|
-
|
32
|
-
def initialize(*args)
|
33
|
-
@brdb = args
|
34
|
-
end
|
35
|
-
|
36
|
-
def fetch(db_table, entry_id)
|
37
|
-
DBI.connect(*@brdb) do |dbh|
|
38
|
-
query = "select * from #{db_table} where id = ?"
|
39
|
-
dbh.execute(query, entry_id).fetch_all
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def insert(db_table, values)
|
44
|
-
if values.is_a?(Array)
|
45
|
-
values = values.map{ |x| '"' + DBI.quote(x) + '"' }.join(",")
|
46
|
-
end
|
47
|
-
DBI.connect(*@brdb) do |dbh|
|
48
|
-
query = "insert into #{db_table} values (?);"
|
49
|
-
dbh.execute(query, values)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def update(db_table, entry_id, values)
|
54
|
-
if values.is_a?(Hash)
|
55
|
-
values = values.to_a.map{ |k, v| "#{k}='#{DBI.quote(v)}'" }.join(',')
|
56
|
-
end
|
57
|
-
DBI.connect(*@brdb) do |dbh|
|
58
|
-
query = "update #{db_table} set ? where id = ?"
|
59
|
-
dbh.execute(query, values, entry_id)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
def search(db_table, field, keyword)
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
69
|
-
|
70
|
-
|
71
|
-
if __FILE__ == $0
|
72
|
-
begin
|
73
|
-
require 'pp'
|
74
|
-
alias p pp
|
75
|
-
rescue LoadError
|
76
|
-
end
|
77
|
-
|
78
|
-
db = 'dbi:Mysql:host=db.bioruby.org;database=genbank'
|
79
|
-
user = 'root'
|
80
|
-
|
81
|
-
serv = Bio::BRDB.new(db, user)
|
82
|
-
|
83
|
-
serv.fetch('ent', 'AA2CG').each do |row|
|
84
|
-
p row.to_h
|
85
|
-
end
|
86
|
-
serv.fetch('ft', 'AA2CG').each do |row|
|
87
|
-
p row.to_h
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
|
92
|
-
=begin
|
93
|
-
|
94
|
-
= Bio::BRDB
|
95
|
-
|
96
|
-
--- Bio::BRDB.new(*args)
|
97
|
-
|
98
|
-
--- Bio::BRDB#close
|
99
|
-
--- Bio::BRDB#fetch(db_table, entry_id)
|
100
|
-
--- Bio::BRDB#update(db_table, entry_id, hash)
|
101
|
-
--- Bio::BRDB#insert(db_table, ary)
|
102
|
-
|
103
|
-
=end
|
data/lib/bioruby.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# = bioruby.rb - Loading all BioRuby modules and setup for shell programming
|
3
|
-
#
|
4
|
-
# Copyright:: Copyright (C) 2005
|
5
|
-
# Toshiaki Katayama <k@bioruby.org>
|
6
|
-
# License:: LGPL
|
7
|
-
#
|
8
|
-
# $Id: bioruby.rb,v 1.1 2005/12/07 05:12:06 k Exp $
|
9
|
-
#
|
10
|
-
#--
|
11
|
-
#
|
12
|
-
# This library is free software; you can redistribute it and/or
|
13
|
-
# modify it under the terms of the GNU Lesser General Public
|
14
|
-
# License as published by the Free Software Foundation; either
|
15
|
-
# version 2 of the License, or (at your option) any later version.
|
16
|
-
#
|
17
|
-
# This library is distributed in the hope that it will be useful,
|
18
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20
|
-
# Lesser General Public License for more details.
|
21
|
-
#
|
22
|
-
# You should have received a copy of the GNU Lesser General Public
|
23
|
-
# License along with this library; if not, write to the Free Software
|
24
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
25
|
-
#
|
26
|
-
#++
|
27
|
-
#
|
28
|
-
|
29
|
-
require 'bio/shell'
|
30
|
-
|
31
|
-
include Bio::Shell
|
32
|
-
|
33
|
-
Bio::Shell.setup
|
34
|
-
|