Class: Bio::Hinv

Inherits:
Object show all
Defined in:
lib/bio/io/hinv.rb

Overview

Bio::Hinv

Accessing the H-invDB web services.

Defined Under Namespace

Modules: Common Classes: Acc2hit, Hit2acc, HitCnt, HitDefinition, HitPubmedId, HitXML, Hix2hit, HixCnt, HixRepresent, HixXML, IdSearch, KeywordSearch

Constant Summary collapse

BASE_URI =
"http://h-invitational.jp/hinv/hws/"

Class Method Summary collapse

Class Method Details

.acc2hit(acc) ⇒ Object

Bio::Hinv.acc2hit(“BC053657”) # => “HIT000053961”


35
36
37
38
39
# File 'lib/bio/io/hinv.rb', line 35

def self.acc2hit(acc)
  serv = Acc2hit.new
  serv.query("acc" => acc)
  serv.result
end

.hit2acc(hit) ⇒ Object

Bio::Hinv.hit2acc(“HIT000022181”) # => “AK097327”


42
43
44
45
46
# File 'lib/bio/io/hinv.rb', line 42

def self.hit2acc(hit)
  serv = Hit2acc.new
  serv.query("hit" => hit)
  serv.result
end

.hit_cntObject

Bio::Hinv.hit_cnt # => 187156


49
50
51
52
53
# File 'lib/bio/io/hinv.rb', line 49

def self.hit_cnt
  serv = HitCnt.new
  serv.query
  serv.result
end

.hit_definition(hit) ⇒ Object

Bio::Hinv.hit_definition(“HIT000000001”) # => “Rho guanine …”


56
57
58
59
60
# File 'lib/bio/io/hinv.rb', line 56

def self.hit_definition(hit)
  serv = HitDefinition.new
  serv.query("hit" => hit)
  serv.result
end

.hit_pubmedid(hit) ⇒ Object

Bio::Hinv.hit_pubmedid(“HIT000053961”) # => [7624364, 11279095, … ]


63
64
65
66
67
# File 'lib/bio/io/hinv.rb', line 63

def self.hit_pubmedid(hit)
  serv = HitPubmedId.new
  serv.query("hit" => hit)
  serv.result
end

.hit_xml(hit) ⇒ Object

Bio::Hinv.hit_xml(“HIT000000001”) # => “<?xml version=”1.0“ …”


70
71
72
73
74
# File 'lib/bio/io/hinv.rb', line 70

def self.hit_xml(hit)
  serv = Bio::Hinv::HitXML.new
  serv.query("hit" => hit)
  puts serv.result
end

.hix2hit(hix) ⇒ Object

Bio::Hinv.hix2hit(“HIX0000004”) # => [“HIT000012846”, … ]


77
78
79
80
81
# File 'lib/bio/io/hinv.rb', line 77

def self.hix2hit(hix)
  serv = Bio::Hinv::Hix2hit.new
  serv.query("hix" => hix)
  serv.result
end

.hix_cntObject

Bio::Hinv.hix_cnt # => 36073


84
85
86
87
88
# File 'lib/bio/io/hinv.rb', line 84

def self.hix_cnt
  serv = HixCnt.new
  serv.query
  serv.result
end

.hix_represent(hix) ⇒ Object

Bio::Hinv.hix_represent(“HIX0000001”) # => “HIT000022181”


91
92
93
94
95
# File 'lib/bio/io/hinv.rb', line 91

def self.hix_represent(hix)
  serv = HixRepresent.new
  serv.query("hix" => hix)
  serv.result
end

.id_search(query) ⇒ Object

Bio::Hinv.id_search(“HIT00002218*”) # => [“HIT000022181”, … ]


98
99
100
101
102
# File 'lib/bio/io/hinv.rb', line 98

def self.id_search(query)
  serv = IdSearch.new
  serv.query("query" => query)
  serv.result
end

.keyword_search(query) ⇒ Object

Bio::Hinv.keyword_search(“HIT00002218*”) # => [“HIT000022181”, … ]


105
106
107
108
109
# File 'lib/bio/io/hinv.rb', line 105

def self.keyword_search(query)
  serv = KeywordSearch.new
  serv.query("query" => query)
  serv.result
end