bio 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +3421 -0
- data/KNOWN_ISSUES.rdoc +88 -0
- data/README.rdoc +252 -0
- data/README_DEV.rdoc +285 -0
- data/Rakefile +143 -0
- data/bin/bioruby +0 -0
- data/bin/br_biofetch.rb +0 -0
- data/bin/br_bioflat.rb +12 -1
- data/bin/br_biogetseq.rb +0 -0
- data/bin/br_pmfetch.rb +4 -3
- data/bioruby.gemspec +477 -0
- data/bioruby.gemspec.erb +117 -0
- data/doc/Changes-0.7.rd +7 -0
- data/doc/Changes-1.3.rdoc +239 -0
- data/doc/Tutorial.rd +296 -184
- data/doc/Tutorial.rd.html +1031 -0
- data/doc/Tutorial.rd.ja +111 -45
- data/doc/Tutorial.rd.ja.html +2225 -0
- data/doc/bioruby.css +281 -0
- data/extconf.rb +2 -0
- data/lib/bio.rb +29 -4
- data/lib/bio/appl/blast.rb +306 -121
- data/lib/bio/appl/blast/ddbj.rb +142 -0
- data/lib/bio/appl/blast/format0.rb +35 -25
- data/lib/bio/appl/blast/format8.rb +2 -2
- data/lib/bio/appl/blast/genomenet.rb +263 -0
- data/lib/bio/appl/blast/ncbioptions.rb +220 -0
- data/lib/bio/appl/blast/remote.rb +106 -0
- data/lib/bio/appl/blast/report.rb +260 -9
- data/lib/bio/appl/blast/rexml.rb +12 -5
- data/lib/bio/appl/blast/rpsblast.rb +277 -0
- data/lib/bio/appl/blast/wublast.rb +133 -12
- data/lib/bio/appl/blast/xmlparser.rb +35 -18
- data/lib/bio/appl/blat/report.rb +46 -5
- data/lib/bio/appl/emboss.rb +62 -13
- data/lib/bio/appl/fasta.rb +9 -11
- data/lib/bio/appl/genscan/report.rb +3 -3
- data/lib/bio/appl/hmmer.rb +1 -1
- data/lib/bio/appl/hmmer/report.rb +10 -10
- data/lib/bio/appl/paml/baseml.rb +95 -0
- data/lib/bio/appl/paml/baseml/report.rb +32 -0
- data/lib/bio/appl/paml/codeml.rb +242 -0
- data/lib/bio/appl/paml/codeml/rates.rb +67 -0
- data/lib/bio/appl/paml/codeml/report.rb +67 -0
- data/lib/bio/appl/paml/common.rb +348 -0
- data/lib/bio/appl/paml/common_report.rb +38 -0
- data/lib/bio/appl/paml/yn00.rb +103 -0
- data/lib/bio/appl/paml/yn00/report.rb +32 -0
- data/lib/bio/appl/psort.rb +2 -2
- data/lib/bio/appl/pts1.rb +5 -5
- data/lib/bio/appl/tmhmm/report.rb +10 -1
- data/lib/bio/command.rb +297 -41
- data/lib/bio/compat/features.rb +157 -0
- data/lib/bio/compat/references.rb +128 -0
- data/lib/bio/db/biosql/biosql_to_biosequence.rb +67 -0
- data/lib/bio/db/biosql/sequence.rb +508 -0
- data/lib/bio/db/embl/common.rb +28 -12
- data/lib/bio/db/embl/embl.rb +107 -9
- data/lib/bio/db/embl/embl_to_biosequence.rb +85 -0
- data/lib/bio/db/embl/format_embl.rb +190 -0
- data/lib/bio/db/embl/sptr.rb +15 -16
- data/lib/bio/db/fantom.rb +6 -8
- data/lib/bio/db/fasta.rb +10 -507
- data/lib/bio/db/fasta/defline.rb +532 -0
- data/lib/bio/db/fasta/fasta_to_biosequence.rb +63 -0
- data/lib/bio/db/fasta/format_fasta.rb +97 -0
- data/lib/bio/db/genbank/common.rb +25 -8
- data/lib/bio/db/genbank/format_genbank.rb +187 -0
- data/lib/bio/db/genbank/genbank.rb +36 -1
- data/lib/bio/db/genbank/genbank_to_biosequence.rb +86 -0
- data/lib/bio/db/gff.rb +1791 -119
- data/lib/bio/db/kegg/glycan.rb +2 -6
- data/lib/bio/db/lasergene.rb +3 -3
- data/lib/bio/db/medline.rb +4 -1
- data/lib/bio/db/newick.rb +10 -10
- data/lib/bio/db/pdb/chain.rb +6 -2
- data/lib/bio/db/pdb/pdb.rb +12 -3
- data/lib/bio/db/rebase.rb +7 -8
- data/lib/bio/db/soft.rb +3 -3
- data/lib/bio/feature.rb +1 -88
- data/lib/bio/io/biosql/biodatabase.rb +64 -0
- data/lib/bio/io/biosql/bioentry.rb +29 -0
- data/lib/bio/io/biosql/bioentry_dbxref.rb +11 -0
- data/lib/bio/io/biosql/bioentry_path.rb +12 -0
- data/lib/bio/io/biosql/bioentry_qualifier_value.rb +10 -0
- data/lib/bio/io/biosql/bioentry_reference.rb +10 -0
- data/lib/bio/io/biosql/bioentry_relationship.rb +10 -0
- data/lib/bio/io/biosql/biosequence.rb +11 -0
- data/lib/bio/io/biosql/comment.rb +7 -0
- data/lib/bio/io/biosql/config/database.yml +20 -0
- data/lib/bio/io/biosql/dbxref.rb +13 -0
- data/lib/bio/io/biosql/dbxref_qualifier_value.rb +12 -0
- data/lib/bio/io/biosql/location.rb +32 -0
- data/lib/bio/io/biosql/location_qualifier_value.rb +11 -0
- data/lib/bio/io/biosql/ontology.rb +10 -0
- data/lib/bio/io/biosql/reference.rb +9 -0
- data/lib/bio/io/biosql/seqfeature.rb +32 -0
- data/lib/bio/io/biosql/seqfeature_dbxref.rb +11 -0
- data/lib/bio/io/biosql/seqfeature_path.rb +11 -0
- data/lib/bio/io/biosql/seqfeature_qualifier_value.rb +20 -0
- data/lib/bio/io/biosql/seqfeature_relationship.rb +11 -0
- data/lib/bio/io/biosql/taxon.rb +12 -0
- data/lib/bio/io/biosql/taxon_name.rb +9 -0
- data/lib/bio/io/biosql/term.rb +27 -0
- data/lib/bio/io/biosql/term_dbxref.rb +11 -0
- data/lib/bio/io/biosql/term_path.rb +12 -0
- data/lib/bio/io/biosql/term_relationship.rb +13 -0
- data/lib/bio/io/biosql/term_relationship_term.rb +11 -0
- data/lib/bio/io/biosql/term_synonym.rb +10 -0
- data/lib/bio/io/das.rb +7 -7
- data/lib/bio/io/ddbjxml.rb +57 -0
- data/lib/bio/io/ensembl.rb +2 -2
- data/lib/bio/io/fetch.rb +28 -14
- data/lib/bio/io/flatfile.rb +17 -853
- data/lib/bio/io/flatfile/autodetection.rb +545 -0
- data/lib/bio/io/flatfile/buffer.rb +237 -0
- data/lib/bio/io/flatfile/index.rb +17 -7
- data/lib/bio/io/flatfile/indexer.rb +30 -12
- data/lib/bio/io/flatfile/splitter.rb +297 -0
- data/lib/bio/io/hinv.rb +442 -0
- data/lib/bio/io/keggapi.rb +2 -2
- data/lib/bio/io/ncbirest.rb +733 -0
- data/lib/bio/io/pubmed.rb +34 -80
- data/lib/bio/io/registry.rb +2 -2
- data/lib/bio/io/sql.rb +178 -357
- data/lib/bio/io/togows.rb +458 -0
- data/lib/bio/location.rb +106 -11
- data/lib/bio/pathway.rb +120 -14
- data/lib/bio/reference.rb +115 -101
- data/lib/bio/sequence.rb +164 -183
- data/lib/bio/sequence/adapter.rb +108 -0
- data/lib/bio/sequence/common.rb +22 -45
- data/lib/bio/sequence/compat.rb +2 -2
- data/lib/bio/sequence/dblink.rb +54 -0
- data/lib/bio/sequence/format.rb +254 -77
- data/lib/bio/sequence/format_raw.rb +23 -0
- data/lib/bio/shell.rb +3 -1
- data/lib/bio/shell/core.rb +2 -2
- data/lib/bio/shell/plugin/entry.rb +33 -4
- data/lib/bio/shell/plugin/ncbirest.rb +64 -0
- data/lib/bio/shell/plugin/togows.rb +40 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/bioruby_generator.rb +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_classes.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_log.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_methods.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_modules.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_variables.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby-bg.gif +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby-gem.png +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby-link.gif +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby.css +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby_controller.rb +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby_helper.rb +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/commands.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/history.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/index.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/spinner.gif +0 -0
- data/lib/bio/tree.rb +4 -2
- data/lib/bio/util/color_scheme.rb +2 -2
- data/lib/bio/util/contingency_table.rb +2 -2
- data/lib/bio/util/restriction_enzyme.rb +2 -2
- data/lib/bio/util/restriction_enzyme/single_strand.rb +6 -5
- data/lib/bio/version.rb +25 -0
- data/rdoc.zsh +8 -0
- data/sample/any2fasta.rb +0 -0
- data/sample/biofetch.rb +0 -0
- data/sample/dbget +0 -0
- data/sample/demo_sequence.rb +158 -0
- data/sample/enzymes.rb +0 -0
- data/sample/fasta2tab.rb +0 -0
- data/sample/fastagrep.rb +72 -0
- data/sample/fastasort.rb +54 -0
- data/sample/fsplit.rb +0 -0
- data/sample/gb2fasta.rb +2 -3
- data/sample/gb2tab.rb +0 -0
- data/sample/gbtab2mysql.rb +0 -0
- data/sample/genes2nuc.rb +0 -0
- data/sample/genes2pep.rb +0 -0
- data/sample/genes2tab.rb +0 -0
- data/sample/genome2rb.rb +0 -0
- data/sample/genome2tab.rb +0 -0
- data/sample/goslim.rb +0 -0
- data/sample/gt2fasta.rb +0 -0
- data/sample/na2aa.rb +34 -0
- data/sample/pmfetch.rb +0 -0
- data/sample/pmsearch.rb +0 -0
- data/sample/ssearch2tab.rb +0 -0
- data/sample/tfastx2tab.rb +0 -0
- data/sample/vs-genes.rb +0 -0
- data/setup.rb +1596 -0
- data/test/data/blast/blastp-multi.m7 +188 -0
- data/test/data/command/echoarg2.bat +1 -0
- data/test/data/paml/codeml/control_file.txt +30 -0
- data/test/data/paml/codeml/output.txt +78 -0
- data/test/data/paml/codeml/rates +217 -0
- data/test/data/rpsblast/misc.rpsblast +193 -0
- data/test/data/soft/GDS100_partial.soft +0 -0
- data/test/data/soft/GSE3457_family_partial.soft +0 -0
- data/test/functional/bio/appl/test_pts1.rb +115 -0
- data/test/functional/bio/io/test_ensembl.rb +123 -80
- data/test/functional/bio/io/test_togows.rb +267 -0
- data/test/functional/bio/sequence/test_output_embl.rb +51 -0
- data/test/functional/bio/test_command.rb +301 -0
- data/test/runner.rb +17 -1
- data/test/unit/bio/appl/blast/test_ncbioptions.rb +112 -0
- data/test/unit/bio/appl/blast/test_report.rb +753 -35
- data/test/unit/bio/appl/blast/test_rpsblast.rb +398 -0
- data/test/unit/bio/appl/paml/codeml/test_rates.rb +45 -0
- data/test/unit/bio/appl/paml/codeml/test_report.rb +45 -0
- data/test/unit/bio/appl/paml/test_codeml.rb +174 -0
- data/test/unit/bio/appl/test_blast.rb +135 -4
- data/test/unit/bio/appl/test_fasta.rb +2 -2
- data/test/unit/bio/appl/test_pts1.rb +1 -64
- data/test/unit/bio/db/embl/test_common.rb +15 -15
- data/test/unit/bio/db/embl/test_embl.rb +4 -4
- data/test/unit/bio/db/embl/test_embl_rel89.rb +5 -5
- data/test/unit/bio/db/embl/test_embl_to_bioseq.rb +203 -0
- data/test/unit/bio/db/embl/test_sptr.rb +38 -1
- data/test/unit/bio/db/pdb/test_pdb.rb +2 -2
- data/test/unit/bio/db/test_gff.rb +1151 -25
- data/test/unit/bio/db/test_medline.rb +127 -0
- data/test/unit/bio/db/test_nexus.rb +5 -1
- data/test/unit/bio/db/test_prosite.rb +4 -4
- data/test/unit/bio/io/flatfile/test_autodetection.rb +375 -0
- data/test/unit/bio/io/flatfile/test_buffer.rb +251 -0
- data/test/unit/bio/io/flatfile/test_splitter.rb +369 -0
- data/test/unit/bio/io/test_ddbjxml.rb +8 -3
- data/test/unit/bio/io/test_fastacmd.rb +5 -5
- data/test/unit/bio/io/test_flatfile.rb +357 -106
- data/test/unit/bio/io/test_soapwsdl.rb +2 -2
- data/test/unit/bio/io/test_togows.rb +161 -0
- data/test/unit/bio/sequence/test_common.rb +210 -11
- data/test/unit/bio/sequence/test_compat.rb +3 -3
- data/test/unit/bio/sequence/test_dblink.rb +58 -0
- data/test/unit/bio/sequence/test_na.rb +2 -2
- data/test/unit/bio/test_command.rb +111 -50
- data/test/unit/bio/test_feature.rb +29 -1
- data/test/unit/bio/test_location.rb +566 -6
- data/test/unit/bio/test_pathway.rb +91 -65
- data/test/unit/bio/test_reference.rb +67 -13
- data/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb +4 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_analysis.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb +4 -4
- data/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_single_strand.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb +3 -3
- data/test/unit/bio/util/test_restriction_enzyme.rb +3 -3
- metadata +202 -167
- data/test/unit/bio/appl/blast/test_xmlparser.rb +0 -388
data/lib/bio/io/hinv.rb
ADDED
@@ -0,0 +1,442 @@
|
|
1
|
+
#
|
2
|
+
# = bio/io/hinv.rb - H-invDB web service (REST) client module
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2008 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
# $Id:$
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'bio/command'
|
11
|
+
require 'rexml/document'
|
12
|
+
|
13
|
+
module Bio
|
14
|
+
|
15
|
+
# = Bio::Hinv
|
16
|
+
#
|
17
|
+
# Accessing the H-invDB web services.
|
18
|
+
#
|
19
|
+
# * http://www.h-invitational.jp/
|
20
|
+
# * http://www.jbirc.aist.go.jp/hinv/hws/doc/index.html
|
21
|
+
#
|
22
|
+
class Hinv
|
23
|
+
|
24
|
+
BASE_URI = "http://www.jbirc.aist.go.jp/hinv/hws/"
|
25
|
+
|
26
|
+
module Common
|
27
|
+
def query(options = nil)
|
28
|
+
response = Bio::Command.post_form(@url, options)
|
29
|
+
@result = response.body
|
30
|
+
@xml = REXML::Document.new(@result)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
# Bio::Hinv.acc2hit("BC053657") # => "HIT000053961"
|
36
|
+
def self.acc2hit(acc)
|
37
|
+
serv = Acc2hit.new
|
38
|
+
serv.query("acc" => acc)
|
39
|
+
serv.result
|
40
|
+
end
|
41
|
+
|
42
|
+
# Bio::Hinv.hit2acc("HIT000022181") # => "AK097327"
|
43
|
+
def self.hit2acc(hit)
|
44
|
+
serv = Hit2acc.new
|
45
|
+
serv.query("hit" => hit)
|
46
|
+
serv.result
|
47
|
+
end
|
48
|
+
|
49
|
+
# Bio::Hinv.hit_cnt # => 187156
|
50
|
+
def self.hit_cnt
|
51
|
+
serv = HitCnt.new
|
52
|
+
serv.query
|
53
|
+
serv.result
|
54
|
+
end
|
55
|
+
|
56
|
+
# Bio::Hinv.hit_definition("HIT000000001") # => "Rho guanine ..."
|
57
|
+
def self.hit_definition(hit)
|
58
|
+
serv = HitDefinition.new
|
59
|
+
serv.query("hit" => hit)
|
60
|
+
serv.result
|
61
|
+
end
|
62
|
+
|
63
|
+
# Bio::Hinv.hit_pubmedid("HIT000053961") # => [7624364, 11279095, ... ]
|
64
|
+
def self.hit_pubmedid(hit)
|
65
|
+
serv = HitPubmedId.new
|
66
|
+
serv.query("hit" => hit)
|
67
|
+
serv.result
|
68
|
+
end
|
69
|
+
|
70
|
+
# Bio::Hinv.hit_xml("HIT000000001") # => "<?xml version="1.0" ..."
|
71
|
+
def self.hit_xml(hit)
|
72
|
+
serv = Bio::Hinv::HitXML.new
|
73
|
+
serv.query("hit" => hit)
|
74
|
+
puts serv.result
|
75
|
+
end
|
76
|
+
|
77
|
+
# Bio::Hinv.hix2hit("HIX0000004") # => ["HIT000012846", ... ]
|
78
|
+
def self.hix2hit(hix)
|
79
|
+
serv = Bio::Hinv::Hix2hit.new
|
80
|
+
serv.query("hix" => hix)
|
81
|
+
serv.result
|
82
|
+
end
|
83
|
+
|
84
|
+
# Bio::Hinv.hix_cnt # => 36073
|
85
|
+
def self.hix_cnt
|
86
|
+
serv = HixCnt.new
|
87
|
+
serv.query
|
88
|
+
serv.result
|
89
|
+
end
|
90
|
+
|
91
|
+
# Bio::Hinv.hix_represent("HIX0000001") # => "HIT000022181"
|
92
|
+
def self.hix_represent(hix)
|
93
|
+
serv = HixRepresent.new
|
94
|
+
serv.query("hix" => hix)
|
95
|
+
serv.result
|
96
|
+
end
|
97
|
+
|
98
|
+
# Bio::Hinv.id_search("HIT00002218*") # => ["HIT000022181", ... ]
|
99
|
+
def self.id_search(query)
|
100
|
+
serv = IdSearch.new
|
101
|
+
serv.query("query" => query)
|
102
|
+
serv.result
|
103
|
+
end
|
104
|
+
|
105
|
+
# Bio::Hinv.keyword_search("HIT00002218*") # => ["HIT000022181", ... ]
|
106
|
+
def self.keyword_search(query)
|
107
|
+
serv = KeywordSearch.new
|
108
|
+
serv.query("query" => query)
|
109
|
+
serv.result
|
110
|
+
end
|
111
|
+
|
112
|
+
|
113
|
+
# serv = Bio::Hinv::Acc2hit.new
|
114
|
+
# serv.query("acc" => "BC053657")
|
115
|
+
# puts serv.result
|
116
|
+
class Acc2hit
|
117
|
+
include Common
|
118
|
+
|
119
|
+
def initialize
|
120
|
+
@url = BASE_URI + "acc2hit.php"
|
121
|
+
end
|
122
|
+
|
123
|
+
# <?xml version='1.0' encoding='UTF-8'?>
|
124
|
+
# <H-Inv>
|
125
|
+
# <H-INVITATIONAL-ID>HIT000053961</H-INVITATIONAL-ID>
|
126
|
+
# </H-Inv>
|
127
|
+
def result
|
128
|
+
@xml.elements['//H-INVITATIONAL-ID'].text
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
# serv = Bio::Hinv::Hit2acc.new
|
133
|
+
# serv.query("hit" => "HIT000022181")
|
134
|
+
# puts serv.result
|
135
|
+
class Hit2acc
|
136
|
+
include Common
|
137
|
+
|
138
|
+
def initialize
|
139
|
+
@url = BASE_URI + "hit2acc.php"
|
140
|
+
end
|
141
|
+
|
142
|
+
# <?xml version='1.0' encoding='UTF-8'?>
|
143
|
+
# <H-Inv>
|
144
|
+
# <ACCESSION-NO>AK097327</ACCESSION-NO>
|
145
|
+
# </H-Inv>
|
146
|
+
def result
|
147
|
+
@xml.elements['//ACCESSION-NO'].text
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
# serv = Bio::Hinv::HitCnt.new
|
152
|
+
# serv.query
|
153
|
+
# puts serv.result
|
154
|
+
class HitCnt
|
155
|
+
include Common
|
156
|
+
|
157
|
+
def initialize
|
158
|
+
@url = BASE_URI + "hit_cnt.php"
|
159
|
+
end
|
160
|
+
|
161
|
+
# <?xml version='1.0' encoding='UTF-8'?>
|
162
|
+
# <H-Inv>
|
163
|
+
# <TRANSCRIPT_CNT>187156</TRANSCRIPT_CNT>
|
164
|
+
# </H-Inv>
|
165
|
+
def result
|
166
|
+
@xml.elements['//TRANSCRIPT_CNT'].text.to_i
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
# serv = Bio::Hinv::HitDefinition.new
|
171
|
+
# serv.query("hit" => "HIT000000001")
|
172
|
+
# puts serv.result
|
173
|
+
# puts serv.data_source_definition
|
174
|
+
# puts serv.cdna_rep_h_invitational
|
175
|
+
# puts serv.cdna_splicing_isoform_curation
|
176
|
+
# puts serv.data_source_db_reference_protein_motif_id
|
177
|
+
# puts serv.data_source_identity
|
178
|
+
# puts serv.data_source_coverage
|
179
|
+
# puts serv.data_source_homologous_species
|
180
|
+
# puts serv.data_source_similarity_category
|
181
|
+
class HitDefinition
|
182
|
+
include Common
|
183
|
+
|
184
|
+
def initialize
|
185
|
+
@url = BASE_URI + "hit_definition.php"
|
186
|
+
end
|
187
|
+
|
188
|
+
# <?xml version='1.0' encoding='UTF-8'?>
|
189
|
+
# <H-Inv>
|
190
|
+
# <HIT_FUNCTION>
|
191
|
+
# <H-INVITATIONAL-ID>HIT000000001</H-INVITATIONAL-ID>
|
192
|
+
# <DATA-SOURCE_DEFINITION>Rho guanine nucleotide exchange factor 10.</DATA-SOURCE_DEFINITION>
|
193
|
+
# <CDNA_REP-H-INVITATIONAL>Representative transcript</CDNA_REP-H-INVITATIONAL>
|
194
|
+
# <CDNA_SPLICING-ISOFORM_CURATION></CDNA_SPLICING-ISOFORM_CURATION>
|
195
|
+
# <DATA-SOURCE_DB-REFERENCE_PROTEIN-MOTIF-ID>NP_055444</DATA-SOURCE_DB-REFERENCE_PROTEIN-MOTIF-ID>
|
196
|
+
# <DATA-SOURCE_IDENTITY>100.0</DATA-SOURCE_IDENTITY>
|
197
|
+
# <DATA-SOURCE_COVERAGE>100.0</DATA-SOURCE_COVERAGE>
|
198
|
+
# <DATA-SOURCE_HOMOLOGOUS_SPECIES>Homo sapiens</DATA-SOURCE_HOMOLOGOUS_SPECIES>
|
199
|
+
# <DATA-SOURCE_SIMILARITY-CATEGORY>Identical to known human protein(Category I).</DATA-SOURCE_SIMILARITY-CATEGORY>
|
200
|
+
# </HIT_FUNCTION>
|
201
|
+
# </H-Inv>
|
202
|
+
def result
|
203
|
+
@xml.elements['//DATA-SOURCE_DEFINITION'].text
|
204
|
+
end
|
205
|
+
alias :data_source_definition :result
|
206
|
+
|
207
|
+
def cdna_rep_h_invitational
|
208
|
+
@xml.elements['//CDNA_REP-H-INVITATIONAL'].text
|
209
|
+
end
|
210
|
+
def cdna_splicing_isoform_curation
|
211
|
+
@xml.elements['//CDNA_SPLICING-ISOFORM_CURATION'].text
|
212
|
+
end
|
213
|
+
def data_source_db_reference_protein_motif_id
|
214
|
+
@xml.elements['//DATA-SOURCE_DB-REFERENCE_PROTEIN-MOTIF-ID'].text
|
215
|
+
end
|
216
|
+
def data_source_identity
|
217
|
+
@xml.elements['//DATA-SOURCE_IDENTITY'].text.to_f
|
218
|
+
end
|
219
|
+
def data_source_coverage
|
220
|
+
@xml.elements['//DATA-SOURCE_COVERAGE'].text.to_f
|
221
|
+
end
|
222
|
+
def data_source_homologous_species
|
223
|
+
@xml.elements['//DATA-SOURCE_HOMOLOGOUS_SPECIES'].text
|
224
|
+
end
|
225
|
+
def data_source_similarity_category
|
226
|
+
@xml.elements['//DATA-SOURCE_SIMILARITY-CATEGORY'].text
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
# serv = Bio::Hinv::HitPubmedId.new
|
231
|
+
# serv.query("hit" => "HIT000053961")
|
232
|
+
# puts serv.result
|
233
|
+
class HitPubmedId
|
234
|
+
include Common
|
235
|
+
|
236
|
+
def initialize
|
237
|
+
@url = BASE_URI + "hit_pubmedid.php"
|
238
|
+
end
|
239
|
+
|
240
|
+
# <?xml version='1.0' encoding='UTF-8'?>
|
241
|
+
# <H-Inv>
|
242
|
+
# <CDNA_DB-REFERENCE_PUBMED>7624364</CDNA_DB-REFERENCE_PUBMED>
|
243
|
+
# <CDNA_DB-REFERENCE_PUBMED>11279095</CDNA_DB-REFERENCE_PUBMED>
|
244
|
+
# <CDNA_DB-REFERENCE_PUBMED>15489334</CDNA_DB-REFERENCE_PUBMED>
|
245
|
+
# </H-Inv>
|
246
|
+
def result
|
247
|
+
list = []
|
248
|
+
@xml.elements.each('//CDNA_DB-REFERENCE_PUBMED') do |e|
|
249
|
+
list << e.text.to_i
|
250
|
+
end
|
251
|
+
return list
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
# serv = Bio::Hinv::HitXML.new
|
256
|
+
# serv.query("hit" => "HIT000000001")
|
257
|
+
# puts serv.result
|
258
|
+
class HitXML
|
259
|
+
include Common
|
260
|
+
|
261
|
+
def initialize
|
262
|
+
@url = BASE_URI + "hit_xml.php"
|
263
|
+
end
|
264
|
+
|
265
|
+
# <?xml version="1.0" standalone="yes" ?>
|
266
|
+
# <H-Inv>
|
267
|
+
# <cDNAXML>
|
268
|
+
# <CLUSTER-ID>HIX0021591</CLUSTER-ID>
|
269
|
+
# <CLUSTER-ID-VERSION>HIX0021591.11</CLUSTER-ID-VERSION>
|
270
|
+
# <H-INVITATIONAL-ID>HIT000000001</H-INVITATIONAL-ID>
|
271
|
+
# :
|
272
|
+
# </PROBE-MAPPING>
|
273
|
+
# </EXPRESSION>
|
274
|
+
# </cDNAXML>
|
275
|
+
# </H-Inv>
|
276
|
+
def result
|
277
|
+
@result
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
# serv = Bio::Hinv::Hix2hit.new
|
282
|
+
# serv.query("hix" => "HIX0000004")
|
283
|
+
# puts serv.result
|
284
|
+
class Hix2hit
|
285
|
+
include Common
|
286
|
+
|
287
|
+
def initialize
|
288
|
+
@url = BASE_URI + "hix2hit.php"
|
289
|
+
end
|
290
|
+
|
291
|
+
# <?xml version='1.0' encoding='UTF-8'?>
|
292
|
+
# <H-Inv>
|
293
|
+
# <H-INVITATIONAL-ID>HIT000012846</H-INVITATIONAL-ID>
|
294
|
+
# <H-INVITATIONAL-ID>HIT000022124</H-INVITATIONAL-ID>
|
295
|
+
# <H-INVITATIONAL-ID>HIT000007722</H-INVITATIONAL-ID>
|
296
|
+
# :
|
297
|
+
# <H-INVITATIONAL-ID>HIT000262478</H-INVITATIONAL-ID>
|
298
|
+
# </H-Inv>
|
299
|
+
def result
|
300
|
+
list = []
|
301
|
+
@xml.elements.each('//H-INVITATIONAL-ID') do |e|
|
302
|
+
list << e.text
|
303
|
+
end
|
304
|
+
return list
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
# serv = Bio::Hinv::HixCnt.new
|
309
|
+
# serv.query
|
310
|
+
# puts serv.result
|
311
|
+
class HixCnt
|
312
|
+
include Common
|
313
|
+
|
314
|
+
def initialize
|
315
|
+
@url = BASE_URI + "hix_cnt.php"
|
316
|
+
end
|
317
|
+
|
318
|
+
# <?xml version='1.0' encoding='UTF-8'?>
|
319
|
+
# <H-Inv>
|
320
|
+
# <LOCUS_CNT>36073</LOCUS_CNT>
|
321
|
+
# </H-Inv>
|
322
|
+
def result
|
323
|
+
@xml.elements['//LOCUS_CNT'].text.to_i
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
327
|
+
# serv = Bio::Hinv::HixRepresent.new
|
328
|
+
# serv.query("hix" => "HIX0000001")
|
329
|
+
# puts serv.result
|
330
|
+
# puts serv.rep_h_invitational_id
|
331
|
+
# puts serv.rep_accession_no
|
332
|
+
class HixRepresent
|
333
|
+
include Common
|
334
|
+
|
335
|
+
def initialize
|
336
|
+
@url = BASE_URI + "hix_represent.php"
|
337
|
+
end
|
338
|
+
|
339
|
+
# <?xml version='1.0' encoding='UTF-8'?>
|
340
|
+
# <H-Inv>
|
341
|
+
# <LOCUS>
|
342
|
+
# <CLUSTER-ID>HIX0000001</CLUSTER-ID>
|
343
|
+
# <REP-H-INVITATIONAL-ID>HIT000022181</REP-H-INVITATIONAL-ID>
|
344
|
+
# <REP-ACCESSION-NO>AK097327</REP-ACCESSION-NO>
|
345
|
+
# </LOCUS>
|
346
|
+
# </H-Inv>
|
347
|
+
def result
|
348
|
+
@xml.elements['//REP-H-INVITATIONAL-ID'].text
|
349
|
+
end
|
350
|
+
alias :rep_h_invitational_id :result
|
351
|
+
|
352
|
+
def rep_accession_no
|
353
|
+
@xml.elements['//REP-ACCESSION-NO'].text
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
# example at "http://www.jbirc.aist.go.jp/hinv/hws/doc/index_jp.html"
|
358
|
+
# is for hit_xml.php (not for hix_xml.php)
|
359
|
+
class HixXML
|
360
|
+
end
|
361
|
+
|
362
|
+
# serv = Bio::Hinv::KeywordSearch.new
|
363
|
+
# serv.query("query" => "HIT00002218*", "start" => 1, "end" => 100)
|
364
|
+
# puts serv.result
|
365
|
+
# puts serv.size
|
366
|
+
# puts serv.start
|
367
|
+
# puts serv.end
|
368
|
+
class KeywordSearch
|
369
|
+
include Common
|
370
|
+
|
371
|
+
def initialize
|
372
|
+
@url = BASE_URI + "keyword_search.php"
|
373
|
+
end
|
374
|
+
|
375
|
+
def query(hash = {})
|
376
|
+
default = {
|
377
|
+
"start" => 1,
|
378
|
+
"end" => 100
|
379
|
+
}
|
380
|
+
options = default.update(hash)
|
381
|
+
super(options)
|
382
|
+
end
|
383
|
+
|
384
|
+
# <?xml version='1.0' encoding='UTF-8'?>
|
385
|
+
# <HINVDB_SEARCH>
|
386
|
+
# <QUERY>HIT00002218*</QUERY>
|
387
|
+
# <SIZE>8</SIZE>
|
388
|
+
# <START>1</START>
|
389
|
+
# <END>8</END>
|
390
|
+
# <H-INVITATIONAL-ID>HIT000022180</H-INVITATIONAL-ID>
|
391
|
+
# <H-INVITATIONAL-ID>HIT000022181</H-INVITATIONAL-ID>
|
392
|
+
# <H-INVITATIONAL-ID>HIT000022183</H-INVITATIONAL-ID>
|
393
|
+
# <H-INVITATIONAL-ID>HIT000022184</H-INVITATIONAL-ID>
|
394
|
+
# <H-INVITATIONAL-ID>HIT000022185</H-INVITATIONAL-ID>
|
395
|
+
# <H-INVITATIONAL-ID>HIT000022186</H-INVITATIONAL-ID>
|
396
|
+
# <H-INVITATIONAL-ID>HIT000022188</H-INVITATIONAL-ID>
|
397
|
+
# <H-INVITATIONAL-ID>HIT000022189</H-INVITATIONAL-ID>
|
398
|
+
# </HINVDB_SEARCH>
|
399
|
+
def result
|
400
|
+
list = []
|
401
|
+
@xml.elements.each('//H-INVITATIONAL-ID') do |e|
|
402
|
+
list << e.text
|
403
|
+
end
|
404
|
+
return list
|
405
|
+
end
|
406
|
+
|
407
|
+
def size
|
408
|
+
@xml.elements['//SIZE'].text.to_i
|
409
|
+
end
|
410
|
+
def start
|
411
|
+
@xml.elements['//START'].text.to_i
|
412
|
+
end
|
413
|
+
def end
|
414
|
+
@xml.elements['//END'].text.to_i
|
415
|
+
end
|
416
|
+
end
|
417
|
+
|
418
|
+
# serv = Bio::Hinv::IdSearch.new
|
419
|
+
# serv.query("query" => "HIT00002218*", "id_type" => "H-INVITATIONAL-ID", "start" => 1, "end" => 100)
|
420
|
+
# puts serv.result
|
421
|
+
# puts serv.size
|
422
|
+
# puts serv.start
|
423
|
+
# puts serv.end
|
424
|
+
class IdSearch < KeywordSearch
|
425
|
+
def initialize
|
426
|
+
@url = BASE_URI + "id_search.php"
|
427
|
+
end
|
428
|
+
|
429
|
+
def query(hash = {})
|
430
|
+
default = {
|
431
|
+
"id_type" => "H-INVITATIONAL-ID",
|
432
|
+
"start" => 1,
|
433
|
+
"end" => 100
|
434
|
+
}
|
435
|
+
options = default.update(hash)
|
436
|
+
super(options)
|
437
|
+
end
|
438
|
+
end
|
439
|
+
|
440
|
+
end
|
441
|
+
end
|
442
|
+
|
data/lib/bio/io/keggapi.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# Copyright:: Copyright (C) 2003, 2004 Toshiaki Katayama <k@bioruby.org>
|
5
5
|
# License:: The Ruby License
|
6
6
|
#
|
7
|
-
# $Id
|
7
|
+
# $Id:$
|
8
8
|
#
|
9
9
|
|
10
10
|
require 'bio/io/soapwsdl'
|
@@ -269,7 +269,7 @@ class API < Bio::SOAPWSDL
|
|
269
269
|
filename ||= File.basename(path)
|
270
270
|
|
271
271
|
http = Bio::Command.new_http(host, port)
|
272
|
-
response
|
272
|
+
response = http.get(path)
|
273
273
|
File.open(filename, "w+") do |f|
|
274
274
|
f.print response.body
|
275
275
|
end
|