bio 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (303) hide show
  1. data/ChangeLog +2105 -3728
  2. data/KNOWN_ISSUES.rdoc +35 -3
  3. data/README.rdoc +8 -2
  4. data/RELEASE_NOTES.rdoc +166 -0
  5. data/bin/bioruby +4 -1
  6. data/bioruby.gemspec +146 -1
  7. data/bioruby.gemspec.erb +3 -1
  8. data/doc/ChangeLog-before-1.3.1 +3961 -0
  9. data/doc/Tutorial.rd +154 -22
  10. data/doc/Tutorial.rd.html +125 -68
  11. data/lib/bio.rb +21 -6
  12. data/lib/bio/appl/bl2seq/report.rb +11 -202
  13. data/lib/bio/appl/blast/format0.rb +0 -193
  14. data/lib/bio/appl/blast/report.rb +2 -147
  15. data/lib/bio/appl/blast/wublast.rb +0 -208
  16. data/lib/bio/appl/fasta.rb +4 -19
  17. data/lib/bio/appl/fasta/format10.rb +0 -14
  18. data/lib/bio/appl/genscan/report.rb +0 -176
  19. data/lib/bio/appl/hmmer.rb +1 -15
  20. data/lib/bio/appl/hmmer/report.rb +0 -100
  21. data/lib/bio/appl/meme/mast.rb +156 -0
  22. data/lib/bio/appl/meme/mast/report.rb +91 -0
  23. data/lib/bio/appl/meme/motif.rb +48 -0
  24. data/lib/bio/appl/psort.rb +0 -111
  25. data/lib/bio/appl/psort/report.rb +1 -45
  26. data/lib/bio/appl/pts1.rb +2 -4
  27. data/lib/bio/appl/sosui/report.rb +5 -54
  28. data/lib/bio/appl/targetp/report.rb +1 -104
  29. data/lib/bio/appl/tmhmm/report.rb +0 -36
  30. data/lib/bio/command.rb +94 -10
  31. data/lib/bio/data/aa.rb +1 -77
  32. data/lib/bio/data/codontable.rb +1 -95
  33. data/lib/bio/data/na.rb +1 -26
  34. data/lib/bio/db/aaindex.rb +1 -38
  35. data/lib/bio/db/fasta.rb +1 -134
  36. data/lib/bio/db/fasta/format_qual.rb +204 -0
  37. data/lib/bio/db/fasta/qual.rb +102 -0
  38. data/lib/bio/db/fastq.rb +645 -0
  39. data/lib/bio/db/fastq/fastq_to_biosequence.rb +40 -0
  40. data/lib/bio/db/fastq/format_fastq.rb +175 -0
  41. data/lib/bio/db/genbank/genbank.rb +1 -86
  42. data/lib/bio/db/gff.rb +0 -17
  43. data/lib/bio/db/go.rb +4 -72
  44. data/lib/bio/db/kegg/common.rb +112 -0
  45. data/lib/bio/db/kegg/compound.rb +29 -20
  46. data/lib/bio/db/kegg/drug.rb +74 -34
  47. data/lib/bio/db/kegg/enzyme.rb +26 -5
  48. data/lib/bio/db/kegg/genes.rb +128 -15
  49. data/lib/bio/db/kegg/genome.rb +3 -41
  50. data/lib/bio/db/kegg/glycan.rb +19 -24
  51. data/lib/bio/db/kegg/orthology.rb +16 -56
  52. data/lib/bio/db/kegg/reaction.rb +81 -28
  53. data/lib/bio/db/kegg/taxonomy.rb +1 -52
  54. data/lib/bio/db/litdb.rb +1 -16
  55. data/lib/bio/db/phyloxml/phyloxml.xsd +582 -0
  56. data/lib/bio/db/phyloxml/phyloxml_elements.rb +1174 -0
  57. data/lib/bio/db/phyloxml/phyloxml_parser.rb +954 -0
  58. data/lib/bio/db/phyloxml/phyloxml_writer.rb +228 -0
  59. data/lib/bio/db/prosite.rb +2 -95
  60. data/lib/bio/db/rebase.rb +5 -6
  61. data/lib/bio/db/sanger_chromatogram/abif.rb +120 -0
  62. data/lib/bio/db/sanger_chromatogram/chromatogram.rb +133 -0
  63. data/lib/bio/db/sanger_chromatogram/chromatogram_to_biosequence.rb +32 -0
  64. data/lib/bio/db/sanger_chromatogram/scf.rb +210 -0
  65. data/lib/bio/io/das.rb +0 -44
  66. data/lib/bio/io/ddbjxml.rb +1 -181
  67. data/lib/bio/io/flatfile.rb +1 -7
  68. data/lib/bio/io/flatfile/autodetection.rb +6 -0
  69. data/lib/bio/io/keggapi.rb +0 -442
  70. data/lib/bio/io/ncbirest.rb +130 -132
  71. data/lib/bio/io/ncbisoap.rb +2 -1
  72. data/lib/bio/io/pubmed.rb +0 -88
  73. data/lib/bio/location.rb +0 -73
  74. data/lib/bio/pathway.rb +0 -171
  75. data/lib/bio/sequence.rb +18 -1
  76. data/lib/bio/sequence/adapter.rb +3 -0
  77. data/lib/bio/sequence/format.rb +16 -0
  78. data/lib/bio/sequence/quality_score.rb +205 -0
  79. data/lib/bio/tree.rb +70 -5
  80. data/lib/bio/util/restriction_enzyme/single_strand.rb +3 -2
  81. data/lib/bio/util/sirna.rb +1 -23
  82. data/lib/bio/version.rb +1 -1
  83. data/sample/demo_aaindex.rb +67 -0
  84. data/sample/demo_aminoacid.rb +101 -0
  85. data/sample/demo_bl2seq_report.rb +220 -0
  86. data/sample/demo_blast_report.rb +285 -0
  87. data/sample/demo_codontable.rb +119 -0
  88. data/sample/demo_das.rb +105 -0
  89. data/sample/demo_ddbjxml.rb +212 -0
  90. data/sample/demo_fasta_remote.rb +51 -0
  91. data/sample/demo_fastaformat.rb +105 -0
  92. data/sample/demo_genbank.rb +132 -0
  93. data/sample/demo_genscan_report.rb +202 -0
  94. data/sample/demo_gff1.rb +49 -0
  95. data/sample/demo_go.rb +98 -0
  96. data/sample/demo_hmmer_report.rb +149 -0
  97. data/sample/demo_kegg_compound.rb +57 -0
  98. data/sample/demo_kegg_drug.rb +65 -0
  99. data/sample/demo_kegg_genome.rb +74 -0
  100. data/sample/demo_kegg_glycan.rb +72 -0
  101. data/sample/demo_kegg_orthology.rb +62 -0
  102. data/sample/demo_kegg_reaction.rb +66 -0
  103. data/sample/demo_kegg_taxonomy.rb +92 -0
  104. data/sample/demo_keggapi.rb +502 -0
  105. data/sample/demo_litdb.rb +42 -0
  106. data/sample/demo_locations.rb +99 -0
  107. data/sample/demo_ncbi_rest.rb +130 -0
  108. data/sample/demo_nucleicacid.rb +49 -0
  109. data/sample/demo_pathway.rb +196 -0
  110. data/sample/demo_prosite.rb +120 -0
  111. data/sample/demo_psort.rb +138 -0
  112. data/sample/demo_psort_report.rb +70 -0
  113. data/sample/demo_pubmed.rb +118 -0
  114. data/sample/demo_sirna.rb +63 -0
  115. data/sample/demo_sosui_report.rb +89 -0
  116. data/sample/demo_targetp_report.rb +135 -0
  117. data/sample/demo_tmhmm_report.rb +68 -0
  118. data/sample/pmfetch.rb +13 -4
  119. data/sample/pmsearch.rb +15 -4
  120. data/sample/test_phyloxml_big.rb +205 -0
  121. data/test/bioruby_test_helper.rb +61 -0
  122. data/test/data/KEGG/1.1.1.1.enzyme +935 -0
  123. data/test/data/KEGG/C00025.compound +102 -0
  124. data/test/data/KEGG/D00063.drug +104 -0
  125. data/test/data/KEGG/G00024.glycan +47 -0
  126. data/test/data/KEGG/G01366.glycan +18 -0
  127. data/test/data/KEGG/K02338.orthology +902 -0
  128. data/test/data/KEGG/R00006.reaction +14 -0
  129. data/test/data/fastq/README.txt +109 -0
  130. data/test/data/fastq/error_diff_ids.fastq +20 -0
  131. data/test/data/fastq/error_double_qual.fastq +22 -0
  132. data/test/data/fastq/error_double_seq.fastq +22 -0
  133. data/test/data/fastq/error_long_qual.fastq +20 -0
  134. data/test/data/fastq/error_no_qual.fastq +20 -0
  135. data/test/data/fastq/error_qual_del.fastq +20 -0
  136. data/test/data/fastq/error_qual_escape.fastq +20 -0
  137. data/test/data/fastq/error_qual_null.fastq +0 -0
  138. data/test/data/fastq/error_qual_space.fastq +21 -0
  139. data/test/data/fastq/error_qual_tab.fastq +21 -0
  140. data/test/data/fastq/error_qual_unit_sep.fastq +20 -0
  141. data/test/data/fastq/error_qual_vtab.fastq +20 -0
  142. data/test/data/fastq/error_short_qual.fastq +20 -0
  143. data/test/data/fastq/error_spaces.fastq +20 -0
  144. data/test/data/fastq/error_tabs.fastq +21 -0
  145. data/test/data/fastq/error_trunc_at_plus.fastq +19 -0
  146. data/test/data/fastq/error_trunc_at_qual.fastq +19 -0
  147. data/test/data/fastq/error_trunc_at_seq.fastq +18 -0
  148. data/test/data/fastq/error_trunc_in_plus.fastq +19 -0
  149. data/test/data/fastq/error_trunc_in_qual.fastq +20 -0
  150. data/test/data/fastq/error_trunc_in_seq.fastq +18 -0
  151. data/test/data/fastq/error_trunc_in_title.fastq +17 -0
  152. data/test/data/fastq/illumina_full_range_as_illumina.fastq +8 -0
  153. data/test/data/fastq/illumina_full_range_as_sanger.fastq +8 -0
  154. data/test/data/fastq/illumina_full_range_as_solexa.fastq +8 -0
  155. data/test/data/fastq/illumina_full_range_original_illumina.fastq +8 -0
  156. data/test/data/fastq/longreads_as_illumina.fastq +40 -0
  157. data/test/data/fastq/longreads_as_sanger.fastq +40 -0
  158. data/test/data/fastq/longreads_as_solexa.fastq +40 -0
  159. data/test/data/fastq/longreads_original_sanger.fastq +120 -0
  160. data/test/data/fastq/misc_dna_as_illumina.fastq +16 -0
  161. data/test/data/fastq/misc_dna_as_sanger.fastq +16 -0
  162. data/test/data/fastq/misc_dna_as_solexa.fastq +16 -0
  163. data/test/data/fastq/misc_dna_original_sanger.fastq +16 -0
  164. data/test/data/fastq/misc_rna_as_illumina.fastq +16 -0
  165. data/test/data/fastq/misc_rna_as_sanger.fastq +16 -0
  166. data/test/data/fastq/misc_rna_as_solexa.fastq +16 -0
  167. data/test/data/fastq/misc_rna_original_sanger.fastq +16 -0
  168. data/test/data/fastq/sanger_full_range_as_illumina.fastq +8 -0
  169. data/test/data/fastq/sanger_full_range_as_sanger.fastq +8 -0
  170. data/test/data/fastq/sanger_full_range_as_solexa.fastq +8 -0
  171. data/test/data/fastq/sanger_full_range_original_sanger.fastq +8 -0
  172. data/test/data/fastq/solexa_full_range_as_illumina.fastq +8 -0
  173. data/test/data/fastq/solexa_full_range_as_sanger.fastq +8 -0
  174. data/test/data/fastq/solexa_full_range_as_solexa.fastq +8 -0
  175. data/test/data/fastq/solexa_full_range_original_solexa.fastq +8 -0
  176. data/test/data/fastq/wrapping_as_illumina.fastq +12 -0
  177. data/test/data/fastq/wrapping_as_sanger.fastq +12 -0
  178. data/test/data/fastq/wrapping_as_solexa.fastq +12 -0
  179. data/test/data/fastq/wrapping_original_sanger.fastq +24 -0
  180. data/test/data/meme/db +0 -0
  181. data/test/data/meme/mast +0 -0
  182. data/test/data/meme/mast.out +13 -0
  183. data/test/data/meme/meme.out +3 -0
  184. data/test/data/phyloxml/apaf.xml +666 -0
  185. data/test/data/phyloxml/bcl_2.xml +2097 -0
  186. data/test/data/phyloxml/made_up.xml +144 -0
  187. data/test/data/phyloxml/ncbi_taxonomy_mollusca_short.xml +65 -0
  188. data/test/data/phyloxml/phyloxml_examples.xml +415 -0
  189. data/test/data/sanger_chromatogram/test_chromatogram_abif.ab1 +0 -0
  190. data/test/data/sanger_chromatogram/test_chromatogram_scf_v2.scf +0 -0
  191. data/test/data/sanger_chromatogram/test_chromatogram_scf_v3.scf +0 -0
  192. data/test/functional/bio/appl/test_pts1.rb +7 -5
  193. data/test/functional/bio/io/test_ensembl.rb +4 -3
  194. data/test/functional/bio/io/test_pubmed.rb +9 -3
  195. data/test/functional/bio/io/test_soapwsdl.rb +5 -4
  196. data/test/functional/bio/io/test_togows.rb +5 -4
  197. data/test/functional/bio/sequence/test_output_embl.rb +6 -4
  198. data/test/functional/bio/test_command.rb +54 -5
  199. data/test/runner.rb +5 -3
  200. data/test/unit/bio/appl/bl2seq/test_report.rb +5 -4
  201. data/test/unit/bio/appl/blast/test_ncbioptions.rb +4 -2
  202. data/test/unit/bio/appl/blast/test_report.rb +5 -4
  203. data/test/unit/bio/appl/blast/test_rpsblast.rb +5 -4
  204. data/test/unit/bio/appl/gcg/test_msf.rb +5 -5
  205. data/test/unit/bio/appl/genscan/test_report.rb +8 -9
  206. data/test/unit/bio/appl/hmmer/test_report.rb +5 -4
  207. data/test/unit/bio/appl/iprscan/test_report.rb +6 -5
  208. data/test/unit/bio/appl/mafft/test_report.rb +6 -5
  209. data/test/unit/bio/appl/meme/mast/test_report.rb +46 -0
  210. data/test/unit/bio/appl/meme/test_mast.rb +103 -0
  211. data/test/unit/bio/appl/meme/test_motif.rb +38 -0
  212. data/test/unit/bio/appl/paml/codeml/test_rates.rb +5 -4
  213. data/test/unit/bio/appl/paml/codeml/test_report.rb +5 -4
  214. data/test/unit/bio/appl/paml/test_codeml.rb +5 -4
  215. data/test/unit/bio/appl/sim4/test_report.rb +5 -4
  216. data/test/unit/bio/appl/sosui/test_report.rb +6 -5
  217. data/test/unit/bio/appl/targetp/test_report.rb +5 -3
  218. data/test/unit/bio/appl/test_blast.rb +5 -4
  219. data/test/unit/bio/appl/test_fasta.rb +4 -2
  220. data/test/unit/bio/appl/test_pts1.rb +4 -2
  221. data/test/unit/bio/appl/tmhmm/test_report.rb +6 -5
  222. data/test/unit/bio/data/test_aa.rb +5 -3
  223. data/test/unit/bio/data/test_codontable.rb +5 -4
  224. data/test/unit/bio/data/test_na.rb +5 -3
  225. data/test/unit/bio/db/biosql/tc_biosql.rb +5 -1
  226. data/test/unit/bio/db/embl/test_common.rb +4 -2
  227. data/test/unit/bio/db/embl/test_embl.rb +6 -6
  228. data/test/unit/bio/db/embl/test_embl_rel89.rb +6 -6
  229. data/test/unit/bio/db/embl/test_embl_to_bioseq.rb +7 -8
  230. data/test/unit/bio/db/embl/test_sptr.rb +6 -8
  231. data/test/unit/bio/db/embl/test_uniprot.rb +6 -5
  232. data/test/unit/bio/db/fasta/test_format_qual.rb +346 -0
  233. data/test/unit/bio/db/kegg/test_compound.rb +146 -0
  234. data/test/unit/bio/db/kegg/test_drug.rb +194 -0
  235. data/test/unit/bio/db/kegg/test_enzyme.rb +241 -0
  236. data/test/unit/bio/db/kegg/test_genes.rb +32 -4
  237. data/test/unit/bio/db/kegg/test_glycan.rb +260 -0
  238. data/test/unit/bio/db/kegg/test_orthology.rb +50 -0
  239. data/test/unit/bio/db/kegg/test_reaction.rb +96 -0
  240. data/test/unit/bio/db/pdb/test_pdb.rb +4 -2
  241. data/test/unit/bio/db/sanger_chromatogram/test_abif.rb +76 -0
  242. data/test/unit/bio/db/sanger_chromatogram/test_scf.rb +98 -0
  243. data/test/unit/bio/db/test_aaindex.rb +6 -6
  244. data/test/unit/bio/db/test_fasta.rb +5 -46
  245. data/test/unit/bio/db/test_fastq.rb +829 -0
  246. data/test/unit/bio/db/test_gff.rb +4 -2
  247. data/test/unit/bio/db/test_lasergene.rb +7 -5
  248. data/test/unit/bio/db/test_medline.rb +4 -2
  249. data/test/unit/bio/db/test_newick.rb +6 -6
  250. data/test/unit/bio/db/test_nexus.rb +4 -2
  251. data/test/unit/bio/db/test_phyloxml.rb +769 -0
  252. data/test/unit/bio/db/test_phyloxml_writer.rb +328 -0
  253. data/test/unit/bio/db/test_prosite.rb +6 -5
  254. data/test/unit/bio/db/test_qual.rb +63 -0
  255. data/test/unit/bio/db/test_rebase.rb +5 -3
  256. data/test/unit/bio/db/test_soft.rb +7 -6
  257. data/test/unit/bio/io/flatfile/test_autodetection.rb +6 -7
  258. data/test/unit/bio/io/flatfile/test_buffer.rb +6 -5
  259. data/test/unit/bio/io/flatfile/test_splitter.rb +4 -4
  260. data/test/unit/bio/io/test_ddbjxml.rb +4 -3
  261. data/test/unit/bio/io/test_ensembl.rb +5 -3
  262. data/test/unit/bio/io/test_fastacmd.rb +4 -3
  263. data/test/unit/bio/io/test_flatfile.rb +6 -5
  264. data/test/unit/bio/io/test_soapwsdl.rb +4 -3
  265. data/test/unit/bio/io/test_togows.rb +4 -2
  266. data/test/unit/bio/sequence/test_aa.rb +5 -3
  267. data/test/unit/bio/sequence/test_common.rb +4 -2
  268. data/test/unit/bio/sequence/test_compat.rb +4 -2
  269. data/test/unit/bio/sequence/test_dblink.rb +5 -3
  270. data/test/unit/bio/sequence/test_na.rb +4 -2
  271. data/test/unit/bio/sequence/test_quality_score.rb +330 -0
  272. data/test/unit/bio/shell/plugin/test_seq.rb +5 -3
  273. data/test/unit/bio/test_alignment.rb +5 -3
  274. data/test/unit/bio/test_command.rb +4 -3
  275. data/test/unit/bio/test_db.rb +5 -3
  276. data/test/unit/bio/test_feature.rb +4 -2
  277. data/test/unit/bio/test_location.rb +4 -2
  278. data/test/unit/bio/test_map.rb +5 -3
  279. data/test/unit/bio/test_pathway.rb +4 -2
  280. data/test/unit/bio/test_reference.rb +4 -2
  281. data/test/unit/bio/test_sequence.rb +5 -3
  282. data/test/unit/bio/test_shell.rb +5 -3
  283. data/test/unit/bio/test_tree.rb +6 -6
  284. data/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb +4 -2
  285. data/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb +4 -2
  286. data/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb +4 -2
  287. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb +4 -2
  288. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb +4 -2
  289. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb +4 -2
  290. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb +4 -2
  291. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb +4 -2
  292. data/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb +4 -2
  293. data/test/unit/bio/util/restriction_enzyme/test_analysis.rb +4 -2
  294. data/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb +4 -2
  295. data/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb +4 -2
  296. data/test/unit/bio/util/restriction_enzyme/test_single_strand.rb +17 -13
  297. data/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb +17 -13
  298. data/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb +4 -2
  299. data/test/unit/bio/util/test_color_scheme.rb +5 -3
  300. data/test/unit/bio/util/test_contingency_table.rb +5 -3
  301. data/test/unit/bio/util/test_restriction_enzyme.rb +4 -2
  302. data/test/unit/bio/util/test_sirna.rb +6 -4
  303. metadata +147 -2
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: flatfile.rb,v 1.61 2007/11/15 07:07:16 k Exp $
8
+ # $Id:$
9
9
  #
10
10
  #
11
11
  # Bio::FlatFile is a helper and wrapper class to read a biological data file.
@@ -465,9 +465,3 @@ module Bio
465
465
 
466
466
  end #module Bio
467
467
 
468
- if __FILE__ == $0
469
- if ARGV.size == 2
470
- require 'bio'
471
- p Bio::FlatFile.open(eval(ARGV.shift), ARGV.shift).next_entry
472
- end
473
- end
@@ -477,6 +477,9 @@ module Bio
477
477
  sim4 = RuleRegexp[ 'Bio::Sim4::Report',
478
478
  /^seq1 \= .*\, \d+ bp(\r|\r?\n)seq2 \= .*\, \d+ bp(\r|\r?\n)/ ],
479
479
 
480
+ fastq = RuleRegexp[ 'Bio::Fastq',
481
+ /^\@.+(?:\r|\r?\n)(?:[^\@\+].*(?:\r|\r?\n))+\+.*(?:\r|\r?\n).+(?:\r|\r?\n)/ ],
482
+
480
483
  fastaformat = RuleProc.new('Bio::FastaFormat',
481
484
  'Bio::NBRF',
482
485
  'Bio::FastaNumericFormat') do |text|
@@ -521,6 +524,9 @@ module Bio
521
524
  wublast.is_prior_to wutblast
522
525
  wutblast.is_prior_to blast
523
526
  blast.is_prior_to tblast
527
+ # Fastq
528
+ BottomRule.is_prior_to(fastq)
529
+ fastq.is_prior_to(fastaformat)
524
530
  # FastaFormat
525
531
  BottomRule.is_prior_to(fastaformat)
526
532
 
@@ -361,445 +361,3 @@ end # API
361
361
  end # KEGG
362
362
  end # Bio
363
363
 
364
-
365
- if __FILE__ == $0
366
-
367
- begin
368
- require 'pp'
369
- alias p pp
370
- rescue LoadError
371
- end
372
-
373
- puts ">>> KEGG API"
374
- serv = Bio::KEGG::API.new
375
- # serv.log = STDERR
376
-
377
- puts "# * parameters"
378
- puts " wsdl : #{serv.wsdl}"
379
- puts " log : #{serv.log}"
380
- puts " start : #{serv.start}"
381
- puts " max_results : #{serv.max_results}"
382
-
383
- puts "=== META"
384
-
385
- puts "### list_databases"
386
- list = serv.list_databases
387
- list.each do |db|
388
- print db.entry_id, "\t", db.definition, "\n"
389
- end
390
-
391
- puts "### list_organisms"
392
- list = serv.list_organisms
393
- list.each do |org|
394
- print org.entry_id, "\t", org.definition, "\n"
395
- end
396
-
397
- puts "### list_pathways('map') : reference pathway"
398
- list = serv.list_pathways("map")
399
- list.each do |path|
400
- print path.entry_id, "\t", path.definition, "\n"
401
- end
402
-
403
- puts "### list_pathways('eco') : E. coli pathway"
404
- list = serv.list_pathways("eco")
405
- list.each do |path|
406
- print path.entry_id, "\t", path.definition, "\n"
407
- end
408
-
409
- puts "=== DBGET"
410
-
411
- puts "### binfo('all')"
412
- puts serv.binfo("all")
413
-
414
- puts "### binfo('genbank')"
415
- puts serv.binfo("genbank")
416
-
417
- puts "### bfind('genbank kinase cell cycle human')"
418
- puts serv.bfind("genbank kinase cell cycle human")
419
-
420
- puts "### bget('gb:AJ617376')"
421
- puts serv.bget("gb:AJ617376")
422
-
423
- puts "### bget('eco:b0002 eco:b0003')"
424
- puts serv.bget("eco:b0002 eco:b0003")
425
-
426
- puts "### btit('eco:b0002 eco:b0003')"
427
- puts serv.btit("eco:b0002 eco:b0003")
428
-
429
- puts "# * get_entries(['eco:b0002', 'eco:b0003'])"
430
- puts serv.get_entries(["eco:b0002", "eco:b0003"])
431
-
432
- puts "# * get_aaseqs(['eco:b0002', 'eco:b0003'])"
433
- puts serv.get_aaseqs(["eco:b0002", "eco:b0003"])
434
-
435
- puts "# * get_naseqs(['eco:b0002', 'eco:b0003'])"
436
- puts serv.get_naseqs(["eco:b0002", "eco:b0003"])
437
-
438
- puts "# * get_definitions(['eco:b0002', 'eco:b0003'])"
439
- puts serv.get_definitions(["eco:b0002", "eco:b0003"])
440
-
441
- puts "# * get_definitions(('eco:b0001'..'eco:b0200').to_a)"
442
- puts serv.get_definitions(("eco:b0001".."eco:b0200").to_a)
443
-
444
- puts "=== LinkDB"
445
-
446
- puts "### get_linkdb_by_entry('eco:b0002', 'pathway', 1, 5)"
447
- list = serv.get_linkdb_by_entry("eco:b0002", "pathway", 1, 5)
448
- list.each do |link|
449
- puts [ link.entry_id1, link.entry_id2, link.type, link.path ].join("\t")
450
- end
451
-
452
- puts "# * get_all_linkdb_by_entry('eco:b0002', 'pathway')"
453
- list = serv.get_all_linkdb_by_entry("eco:b0002", "pathway")
454
- list.each do |link|
455
- puts [ link.entry_id1, link.entry_id2, link.type, link.path ].join("\t")
456
- end
457
-
458
- puts "=== SSDB"
459
-
460
- puts "### get_neighbors_by_gene('eco:b0002', 'all', 1, 5)"
461
- list = serv.get_neighbors_by_gene("eco:b0002", "all", 1, 5)
462
- list.each do |hit|
463
- puts [ hit.genes_id1, hit.genes_id2, hit.sw_score ].join("\t")
464
- end
465
-
466
- puts "# * get_all_neighbors_by_gene('eco:b0002', 'bsu')"
467
- list = serv.get_all_neighbors_by_gene("eco:b0002", "bsu")
468
- list.each do |hit|
469
- puts [ hit.genes_id1, hit.genes_id2, hit.sw_score ].join("\t")
470
- end
471
-
472
- puts "### get_best_best_neighbors_by_gene('eco:b0002', 1, 5)"
473
- list = serv.get_best_best_neighbors_by_gene("eco:b0002", 1, 5)
474
- list.each do |hit|
475
- puts [ hit.genes_id1, hit.genes_id2, hit.sw_score ].join("\t")
476
- end
477
-
478
- puts "# * get_all_best_best_neighbors_by_gene('eco:b0002')"
479
- list = serv.get_all_best_best_neighbors_by_gene("eco:b0002")
480
- list.each do |hit|
481
- puts [ hit.genes_id1, hit.genes_id2, hit.sw_score ].join("\t")
482
- end
483
-
484
- puts "### get_best_neighbors_by_gene('eco:b0002', 1, 5)"
485
- list = serv.get_best_neighbors_by_gene("eco:b0002", 1, 5)
486
- list.each do |hit|
487
- puts [ hit.genes_id1, hit.genes_id2, hit.sw_score ].join("\t")
488
- end
489
-
490
- puts "# * get_all_best_neighbors_by_gene('eco:b0002')"
491
- list = serv.get_all_best_neighbors_by_gene("eco:b0002")
492
- list.each do |hit|
493
- puts [ hit.genes_id1, hit.genes_id2, hit.sw_score ].join("\t")
494
- end
495
-
496
- puts "### get_reverse_best_neighbors_by_gene('eco:b0002', 1, 5)"
497
- list = serv.get_reverse_best_neighbors_by_gene("eco:b0002", 1, 5)
498
- list.each do |hit|
499
- puts [ hit.genes_id1, hit.genes_id2, hit.sw_score ].join("\t")
500
- end
501
-
502
- puts "# * get_all_reverse_best_neighbors_by_gene('eco:b0002')"
503
- list = serv.get_all_reverse_best_neighbors_by_gene("eco:b0002")
504
- list.each do |hit|
505
- puts [ hit.genes_id1, hit.genes_id2, hit.sw_score ].join("\t")
506
- end
507
-
508
- puts "### get_paralogs_by_gene('eco:b0002', 1, 5)"
509
- list = serv.get_paralogs_by_gene("eco:b0002", 1, 5)
510
- list.each do |hit|
511
- puts [ hit.genes_id1, hit.genes_id2, hit.sw_score ].join("\t")
512
- end
513
-
514
- puts "# * get_all_paralogs_by_gene('eco:b0002')"
515
- list = serv.get_all_paralogs_by_gene("eco:b0002")
516
- list.each do |hit|
517
- puts [ hit.genes_id1, hit.genes_id2, hit.sw_score ].join("\t")
518
- end
519
-
520
- puts "### get_similarity_between_genes('eco:b0002', 'bsu:BG10350')"
521
- relation = serv.get_similarity_between_genes("eco:b0002", "bsu:BG10350")
522
- puts " genes_id1 : #{relation.genes_id1}" # string
523
- puts " genes_id2 : #{relation.genes_id2}" # string
524
- puts " sw_score : #{relation.sw_score}" # int
525
- puts " bit_score : #{relation.bit_score}" # float
526
- puts " identity : #{relation.identity}" # float
527
- puts " overlap : #{relation.overlap}" # int
528
- puts " start_position1 : #{relation.start_position1}" # int
529
- puts " end_position1 : #{relation.end_position1}" # int
530
- puts " start_position2 : #{relation.start_position2}" # int
531
- puts " end_position2 : #{relation.end_position2}" # int
532
- puts " best_flag_1to2 : #{relation.best_flag_1to2}" # boolean
533
- puts " best_flag_2to1 : #{relation.best_flag_2to1}" # boolean
534
- puts " definition1 : #{relation.definition1}" # string
535
- puts " definition2 : #{relation.definition2}" # string
536
- puts " length1 : #{relation.length1}" # int
537
- puts " length2 : #{relation.length2}" # int
538
-
539
- puts "=== MOTIF"
540
-
541
- puts "### get_motifs_by_gene('eco:b0002', 'pfam')"
542
- list = serv.get_motifs_by_gene("eco:b0002", "pfam")
543
- list.each do |motif|
544
- puts motif.motif_id
545
- end if list
546
-
547
- puts "### get_motifs_by_gene('eco:b0002', 'tfam')"
548
- list = serv.get_motifs_by_gene("eco:b0002", "tfam")
549
- list.each do |motif|
550
- puts motif.motif_id
551
- end if list
552
-
553
- puts "### get_motifs_by_gene('eco:b0002', 'pspt')"
554
- list = serv.get_motifs_by_gene("eco:b0002", "pspt")
555
- list.each do |motif|
556
- puts motif.motif_id
557
- end if list
558
-
559
- puts "### get_motifs_by_gene('eco:b0002', 'pspf')"
560
- list = serv.get_motifs_by_gene("eco:b0002", "pspf")
561
- list.each do |motif|
562
- puts motif.motif_id
563
- end if list
564
-
565
- puts "### get_motifs_by_gene('eco:b0002', 'all')"
566
- list = serv.get_motifs_by_gene("eco:b0002", "all")
567
- list.each do |motif|
568
- puts "# * motif result"
569
- puts " motif_id : #{motif.motif_id}"
570
- puts " definition : #{motif.definition}"
571
- puts " genes_id : #{motif.genes_id}"
572
- puts " start_position : #{motif.start_position}"
573
- puts " end_position : #{motif.end_position}"
574
- puts " score : #{motif.score}"
575
- puts " evalue : #{motif.evalue}"
576
- end
577
-
578
- puts "### get_genes_by_motifs(['pf:ACT', 'ps:ASPARTOKINASE'], 1, 5)"
579
- list = serv.get_genes_by_motifs(["pf:ACT", "ps:ASPARTOKINASE"], 1, 5)
580
- list.each do |gene|
581
- puts [ gene.entry_id, gene.definition ].join("\t")
582
- end
583
-
584
- puts "# * get_all_genes_by_motifs(['pf:ACT', 'ps:ASPARTOKINASE'])"
585
- list = serv.get_all_genes_by_motifs(["pf:ACT", "ps:ASPARTOKINASE"])
586
- list.each do |gene|
587
- puts [ gene.entry_id, gene.definition ].join("\t")
588
- end
589
-
590
- puts "=== KO, OC, PC"
591
-
592
- puts "### get_ko_by_gene('eco:b0002')"
593
- list = serv.get_ko_by_gene("eco:b0002")
594
- list.each do |ko|
595
- puts ko
596
- end
597
-
598
- puts "### get_ko_members('ko:K00003')"
599
- list = serv.get_ko_members("ko:K00003")
600
- list.each do |gene|
601
- puts gene
602
- end
603
-
604
- puts "### get_oc_members_by_gene('eco:b0002', 1, 5)"
605
- list = serv.get_oc_members_by_gene("eco:b0002", 1, 5)
606
- list.each do |gene|
607
- puts gene
608
- end
609
-
610
- puts "# * get_all_oc_members_by_gene('eco:b0002')"
611
- list = serv.get_all_oc_members_by_gene("eco:b0002")
612
- list.each do |gene|
613
- puts gene
614
- end
615
-
616
- puts "### get_pc_members_by_gene('eco:b0002', 1, 5)"
617
- list = serv.get_pc_members_by_gene("eco:b0002", 1, 5)
618
- list.each do |gene|
619
- puts gene
620
- end
621
-
622
- puts "# * get_all_pc_members_by_gene('eco:b0002')"
623
- list = serv.get_all_pc_members_by_gene("eco:b0002")
624
- list.each do |gene|
625
- puts gene
626
- end
627
-
628
- puts "=== PATHWAY"
629
-
630
- puts "==== coloring pathway"
631
-
632
- puts "### mark_pathway_by_objects('path:eco00260', obj_list)"
633
- puts " obj_list = ['eco:b0002', 'cpd:C00263']"
634
- obj_list = ["eco:b0002", "cpd:C00263"]
635
- url = serv.mark_pathway_by_objects("path:eco00260", obj_list)
636
- puts url
637
-
638
- puts "### color_pathway_by_objects('path:eco00053', obj_list, fg_list, bg_list)"
639
- puts " obj_list = ['eco:b0207', 'eco:b1300']"
640
- puts " fg_list = ['blue', '#00ff00']"
641
- puts " bg_list = ['#ff0000', 'yellow']"
642
- obj_list = ["eco:b0207", "eco:b1300"]
643
- fg_list = ["blue", "#00ff00"]
644
- bg_list = ["#ff0000", "yellow"]
645
- url = serv.color_pathway_by_objects("path:eco00053", obj_list, fg_list, bg_list)
646
- puts url
647
-
648
- #puts "# * save_image(#{url})"
649
- #filename = serv.save_image(url, "test.gif")
650
- #filename = serv.save_image(url)
651
- #puts filename
652
-
653
- puts "==== objects on pathway"
654
-
655
- puts "### get_genes_by_pathway('path:map00010')"
656
- list = serv.get_genes_by_pathway("path:map00010")
657
- list.each do |gene|
658
- puts gene
659
- end
660
-
661
- puts "### get_genes_by_pathway('path:eco00010')"
662
- list = serv.get_genes_by_pathway("path:eco00010")
663
- list.each do |gene|
664
- puts gene
665
- end
666
-
667
- puts "### get_enzymes_by_pathway('path:map00010')"
668
- list = serv.get_enzymes_by_pathway("path:map00010")
669
- list.each do |enzyme|
670
- puts enzyme
671
- end
672
-
673
- puts "### get_enzymes_by_pathway('path:eco00010')"
674
- list = serv.get_enzymes_by_pathway("path:eco00010")
675
- list.each do |enzyme|
676
- puts enzyme
677
- end
678
-
679
- puts "### get_compounds_by_pathway('path:map00010')"
680
- list = serv.get_compounds_by_pathway("path:map00010")
681
- list.each do |compound|
682
- puts compound
683
- end
684
-
685
- puts "### get_compounds_by_pathway('path:eco00010')"
686
- list = serv.get_compounds_by_pathway("path:eco00010")
687
- list.each do |compound|
688
- puts compound
689
- end
690
-
691
- puts "### get_reactions_by_pathway('path:map00010')"
692
- list = serv.get_reactions_by_pathway("path:map00010")
693
- list.each do |reaction|
694
- puts reaction
695
- end
696
-
697
- puts "### get_reactions_by_pathway('path:eco00010')"
698
- list = serv.get_reactions_by_pathway("path:eco00010")
699
- list.each do |reaction|
700
- puts reaction
701
- end
702
-
703
- puts "==== pathway by objects"
704
-
705
- puts "### get_pathways_by_genes(['eco:b0756', 'eco:b1002'])"
706
- list = serv.get_pathways_by_genes(["eco:b0756", "eco:b1002"])
707
- list.each do |path|
708
- puts path
709
- end
710
-
711
- puts "### get_pathways_by_enzymes(['ec:5.1.3.3', 'ec:3.1.3.10'])"
712
- list = serv.get_pathways_by_enzymes(["ec:5.1.3.3", "ec:3.1.3.10"])
713
- list.each do |path|
714
- puts path
715
- end
716
-
717
- puts "### get_pathways_by_compounds(['cpd:C00221', 'cpd:C00267'])"
718
- list = serv.get_pathways_by_compounds(["cpd:C00221", "cpd:C00267"])
719
- list.each do |path|
720
- puts path
721
- end
722
-
723
- puts "### get_pathways_by_reactions(['rn:R00014', 'rn:R00710'])"
724
- list = serv.get_pathways_by_reactions(["rn:R00014", "rn:R00710"])
725
- list.each do |path|
726
- puts path
727
- end
728
-
729
- puts "==== relation between objects"
730
-
731
- puts "### get_linked_pathways('path:eco00620')"
732
- list = serv.get_linked_pathways('path:eco00620')
733
- list.each do |path|
734
- puts path
735
- end
736
-
737
- puts "### get_genes_by_enzyme('ec:1.1.1.1', 'eco')"
738
- list = serv.get_genes_by_enzyme("ec:1.1.1.1", "eco")
739
- list.each do |gene|
740
- puts gene
741
- end
742
-
743
- puts "### get_enzymes_by_gene('eco:b0002')"
744
- list = serv.get_enzymes_by_gene("eco:b0002")
745
- list.each do |enzyme|
746
- puts enzyme
747
- end
748
-
749
- puts "### get_enzymes_by_compound('cpd:C00345')"
750
- list = serv.get_enzymes_by_compound("cpd:C00345")
751
- list.each do |enzyme|
752
- puts enzyme
753
- end
754
-
755
- puts "### get_enzymes_by_reaction('rn:R00100')"
756
- list = serv.get_enzymes_by_reaction("rn:R00100")
757
- list.each do |enzyme|
758
- puts enzyme
759
- end
760
-
761
- puts "### get_compounds_by_enzyme('ec:2.7.1.12')"
762
- list = serv.get_compounds_by_enzyme("ec:2.7.1.12")
763
- list.each do |compound|
764
- puts compound
765
- end
766
-
767
- puts "### get_compounds_by_reaction('rn:R00100')"
768
- list = serv.get_compounds_by_reaction("rn:R00100")
769
- list.each do |compound|
770
- puts compound
771
- end
772
-
773
- puts "### get_reactions_by_enzyme('ec:2.7.1.12')"
774
- list = serv.get_reactions_by_enzyme("ec:2.7.1.12")
775
- list.each do |reaction|
776
- puts reaction
777
- end
778
-
779
- puts "### get_reactions_by_compound('cpd:C00199')"
780
- list = serv.get_reactions_by_compound("cpd:C00199")
781
- list.each do |reaction|
782
- puts reaction
783
- end
784
-
785
- puts "=== GENES"
786
-
787
- puts "### get_genes_by_organism('mge', 1, 5)"
788
- list = serv.get_genes_by_organism("mge", 1, 5)
789
- list.each do |gene|
790
- puts gene
791
- end
792
-
793
- puts "# * get_all_genes_by_organism('mge')"
794
- list = serv.get_all_genes_by_organism("mge")
795
- list.each do |gene|
796
- puts gene
797
- end
798
-
799
- puts "=== GENOME"
800
-
801
- puts "### get_number_of_genes_by_organism(org)"
802
- puts serv.get_number_of_genes_by_organism("mge")
803
-
804
- end
805
-