bio 1.4.3.0001 → 1.5.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.
Files changed (158) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +39 -33
  3. data/BSDL +22 -0
  4. data/COPYING +2 -2
  5. data/COPYING.ja +36 -36
  6. data/ChangeLog +2404 -1025
  7. data/KNOWN_ISSUES.rdoc +15 -55
  8. data/README.rdoc +17 -23
  9. data/RELEASE_NOTES.rdoc +246 -183
  10. data/Rakefile +3 -2
  11. data/bin/br_biofetch.rb +29 -5
  12. data/bioruby.gemspec +15 -32
  13. data/bioruby.gemspec.erb +10 -20
  14. data/doc/ChangeLog-1.4.3 +1478 -0
  15. data/doc/RELEASE_NOTES-1.4.3.rdoc +204 -0
  16. data/doc/Tutorial.rd +0 -6
  17. data/doc/Tutorial.rd.html +7 -12
  18. data/doc/Tutorial.rd.ja +960 -1064
  19. data/doc/Tutorial.rd.ja.html +977 -1067
  20. data/gemfiles/Gemfile.travis-jruby1.8 +2 -1
  21. data/gemfiles/Gemfile.travis-jruby1.9 +2 -4
  22. data/gemfiles/Gemfile.travis-rbx +13 -0
  23. data/gemfiles/Gemfile.travis-ruby1.8 +2 -1
  24. data/gemfiles/Gemfile.travis-ruby1.9 +2 -4
  25. data/gemfiles/Gemfile.travis-ruby2.2 +9 -0
  26. data/lib/bio.rb +10 -43
  27. data/lib/bio/alignment.rb +8 -14
  28. data/lib/bio/appl/blast.rb +1 -2
  29. data/lib/bio/appl/blast/format0.rb +18 -7
  30. data/lib/bio/appl/blast/remote.rb +0 -9
  31. data/lib/bio/appl/blast/report.rb +1 -1
  32. data/lib/bio/appl/clustalw/report.rb +3 -1
  33. data/lib/bio/appl/genscan/report.rb +1 -2
  34. data/lib/bio/appl/iprscan/report.rb +1 -2
  35. data/lib/bio/appl/meme/mast.rb +4 -4
  36. data/lib/bio/appl/meme/mast/report.rb +1 -1
  37. data/lib/bio/appl/paml/codeml.rb +2 -2
  38. data/lib/bio/appl/paml/codeml/report.rb +1 -0
  39. data/lib/bio/appl/paml/common.rb +1 -1
  40. data/lib/bio/appl/sosui/report.rb +1 -2
  41. data/lib/bio/command.rb +62 -2
  42. data/lib/bio/data/aa.rb +13 -31
  43. data/lib/bio/data/codontable.rb +1 -2
  44. data/lib/bio/db/biosql/biosql_to_biosequence.rb +1 -0
  45. data/lib/bio/db/biosql/sequence.rb +1 -1
  46. data/lib/bio/db/embl/common.rb +1 -1
  47. data/lib/bio/db/embl/embl.rb +5 -4
  48. data/lib/bio/db/embl/format_embl.rb +3 -3
  49. data/lib/bio/db/embl/sptr.rb +9 -1444
  50. data/lib/bio/db/embl/swissprot.rb +12 -29
  51. data/lib/bio/db/embl/trembl.rb +13 -30
  52. data/lib/bio/db/embl/uniprot.rb +12 -29
  53. data/lib/bio/db/embl/uniprotkb.rb +1455 -0
  54. data/lib/bio/db/fasta.rb +17 -0
  55. data/lib/bio/db/fasta/defline.rb +1 -3
  56. data/lib/bio/db/fastq.rb +1 -1
  57. data/lib/bio/db/genbank/ddbj.rb +9 -5
  58. data/lib/bio/db/genbank/refseq.rb +11 -3
  59. data/lib/bio/db/gff.rb +3 -4
  60. data/lib/bio/db/go.rb +5 -6
  61. data/lib/bio/db/kegg/module.rb +4 -5
  62. data/lib/bio/db/kegg/pathway.rb +4 -5
  63. data/lib/bio/db/kegg/reaction.rb +1 -1
  64. data/lib/bio/db/nexus.rb +3 -2
  65. data/lib/bio/db/pdb/pdb.rb +2 -2
  66. data/lib/bio/db/phyloxml/phyloxml_elements.rb +82 -59
  67. data/lib/bio/db/phyloxml/phyloxml_parser.rb +2 -2
  68. data/lib/bio/db/phyloxml/phyloxml_writer.rb +1 -2
  69. data/lib/bio/db/sanger_chromatogram/chromatogram.rb +1 -2
  70. data/lib/bio/db/transfac.rb +1 -1
  71. data/lib/bio/io/das.rb +40 -41
  72. data/lib/bio/io/fastacmd.rb +0 -16
  73. data/lib/bio/io/fetch.rb +111 -55
  74. data/lib/bio/io/flatfile/buffer.rb +4 -5
  75. data/lib/bio/io/hinv.rb +2 -3
  76. data/lib/bio/io/ncbirest.rb +43 -6
  77. data/lib/bio/io/pubmed.rb +76 -81
  78. data/lib/bio/io/togows.rb +33 -10
  79. data/lib/bio/map.rb +1 -1
  80. data/lib/bio/pathway.rb +1 -1
  81. data/lib/bio/sequence/compat.rb +1 -1
  82. data/lib/bio/sequence/na.rb +63 -12
  83. data/lib/bio/shell.rb +0 -2
  84. data/lib/bio/shell/core.rb +5 -6
  85. data/lib/bio/shell/interface.rb +3 -4
  86. data/lib/bio/shell/irb.rb +1 -2
  87. data/lib/bio/shell/plugin/entry.rb +2 -3
  88. data/lib/bio/shell/plugin/seq.rb +7 -6
  89. data/lib/bio/shell/setup.rb +1 -2
  90. data/lib/bio/tree.rb +2 -2
  91. data/lib/bio/util/contingency_table.rb +0 -2
  92. data/lib/bio/util/restriction_enzyme/range/sequence_range.rb +2 -2
  93. data/lib/bio/util/sirna.rb +76 -16
  94. data/lib/bio/version.rb +8 -9
  95. data/sample/benchmark_clustalw_report.rb +47 -0
  96. data/sample/biofetch.rb +248 -151
  97. data/setup.rb +6 -7
  98. data/test/data/clustalw/example1-seqnos.aln +58 -0
  99. data/test/network/bio/appl/blast/test_remote.rb +1 -15
  100. data/test/network/bio/appl/test_blast.rb +0 -12
  101. data/test/network/bio/io/test_pubmed.rb +49 -0
  102. data/test/network/bio/io/test_togows.rb +0 -1
  103. data/test/network/bio/test_command.rb +65 -2
  104. data/test/unit/bio/appl/bl2seq/test_report.rb +0 -1
  105. data/test/unit/bio/appl/blast/test_report.rb +110 -48
  106. data/test/unit/bio/appl/clustalw/test_report.rb +67 -51
  107. data/test/unit/bio/appl/sim4/test_report.rb +46 -17
  108. data/test/unit/bio/appl/test_blast.rb +2 -2
  109. data/test/unit/bio/db/embl/test_embl.rb +0 -1
  110. data/test/unit/bio/db/embl/test_embl_rel89.rb +0 -1
  111. data/test/unit/bio/db/embl/{test_sptr.rb → test_uniprotkb.rb} +111 -115
  112. data/test/unit/bio/db/embl/{test_uniprot_new_part.rb → test_uniprotkb_new_part.rb} +11 -11
  113. data/test/unit/bio/db/genbank/test_genbank.rb +10 -4
  114. data/test/unit/bio/db/pdb/test_pdb.rb +14 -8
  115. data/test/unit/bio/db/test_fasta.rb +41 -1
  116. data/test/unit/bio/db/test_fastq.rb +14 -4
  117. data/test/unit/bio/db/test_gff.rb +2 -2
  118. data/test/unit/bio/db/test_phyloxml.rb +30 -30
  119. data/test/unit/bio/db/test_phyloxml_writer.rb +2 -2
  120. data/test/unit/bio/io/flatfile/test_autodetection.rb +1 -2
  121. data/test/unit/bio/io/flatfile/test_buffer.rb +7 -1
  122. data/test/unit/bio/io/flatfile/test_splitter.rb +1 -1
  123. data/test/unit/bio/io/test_togows.rb +3 -2
  124. data/test/unit/bio/sequence/test_dblink.rb +1 -1
  125. data/test/unit/bio/sequence/test_na.rb +3 -1
  126. data/test/unit/bio/test_alignment.rb +1 -2
  127. data/test/unit/bio/test_command.rb +5 -4
  128. data/test/unit/bio/test_db.rb +4 -2
  129. data/test/unit/bio/test_pathway.rb +25 -10
  130. data/test/unit/bio/util/test_sirna.rb +22 -22
  131. metadata +656 -1430
  132. data/doc/KEGG_API.rd +0 -1843
  133. data/doc/KEGG_API.rd.ja +0 -1834
  134. data/extconf.rb +0 -2
  135. data/lib/bio/appl/blast/ddbj.rb +0 -131
  136. data/lib/bio/db/kegg/taxonomy.rb +0 -280
  137. data/lib/bio/io/dbget.rb +0 -194
  138. data/lib/bio/io/ddbjrest.rb +0 -344
  139. data/lib/bio/io/ddbjxml.rb +0 -458
  140. data/lib/bio/io/ebisoap.rb +0 -158
  141. data/lib/bio/io/ensembl.rb +0 -229
  142. data/lib/bio/io/higet.rb +0 -73
  143. data/lib/bio/io/keggapi.rb +0 -363
  144. data/lib/bio/io/ncbisoap.rb +0 -156
  145. data/lib/bio/io/soapwsdl.rb +0 -119
  146. data/lib/bio/shell/plugin/keggapi.rb +0 -181
  147. data/lib/bio/shell/plugin/soap.rb +0 -87
  148. data/sample/dbget +0 -37
  149. data/sample/demo_ddbjxml.rb +0 -212
  150. data/sample/demo_kegg_taxonomy.rb +0 -92
  151. data/sample/demo_keggapi.rb +0 -502
  152. data/sample/psortplot_html.rb +0 -214
  153. data/test/network/bio/io/test_ddbjrest.rb +0 -47
  154. data/test/network/bio/io/test_ensembl.rb +0 -230
  155. data/test/network/bio/io/test_soapwsdl.rb +0 -53
  156. data/test/unit/bio/io/test_ddbjxml.rb +0 -81
  157. data/test/unit/bio/io/test_ensembl.rb +0 -111
  158. data/test/unit/bio/io/test_soapwsdl.rb +0 -33
@@ -1,119 +0,0 @@
1
- #
2
- # = bio/io/soapwsdl.rb - SOAP/WSDL interface class
3
- #
4
- # Copyright:: Copyright (C) 2004
5
- # Toshiaki Katayama <k@bioruby.org>
6
- # License:: The Ruby License
7
- #
8
- # $Id: soapwsdl.rb,v 1.7 2007/04/05 23:35:41 trevor Exp $
9
- #
10
- begin
11
- require 'soap/wsdlDriver'
12
- rescue LoadError
13
- end
14
-
15
- module Bio
16
-
17
- # == Examples
18
- #
19
- # class API < Bio::SOAPWSDL
20
- # def initialize
21
- # @wsdl = 'http://example.com/example.wsdl'
22
- # @log = File.new("soap_log", 'w')
23
- # create_driver
24
- # end
25
- # end
26
- #
27
- # == Use HTTP proxy
28
- #
29
- # You need to set following two environmental variables
30
- # (case might be insensitive) as required by SOAP4R.
31
- #
32
- # --- soap_use_proxy
33
- #
34
- # Set the value of this variable to 'on'.
35
- #
36
- # --- http_proxy
37
- #
38
- # Set the URL of your proxy server (http://myproxy.com:8080 etc.).
39
- #
40
- # === Example to use HTTP proxy
41
- #
42
- # % export soap_use_proxy=on
43
- # % export http_proxy=http://localhost:8080
44
- #
45
- class SOAPWSDL
46
-
47
- # Returns URL of the current WSDL file.
48
- attr_reader :wsdl
49
-
50
- # Returns current logging IO.
51
- attr_reader :log
52
-
53
-
54
- def initialize(wsdl = nil)
55
- @wsdl = wsdl
56
- @log = nil
57
- create_driver
58
- end
59
-
60
-
61
- def create_driver
62
- if RUBY_VERSION > "1.8.2"
63
- @driver = SOAP::WSDLDriverFactory.new(@wsdl).create_rpc_driver
64
- else
65
- @driver = SOAP::WSDLDriverFactory.new(@wsdl).create_driver
66
- end
67
- @driver.generate_explicit_type = true # Ruby obj <-> SOAP obj
68
- end
69
- private :create_driver
70
-
71
-
72
- # Change the URL for WSDL file
73
- #
74
- # serv = Bio::SOAPWSDL.new("http://soap.genome.jp/KEGG.wsdl")
75
- #
76
- # or
77
- #
78
- # serv = Bio::SOAPWSDL.new
79
- # serv.wsdl = "http://soap.genome.jp/KEGG.wsdl"
80
- #
81
- # Note that you can't read two or more different WSDL files at once.
82
- # In that case, create Bio::SOAPWSDL object for each.
83
- #
84
- def wsdl=(url)
85
- @wsdl = url
86
- create_driver
87
- end
88
-
89
-
90
- # Change the IO for logging. The argument is passed to wiredump_dev method
91
- # of the SOAP4R, thus
92
- #
93
- # serv = Bio::SOAPWSDL.new
94
- # serv.log = STDERR
95
- #
96
- # will print all the SOAP transactions in standard error.
97
- # This feature is especially useful for debug.
98
- #
99
- def log=(io)
100
- @log = io
101
- @driver.wiredump_dev = @log
102
- end
103
-
104
-
105
- # List of methods defined by WSDL
106
- def list_methods
107
- @driver.methods(false)
108
- end
109
-
110
-
111
- def method_missing(*arg)
112
- @driver.send(*arg)
113
- end
114
- private :method_missing
115
-
116
- end # SOAPWSDL
117
-
118
- end # Bio
119
-
@@ -1,181 +0,0 @@
1
- #
2
- # = bio/shell/plugin/keggapi.rb - plugin for KEGG API
3
- #
4
- # Copyright:: Copyright (C) 2005
5
- # Toshiaki Katayama <k@bioruby.org>
6
- # License:: The Ruby License
7
- #
8
- # $Id: keggapi.rb,v 1.12 2007/04/05 23:35:41 trevor Exp $
9
- #
10
-
11
- module Bio::Shell
12
-
13
- module Private
14
-
15
- module_function
16
-
17
- def keggapi_definition2tab(list)
18
- ary = []
19
- list.each do |entry|
20
- ary << "#{entry.entry_id}\t#{entry.definition}"
21
- end
22
- return ary
23
- end
24
- end
25
-
26
- private
27
-
28
- def keggapi(wsdl = nil)
29
- if wsdl
30
- @keggapi = Bio::KEGG::API.new(wsdl)
31
- else
32
- @keggapi ||= Bio::KEGG::API.new
33
- end
34
- return @keggapi
35
- end
36
-
37
- # DBGET
38
-
39
- def binfo(db = "all")
40
- result = keggapi.binfo(db)
41
- puts result
42
- return result
43
- end
44
-
45
- def bfind(str)
46
- result = keggapi.bfind(str)
47
- return result
48
- end
49
-
50
- def bget(str)
51
- result = keggapi.bget(str)
52
- if block_given?
53
- yield result
54
- else
55
- puts result
56
- return result
57
- end
58
- end
59
-
60
- def btit(str)
61
- result = keggapi.btit(str)
62
- puts result
63
- return result
64
- end
65
-
66
- def bconv(str)
67
- result = keggapi.bconv(str)
68
- puts result
69
- return result
70
- end
71
-
72
- # DATABASES
73
-
74
- def keggdbs
75
- list = keggapi.list_databases
76
- result = Bio::Shell::Private.keggapi_definition2tab(list).join("\n")
77
- puts result
78
- return list.map {|x| x.entry_id}
79
- end
80
-
81
- def keggorgs
82
- list = keggapi.list_organisms
83
- result = Bio::Shell::Private.keggapi_definition2tab(list).sort.join("\n")
84
- puts result
85
- return list.map {|x| x.entry_id}
86
- end
87
-
88
- def keggpathways(org = "map")
89
- list = keggapi.list_pathways(org)
90
- result = Bio::Shell::Private.keggapi_definition2tab(list).join("\n")
91
- puts result
92
- return list.map {|x| x.entry_id}
93
- end
94
-
95
- # use KEGG DAS insetad
96
- def kegggenomeseq(org)
97
- result = ""
98
- require 'net/ftp'
99
- Net::FTP.open("ftp.genome.jp", "anonymous") do |ftp|
100
- path = "/pub/kegg/genomes/#{org}"
101
- list = ftp.nlst(path)
102
- file = list.grep(/.*genome$/).shift
103
- if file
104
- open("ftp://ftp.genome.jp/#{file}") do |file|
105
- result = file.read
106
- end
107
- end
108
- end
109
- return result
110
- end
111
-
112
- end
113
-
114
- =begin
115
-
116
- == BioRuby extensions
117
-
118
- --- get_all_best_best_neighbors_by_gene(genes_id)
119
- --- get_all_best_neighbors_by_gene(genes_id)
120
- --- get_all_reverse_best_neighbors_by_gene(genes_id)
121
- --- get_all_paralogs_by_gene(genes_id)
122
- --- get_all_genes_by_motifs(motif_id_list)
123
- --- get_all_oc_members_by_gene(genes_id)
124
- --- get_all_pc_members_by_gene(genes_id)
125
- --- get_all_genes_by_organism(org)
126
- --- get_all_linkdb_by_entry(entry_id, db)
127
- --- save_image(url, filename = nil)
128
- --- get_entries(ary = [])
129
- --- get_aaseqs(ary = [])
130
- --- get_naseqs(ary = [])
131
- --- get_definitions(ary = [])
132
-
133
- == Original KEGG API methods
134
-
135
- --- get_linkdb_by_entry(entry_id, db, start, max_results)
136
- --- get_best_best_neighbors_by_gene(genes_id, start, max_results)
137
- --- get_best_neighbors_by_gene(genes_id, start, max_results)
138
- --- get_reverse_best_neighbors_by_gene(genes_id, start, max_results)
139
- --- get_paralogs_by_gene(genes_id, start, max_results)
140
- --- get_motifs_by_gene(genes_id, db)
141
- --- get_genes_by_motifs(motif_id_list, start, max_results)
142
- --- get_ko_by_gene(genes_id)
143
- --- get_ko_by_ko_class(ko_class_id)
144
- --- get_genes_by_ko_class(ko_class_id, org, start, max_results)
145
- --- get_genes_by_ko(ko_id, org)
146
- --- get_oc_members_by_gene(genes_id, start, max_results)
147
- --- get_pc_members_by_gene(genes_id, start, max_results)
148
- --- mark_pathway_by_objects(pathway_id, object_id_list)
149
- --- color_pathway_by_objects(pathway_id, object_id_list, fg_color_list, bg_color_list)
150
- --- get_html_of_marked_pathway_by_objects(pathway_id, object_id_list)
151
- --- get_html_of_colored_pathway_by_objects(pathway_id, object_id_list, fg_color_list, bg_color_list)
152
- --- get_genes_by_pathway(pathway_id)
153
- --- get_enzymes_by_pathway(pathway_id)
154
- --- get_compounds_by_pathway(pathway_id)
155
- --- get_glycans_by_pathway(pathway_id)
156
- --- get_reactions_by_pathway(pathway_id)
157
- --- get_kos_by_pathway(pathway_id)
158
- --- get_pathways_by_genes(genes_id_list)
159
- --- get_pathways_by_enzymes(enzyme_id_list)
160
- --- get_pathways_by_compounds(compound_id_list)
161
- --- get_pathways_by_glycans(glycan_id_list)
162
- --- get_pathways_by_reactions(reaction_id_list)
163
- --- get_pathways_by_kos(ko_id_list, org)
164
- --- get_linked_pathways(pathway_id)
165
- --- get_genes_by_enzyme(enzyme_id, org)
166
- --- get_enzymes_by_gene(genes_id)
167
- --- get_enzymes_by_compound(compound_id)
168
- --- get_enzymes_by_glycan(glycan_id)
169
- --- get_enzymes_by_reaction(reaction_id)
170
- --- get_compounds_by_enzyme(enzyme_id)
171
- --- get_compounds_by_reaction(reaction_id)
172
- --- get_glycans_by_enzyme(enzyme_id)
173
- --- get_glycans_by_reaction(reaction_id)
174
- --- get_reactions_by_enzyme(enzyme_id)
175
- --- get_reactions_by_compound(compound_id)
176
- --- get_reactions_by_glycan(glycan_id)
177
- --- get_genes_by_organism(org, start, max_results)
178
- --- get_number_of_genes_by_organism(org)
179
- --- convert_mol_to_kcf(mol_text)
180
-
181
- =end
@@ -1,87 +0,0 @@
1
- #
2
- # = bio/shell/plugin/soap.rb - web services
3
- #
4
- # Copyright:: Copyright (C) 2006
5
- # Toshiaki Katayama <k@bioruby.org>
6
- # License:: Ruby's
7
- #
8
- # $Id: soap.rb,v 1.1 2007/07/09 11:17:09 k Exp $
9
- #
10
-
11
- module Bio::Shell
12
-
13
- private
14
-
15
- def ncbisoap(wsdl = nil)
16
- if wsdl
17
- @ncbisoap = Bio::NCBI::SOAP.new(wsdl)
18
- else
19
- @ncbisoap ||= Bio::NCBI::SOAP.new
20
- end
21
- return @ncbisoap
22
- end
23
-
24
- def ebisoap(wsdl = nil)
25
- case wsdl
26
- when :ipscan
27
- @ebisoap = Bio::EBI::SOAP::InterProScan.new(wsdl)
28
- when :emboss
29
- @ebisoap = Bio::EBI::SOAP::Emboss.new(wsdl)
30
- when :clustalw
31
- @ebisoap = Bio::EBI::SOAP::ClustalW.new(wsdl)
32
- when :tcoffee
33
- @ebisoap = Bio::EBI::SOAP::TCoffee.new(wsdl)
34
- when :muscle
35
- @ebisoap = Bio::EBI::SOAP::Muscle.new(wsdl)
36
- when :fasta
37
- @ebisoap = Bio::EBI::SOAP::Fasta.new(wsdl)
38
- when :wublast
39
- @ebisoap = Bio::EBI::SOAP::WUBlast.new(wsdl)
40
- when :mpsrch
41
- @ebisoap = Bio::EBI::SOAP::MPsrch.new(wsdl)
42
- when :scanps
43
- @ebisoap = Bio::EBI::SOAP::ScanPS.new(wsdl)
44
- when :msd
45
- @ebisoap = Bio::EBI::SOAP::MSD.new(wsdl)
46
- when :ontology
47
- @ebisoap = Bio::EBI::SOAP::Ontology.new(wsdl)
48
- when :citation
49
- @ebisoap = Bio::EBI::SOAP::Citation.new(wsdl)
50
- when /^http/
51
- @ebisoap = Bio::EBI::SOAP.new(wsdl)
52
- else
53
- @ebisoap ||= Bio::EBI::SOAP.new
54
- end
55
- return @ebisoap
56
- end
57
-
58
- def ddbjsoap(wsdl = nil)
59
- case wsdl
60
- when :blast
61
- @ddbjsoap = Bio::DDBJ::XML::Blast.new
62
- when :fasta
63
- @ddbjsoap = Bio::DDBJ::XML::Fasta.new
64
- when :clustalw
65
- @ddbjsoap = Bio::DDBJ::XML::ClustalW.new
66
- when :ddbj
67
- @ddbjsoap = Bio::DDBJ::XML::DDBJ.new
68
- when :gib
69
- @ddbjsoap = Bio::DDBJ::XML::Gib.new
70
- when :gtop
71
- @ddbjsoap = Bio::DDBJ::XML::Gtop.new
72
- when :pml
73
- @ddbjsoap = Bio::DDBJ::XML::PML.new
74
- when :srs
75
- @ddbjsoap = Bio::DDBJ::XML::SRS.new
76
- when :txsearch
77
- @ddbjsoap = Bio::DDBJ::XML::TxSearch.new
78
- when /^http/
79
- @ddbjsoap = Bio::DDBJ::XML.new(wsdl)
80
- else
81
- @ddbjsoap ||= Bio::DDBJ::XML.new
82
- end
83
- return @ddbjsoap
84
- end
85
-
86
- end
87
-
@@ -1,37 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # dbget - DBGET client
4
- #
5
- # Interface to GenomeNet DBGET system - http://www.genome.jp/dbget/
6
- #
7
- # Copyright (C) 2001 KATAYAMA Toshiaki <k@bioruby.org>
8
- #
9
- # This program is free software; you can redistribute it and/or modify
10
- # it under the terms of the GNU General Public License as published by
11
- # the Free Software Foundation; either version 2 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # This program is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU General Public License
20
- # along with this program; if not, write to the Free Software
21
- # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
- #
23
- # $Id: dbget,v 1.7 2004/08/24 00:09:24 k Exp $
24
- #
25
-
26
- require "bio/io/dbget"
27
-
28
- # DBGET command
29
- com = File.basename($0) # e.g. $PATH/bget db entry
30
- com = ARGV.shift if com == "dbget" # e.g. $PATH/dbget bget db entry
31
-
32
- # DBGET query strings
33
- arg = ARGV.join(" ")
34
-
35
- # DBGET result
36
- print Bio::DBGET.dbget(com, arg)
37
-
@@ -1,212 +0,0 @@
1
- #
2
- # = sample/demo_ddbjxml.rb - demonstration of Bio::DDBJ::XML, DDBJ SOAP access
3
- #
4
- # Copyright:: Copyright (C) 2003, 2004
5
- # Toshiaki Katayama <k@bioruby.org>
6
- # License:: The Ruby License
7
- #
8
- #
9
- #
10
- # == Description
11
- #
12
- # Demonstration of Bio::DDBJ::XML, DDBJ SOAP server access class.
13
- #
14
- # == Requirements
15
- #
16
- # Internet connection is needed.
17
- #
18
- # == Usage
19
- #
20
- # Simply run this script.
21
- #
22
- # $ ruby demo_ddbjxml.rb
23
- #
24
- # == Notes
25
- #
26
- # It can not be run with Ruby 1.9 because SOAP4R (SOAP support for Ruby)
27
- # currently does not support Ruby 1.9.
28
- #
29
- # == Development information
30
- #
31
- # The code was moved from lib/bio/io/ddbjxml.rb.
32
- #
33
-
34
- require 'bio'
35
-
36
- #if __FILE__ == $0
37
-
38
- begin
39
- require 'pp'
40
- alias p pp
41
- rescue LoadError
42
- end
43
-
44
- puts ">>> Bio::DDBJ::XML::Blast"
45
- serv = Bio::DDBJ::XML::Blast.new
46
- # serv.log = STDERR
47
-
48
- query = "MSSRIARALALVVTLLHLTRLALSTCPAACHCPLEAPKCAPGVGLVRDGCGCCKVCAKQL"
49
-
50
- puts "### searchSimple('blastp', 'SWISS', query)"
51
- puts serv.searchSimple('blastp', 'SWISS', query)
52
-
53
- puts "### searchParam('tblastn', 'ddbjvrl', query, '-m 8')"
54
- puts serv.searchParam('tblastn', 'ddbjvrl', query, '-m 8')
55
-
56
-
57
- puts ">>> Bio::DDBJ::XML::ClustalW"
58
- serv = Bio::DDBJ::XML::ClustalW.new
59
-
60
- query = <<END
61
- > RABSTOUT rabbit Guinness receptor
62
- LKMHLMGHLKMGLKMGLKGMHLMHLKHMHLMTYTYTTYRRWPLWMWLPDFGHAS
63
- ADSCVCAHGFAVCACFAHFDVCFGAVCFHAVCFAHVCFAAAVCFAVCAC
64
- > MUSNOSE mouse nose drying factor
65
- mhkmmhkgmkhmhgmhmhglhmkmhlkmgkhmgkmkytytytryrwtqtqwtwyt
66
- fdgfdsgafdagfdgfsagdfavdfdvgavfsvfgvdfsvdgvagvfdv
67
- > HSHEAVEN human Guinness receptor repeat
68
- mhkmmhkgmkhmhgmhmhg lhmkmhlkmgkhmgkmk ytytytryrwtqtqwtwyt
69
- fdgfdsgafdagfdgfsag dfavdfdvgavfsvfgv dfsvdgvagvfdv
70
- mhkmmhkgmkhmhgmhmhg lhmkmhlkmgkhmgkmk ytytytryrwtqtqwtwyt
71
- fdgfdsgafdagfdgfsag dfavdfdvgavfsvfgv dfsvdgvagvfdv
72
- END
73
-
74
- puts "### analyzeSimple(query)"
75
- puts serv.analyzeSimple(query)
76
-
77
- puts "### analyzeParam(query, '-align -matrix=blosum')"
78
- puts serv.analyzeParam(query, '-align -matrix=blosum')
79
-
80
-
81
- puts ">>> Bio::DDBJ::XML::DDBJ"
82
- serv = Bio::DDBJ::XML::DDBJ.new
83
-
84
- puts "### getFFEntry('AB000050')"
85
- puts serv.getFFEntry('AB000050')
86
-
87
- puts "### getXMLEntry('AB000050')"
88
- puts serv.getXMLEntry('AB000050')
89
-
90
- puts "### getFeatureInfo('AB000050', 'cds')"
91
- puts serv.getFeatureInfo('AB000050', 'cds')
92
-
93
- puts "### getAllFeatures('AB000050')"
94
- puts serv.getAllFeatures('AB000050')
95
-
96
- puts "### getRelatedFeatures('AL121903', '59000', '64000')"
97
- puts serv.getRelatedFeatures('AL121903', '59000', '64000')
98
-
99
- puts "### getRelatedFeaturesSeq('AL121903', '59000', '64000')"
100
- puts serv.getRelatedFeaturesSeq('AL121903', '59000', '64000')
101
-
102
-
103
- puts ">>> Bio::DDBJ::XML::Fasta"
104
- serv = Bio::DDBJ::XML::Fasta.new
105
-
106
- query = ">Test\nMSDGAVQPDG GQPAVRNERA TGSGNGSGGG GGGGSGGVGI"
107
-
108
- puts "### searchSimple('fasta34', 'PDB', query)"
109
- puts serv.searchSimple('fasta34', 'PDB', query)
110
-
111
- query = ">Test\nAGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC"
112
-
113
- puts "### searchParam('fastx34_t', 'PDB', query, '-n')"
114
- puts serv.searchParam('fastx34_t', 'PDB', query, '-n')
115
-
116
-
117
- puts ">>> Bio::DDBJ::XML::GetEntry"
118
- serv = Bio::DDBJ::XML::GetEntry.new
119
-
120
- puts "### getDDBJEntry('AB000050')"
121
- puts serv.getDDBJEntry('AB000050')
122
-
123
- puts "### getPDBEntry('1AAR')"
124
- puts serv. getPDBEntry('1AAR')
125
-
126
-
127
- puts ">>> Bio::DDBJ::XML::Gib"
128
- serv = Bio::DDBJ::XML::Gib.new
129
-
130
- puts "### getOrganismList"
131
- puts serv.getOrganismList
132
-
133
- puts "### getChIDList"
134
- puts serv.getChIDList
135
-
136
- puts "### getOrganismNameFromChid('Sent_CT18:')"
137
- puts serv.getOrganismNameFromChid('Sent_CT18:')
138
-
139
- puts "### getChIDFromOrganismName('Aquifex aeolicus VF5')"
140
- puts serv.getChIDFromOrganismName('Aquifex aeolicus VF5')
141
-
142
- puts "### getAccession('Ecol_K12_MG1655:')"
143
- puts serv.getAccession('Ecol_K12_MG1655:')
144
-
145
- puts "### getPieceNumber('Mgen_G37:')"
146
- puts serv.getPieceNumber('Mgen_G37:')
147
-
148
- puts "### getDivision('Mgen_G37:')"
149
- puts serv.getDivision('Mgen_G37:')
150
-
151
- puts "### getType('Mgen_G37:')"
152
- puts serv.getType('Mgen_G37:')
153
-
154
- puts "### getCDS('Aaeo_VF5:ece1')"
155
- puts serv.getCDS('Aaeo_VF5:ece1')
156
-
157
- puts "### getFlatFile('Nost_PCC7120:pCC7120zeta')"
158
- puts serv.getFlatFile('Nost_PCC7120:pCC7120zeta')
159
-
160
- puts "### getFastaFile('Nost_PCC7120:pCC7120zeta')"
161
- puts serv.getFastaFile('Nost_PCC7120:pCC7120zeta', 'cdsaa')
162
-
163
-
164
- puts ">>> Bio::DDBJ::XML::Gtop"
165
- serv = Bio::DDBJ::XML::Gtop.new
166
-
167
- puts "### getOrganismList"
168
- puts serv.getOrganismList
169
-
170
- puts "### getMasterInfo"
171
- puts serv.getMasterInfo('thrA', 'ecol0')
172
-
173
-
174
- # puts ">>> Bio::DDBJ::XML::PML"
175
- # serv = Bio::DDBJ::XML::PML.new
176
- #
177
- # puts "### getVariation('1')"
178
- # puts serv.getVariation('1')
179
-
180
-
181
- puts ">>> Bio::DDBJ::XML::SRS"
182
- serv = Bio::DDBJ::XML::SRS.new
183
-
184
- puts "### searchSimple('[pathway-des:sugar]')"
185
- puts serv.searchSimple('[pathway-des:sugar]')
186
-
187
- puts "### searchParam('[swissprot-des:cohesin]', '-f seq -sf fasta')"
188
- puts serv.searchParam('[swissprot-des:cohesin]', '-f seq -sf fasta')
189
-
190
-
191
- puts ">>> Bio::DDBJ::XML::TxSearch"
192
- serv = Bio::DDBJ::XML::TxSearch.new
193
-
194
- puts "### searchSimple('*coli')"
195
- puts serv.searchSimple('*coli')
196
-
197
- puts "### searchSimple('*tardigrada*')"
198
- puts serv.searchSimple('*tardigrada*')
199
-
200
- puts "### getTxId('Escherichia coli')"
201
- puts serv.getTxId('Escherichia coli')
202
-
203
- puts "### getTxName('562')"
204
- puts serv.getTxName('562')
205
-
206
- query = "Campylobacter coli\nEscherichia coli"
207
- rank = "family\ngenus"
208
-
209
- puts "### searchLineage(query, rank, 'Bacteria')"
210
- puts serv.searchLineage(query, rank, 'Bacteria')
211
-
212
- #end