jandot-bio 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (335) hide show
  1. data/bin/bioruby +44 -0
  2. data/bin/br_biofetch.rb +47 -0
  3. data/bin/br_bioflat.rb +282 -0
  4. data/bin/br_biogetseq.rb +45 -0
  5. data/bin/br_pmfetch.rb +421 -0
  6. data/doc/Changes-0.7.rd +369 -0
  7. data/doc/KEGG_API.rd +1843 -0
  8. data/doc/KEGG_API.rd.ja +1834 -0
  9. data/doc/Tutorial.rd +1296 -0
  10. data/doc/Tutorial.rd.ja +2640 -0
  11. data/etc/bioinformatics/seqdatabase.ini +210 -0
  12. data/lib/bio.rb +279 -0
  13. data/lib/bio/alignment.rb +2518 -0
  14. data/lib/bio/appl/bl2seq/report.rb +334 -0
  15. data/lib/bio/appl/blast.rb +351 -0
  16. data/lib/bio/appl/blast/format0.rb +1438 -0
  17. data/lib/bio/appl/blast/format8.rb +83 -0
  18. data/lib/bio/appl/blast/report.rb +516 -0
  19. data/lib/bio/appl/blast/rexml.rb +135 -0
  20. data/lib/bio/appl/blast/rpsblast.rb +176 -0
  21. data/lib/bio/appl/blast/wublast.rb +550 -0
  22. data/lib/bio/appl/blast/xmlparser.rb +228 -0
  23. data/lib/bio/appl/blat/report.rb +489 -0
  24. data/lib/bio/appl/clustalw.rb +219 -0
  25. data/lib/bio/appl/clustalw/report.rb +152 -0
  26. data/lib/bio/appl/emboss.rb +203 -0
  27. data/lib/bio/appl/fasta.rb +237 -0
  28. data/lib/bio/appl/fasta/format10.rb +325 -0
  29. data/lib/bio/appl/gcg/msf.rb +212 -0
  30. data/lib/bio/appl/gcg/seq.rb +195 -0
  31. data/lib/bio/appl/genscan/report.rb +552 -0
  32. data/lib/bio/appl/hmmer.rb +126 -0
  33. data/lib/bio/appl/hmmer/report.rb +683 -0
  34. data/lib/bio/appl/iprscan/report.rb +374 -0
  35. data/lib/bio/appl/mafft.rb +259 -0
  36. data/lib/bio/appl/mafft/report.rb +226 -0
  37. data/lib/bio/appl/muscle.rb +52 -0
  38. data/lib/bio/appl/phylip/alignment.rb +129 -0
  39. data/lib/bio/appl/phylip/distance_matrix.rb +96 -0
  40. data/lib/bio/appl/probcons.rb +41 -0
  41. data/lib/bio/appl/psort.rb +548 -0
  42. data/lib/bio/appl/psort/report.rb +457 -0
  43. data/lib/bio/appl/pts1.rb +263 -0
  44. data/lib/bio/appl/sim4.rb +124 -0
  45. data/lib/bio/appl/sim4/report.rb +485 -0
  46. data/lib/bio/appl/sosui/report.rb +151 -0
  47. data/lib/bio/appl/spidey/report.rb +593 -0
  48. data/lib/bio/appl/targetp/report.rb +267 -0
  49. data/lib/bio/appl/tcoffee.rb +55 -0
  50. data/lib/bio/appl/tmhmm/report.rb +222 -0
  51. data/lib/bio/command.rb +337 -0
  52. data/lib/bio/data/aa.rb +349 -0
  53. data/lib/bio/data/codontable.rb +722 -0
  54. data/lib/bio/data/na.rb +223 -0
  55. data/lib/bio/db.rb +329 -0
  56. data/lib/bio/db/aaindex.rb +357 -0
  57. data/lib/bio/db/embl/common.rb +336 -0
  58. data/lib/bio/db/embl/embl.rb +402 -0
  59. data/lib/bio/db/embl/sptr.rb +1283 -0
  60. data/lib/bio/db/embl/swissprot.rb +42 -0
  61. data/lib/bio/db/embl/trembl.rb +41 -0
  62. data/lib/bio/db/embl/uniprot.rb +42 -0
  63. data/lib/bio/db/fantom.rb +599 -0
  64. data/lib/bio/db/fasta.rb +907 -0
  65. data/lib/bio/db/genbank/common.rb +290 -0
  66. data/lib/bio/db/genbank/ddbj.rb +22 -0
  67. data/lib/bio/db/genbank/genbank.rb +215 -0
  68. data/lib/bio/db/genbank/genpept.rb +60 -0
  69. data/lib/bio/db/genbank/refseq.rb +18 -0
  70. data/lib/bio/db/gff.rb +174 -0
  71. data/lib/bio/db/go.rb +481 -0
  72. data/lib/bio/db/kegg/brite.rb +41 -0
  73. data/lib/bio/db/kegg/compound.rb +131 -0
  74. data/lib/bio/db/kegg/drug.rb +98 -0
  75. data/lib/bio/db/kegg/enzyme.rb +148 -0
  76. data/lib/bio/db/kegg/expression.rb +155 -0
  77. data/lib/bio/db/kegg/genes.rb +263 -0
  78. data/lib/bio/db/kegg/genome.rb +241 -0
  79. data/lib/bio/db/kegg/glycan.rb +170 -0
  80. data/lib/bio/db/kegg/keggtab.rb +357 -0
  81. data/lib/bio/db/kegg/kgml.rb +256 -0
  82. data/lib/bio/db/kegg/orthology.rb +136 -0
  83. data/lib/bio/db/kegg/reaction.rb +82 -0
  84. data/lib/bio/db/kegg/taxonomy.rb +331 -0
  85. data/lib/bio/db/lasergene.rb +209 -0
  86. data/lib/bio/db/litdb.rb +107 -0
  87. data/lib/bio/db/medline.rb +323 -0
  88. data/lib/bio/db/nbrf.rb +191 -0
  89. data/lib/bio/db/newick.rb +658 -0
  90. data/lib/bio/db/nexus.rb +1854 -0
  91. data/lib/bio/db/pdb.rb +29 -0
  92. data/lib/bio/db/pdb/atom.rb +77 -0
  93. data/lib/bio/db/pdb/chain.rb +210 -0
  94. data/lib/bio/db/pdb/chemicalcomponent.rb +224 -0
  95. data/lib/bio/db/pdb/model.rb +148 -0
  96. data/lib/bio/db/pdb/pdb.rb +1911 -0
  97. data/lib/bio/db/pdb/residue.rb +176 -0
  98. data/lib/bio/db/pdb/utils.rb +399 -0
  99. data/lib/bio/db/prosite.rb +597 -0
  100. data/lib/bio/db/rebase.rb +457 -0
  101. data/lib/bio/db/soft.rb +404 -0
  102. data/lib/bio/db/transfac.rb +375 -0
  103. data/lib/bio/feature.rb +226 -0
  104. data/lib/bio/io/das.rb +461 -0
  105. data/lib/bio/io/dbget.rb +194 -0
  106. data/lib/bio/io/ddbjxml.rb +581 -0
  107. data/lib/bio/io/ebisoap.rb +158 -0
  108. data/lib/bio/io/ensembl.rb +229 -0
  109. data/lib/bio/io/fastacmd.rb +163 -0
  110. data/lib/bio/io/fetch.rb +181 -0
  111. data/lib/bio/io/flatfile.rb +1309 -0
  112. data/lib/bio/io/flatfile/bdb.rb +253 -0
  113. data/lib/bio/io/flatfile/index.rb +1371 -0
  114. data/lib/bio/io/flatfile/indexer.rb +787 -0
  115. data/lib/bio/io/higet.rb +73 -0
  116. data/lib/bio/io/hinv.rb +442 -0
  117. data/lib/bio/io/keggapi.rb +805 -0
  118. data/lib/bio/io/ncbirest.rb +256 -0
  119. data/lib/bio/io/ncbisoap.rb +155 -0
  120. data/lib/bio/io/pubmed.rb +307 -0
  121. data/lib/bio/io/registry.rb +292 -0
  122. data/lib/bio/io/soapwsdl.rb +119 -0
  123. data/lib/bio/io/sql.rb +365 -0
  124. data/lib/bio/location.rb +772 -0
  125. data/lib/bio/map.rb +410 -0
  126. data/lib/bio/pathway.rb +854 -0
  127. data/lib/bio/reference.rb +623 -0
  128. data/lib/bio/sequence.rb +475 -0
  129. data/lib/bio/sequence/aa.rb +125 -0
  130. data/lib/bio/sequence/common.rb +333 -0
  131. data/lib/bio/sequence/compat.rb +123 -0
  132. data/lib/bio/sequence/format.rb +181 -0
  133. data/lib/bio/sequence/generic.rb +24 -0
  134. data/lib/bio/sequence/na.rb +491 -0
  135. data/lib/bio/shell.rb +44 -0
  136. data/lib/bio/shell/core.rb +578 -0
  137. data/lib/bio/shell/demo.rb +146 -0
  138. data/lib/bio/shell/interface.rb +218 -0
  139. data/lib/bio/shell/irb.rb +95 -0
  140. data/lib/bio/shell/object.rb +71 -0
  141. data/lib/bio/shell/plugin/blast.rb +42 -0
  142. data/lib/bio/shell/plugin/codon.rb +218 -0
  143. data/lib/bio/shell/plugin/das.rb +58 -0
  144. data/lib/bio/shell/plugin/emboss.rb +23 -0
  145. data/lib/bio/shell/plugin/entry.rb +105 -0
  146. data/lib/bio/shell/plugin/flatfile.rb +101 -0
  147. data/lib/bio/shell/plugin/keggapi.rb +181 -0
  148. data/lib/bio/shell/plugin/midi.rb +430 -0
  149. data/lib/bio/shell/plugin/obda.rb +45 -0
  150. data/lib/bio/shell/plugin/psort.rb +56 -0
  151. data/lib/bio/shell/plugin/seq.rb +247 -0
  152. data/lib/bio/shell/plugin/soap.rb +87 -0
  153. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/bioruby_generator.rb +29 -0
  154. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_classes.rhtml +4 -0
  155. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_log.rhtml +27 -0
  156. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_methods.rhtml +11 -0
  157. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_modules.rhtml +4 -0
  158. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_variables.rhtml +7 -0
  159. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby-bg.gif +0 -0
  160. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby-gem.png +0 -0
  161. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby-link.gif +0 -0
  162. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby.css +368 -0
  163. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby.rhtml +47 -0
  164. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_controller.rb +144 -0
  165. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb +47 -0
  166. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/commands.rhtml +8 -0
  167. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/history.rhtml +10 -0
  168. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/index.rhtml +26 -0
  169. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/spinner.gif +0 -0
  170. data/lib/bio/shell/script.rb +25 -0
  171. data/lib/bio/shell/setup.rb +109 -0
  172. data/lib/bio/shell/web.rb +102 -0
  173. data/lib/bio/tree.rb +850 -0
  174. data/lib/bio/util/color_scheme.rb +191 -0
  175. data/lib/bio/util/color_scheme/buried.rb +59 -0
  176. data/lib/bio/util/color_scheme/helix.rb +59 -0
  177. data/lib/bio/util/color_scheme/hydropathy.rb +64 -0
  178. data/lib/bio/util/color_scheme/nucleotide.rb +31 -0
  179. data/lib/bio/util/color_scheme/strand.rb +59 -0
  180. data/lib/bio/util/color_scheme/taylor.rb +50 -0
  181. data/lib/bio/util/color_scheme/turn.rb +59 -0
  182. data/lib/bio/util/color_scheme/zappo.rb +50 -0
  183. data/lib/bio/util/contingency_table.rb +370 -0
  184. data/lib/bio/util/restriction_enzyme.rb +228 -0
  185. data/lib/bio/util/restriction_enzyme/analysis.rb +249 -0
  186. data/lib/bio/util/restriction_enzyme/analysis_basic.rb +217 -0
  187. data/lib/bio/util/restriction_enzyme/cut_symbol.rb +107 -0
  188. data/lib/bio/util/restriction_enzyme/double_stranded.rb +321 -0
  189. data/lib/bio/util/restriction_enzyme/double_stranded/aligned_strands.rb +130 -0
  190. data/lib/bio/util/restriction_enzyme/double_stranded/cut_location_pair.rb +103 -0
  191. data/lib/bio/util/restriction_enzyme/double_stranded/cut_location_pair_in_enzyme_notation.rb +38 -0
  192. data/lib/bio/util/restriction_enzyme/double_stranded/cut_locations.rb +76 -0
  193. data/lib/bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation.rb +107 -0
  194. data/lib/bio/util/restriction_enzyme/enzymes.yaml +7061 -0
  195. data/lib/bio/util/restriction_enzyme/range/cut_range.rb +24 -0
  196. data/lib/bio/util/restriction_enzyme/range/cut_ranges.rb +47 -0
  197. data/lib/bio/util/restriction_enzyme/range/horizontal_cut_range.rb +67 -0
  198. data/lib/bio/util/restriction_enzyme/range/sequence_range.rb +257 -0
  199. data/lib/bio/util/restriction_enzyme/range/sequence_range/calculated_cuts.rb +242 -0
  200. data/lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb +51 -0
  201. data/lib/bio/util/restriction_enzyme/range/sequence_range/fragments.rb +41 -0
  202. data/lib/bio/util/restriction_enzyme/range/vertical_cut_range.rb +77 -0
  203. data/lib/bio/util/restriction_enzyme/single_strand.rb +199 -0
  204. data/lib/bio/util/restriction_enzyme/single_strand/cut_locations_in_enzyme_notation.rb +135 -0
  205. data/lib/bio/util/restriction_enzyme/single_strand_complement.rb +23 -0
  206. data/lib/bio/util/restriction_enzyme/string_formatting.rb +111 -0
  207. data/lib/bio/util/sirna.rb +288 -0
  208. data/sample/any2fasta.rb +59 -0
  209. data/sample/biofetch.rb +475 -0
  210. data/sample/color_scheme_na.rb +91 -0
  211. data/sample/dbget +37 -0
  212. data/sample/enzymes.rb +78 -0
  213. data/sample/fasta2tab.rb +99 -0
  214. data/sample/fastagrep.rb +72 -0
  215. data/sample/fastasort.rb +54 -0
  216. data/sample/fsplit.rb +51 -0
  217. data/sample/gb2fasta.rb +30 -0
  218. data/sample/gb2tab.rb +325 -0
  219. data/sample/gbtab2mysql.rb +161 -0
  220. data/sample/genes2nuc.rb +33 -0
  221. data/sample/genes2pep.rb +33 -0
  222. data/sample/genes2tab.rb +81 -0
  223. data/sample/genome2rb.rb +29 -0
  224. data/sample/genome2tab.rb +76 -0
  225. data/sample/goslim.rb +303 -0
  226. data/sample/gt2fasta.rb +47 -0
  227. data/sample/na2aa.rb +34 -0
  228. data/sample/pmfetch.rb +42 -0
  229. data/sample/pmsearch.rb +42 -0
  230. data/sample/psortplot_html.rb +214 -0
  231. data/sample/ssearch2tab.rb +96 -0
  232. data/sample/tdiary.rb +158 -0
  233. data/sample/tfastx2tab.rb +100 -0
  234. data/sample/vs-genes.rb +212 -0
  235. data/test/data/HMMER/hmmpfam.out +64 -0
  236. data/test/data/HMMER/hmmsearch.out +88 -0
  237. data/test/data/SOSUI/sample.report +11 -0
  238. data/test/data/TMHMM/sample.report +21 -0
  239. data/test/data/aaindex/DAYM780301 +30 -0
  240. data/test/data/aaindex/PRAM900102 +20 -0
  241. data/test/data/bl2seq/cd8a_cd8b_blastp.bl2seq +53 -0
  242. data/test/data/bl2seq/cd8a_p53_e-5blastp.bl2seq +37 -0
  243. data/test/data/blast/2.2.15.blastp.m7 +876 -0
  244. data/test/data/blast/b0002.faa +15 -0
  245. data/test/data/blast/b0002.faa.m0 +128 -0
  246. data/test/data/blast/b0002.faa.m7 +65 -0
  247. data/test/data/blast/b0002.faa.m8 +1 -0
  248. data/test/data/embl/AB090716.embl +65 -0
  249. data/test/data/embl/AB090716.embl.rel89 +63 -0
  250. data/test/data/fasta/example1.txt +75 -0
  251. data/test/data/fasta/example2.txt +21 -0
  252. data/test/data/genscan/sample.report +63 -0
  253. data/test/data/iprscan/merged.raw +32 -0
  254. data/test/data/iprscan/merged.txt +74 -0
  255. data/test/data/prosite/prosite.dat +2233 -0
  256. data/test/data/refseq/nm_126355.entret +64 -0
  257. data/test/data/soft/GDS100_partial.soft +92 -0
  258. data/test/data/soft/GSE3457_family_partial.soft +874 -0
  259. data/test/data/uniprot/p53_human.uniprot +1456 -0
  260. data/test/functional/bio/io/test_ensembl.rb +186 -0
  261. data/test/functional/bio/io/test_soapwsdl.rb +52 -0
  262. data/test/runner.rb +14 -0
  263. data/test/unit/bio/appl/bl2seq/test_report.rb +134 -0
  264. data/test/unit/bio/appl/blast/test_report.rb +417 -0
  265. data/test/unit/bio/appl/blast/test_xmlparser.rb +388 -0
  266. data/test/unit/bio/appl/genscan/test_report.rb +182 -0
  267. data/test/unit/bio/appl/hmmer/test_report.rb +342 -0
  268. data/test/unit/bio/appl/iprscan/test_report.rb +338 -0
  269. data/test/unit/bio/appl/mafft/test_report.rb +63 -0
  270. data/test/unit/bio/appl/sosui/test_report.rb +81 -0
  271. data/test/unit/bio/appl/targetp/test_report.rb +146 -0
  272. data/test/unit/bio/appl/test_blast.rb +163 -0
  273. data/test/unit/bio/appl/test_fasta.rb +130 -0
  274. data/test/unit/bio/appl/test_pts1.rb +140 -0
  275. data/test/unit/bio/appl/tmhmm/test_report.rb +126 -0
  276. data/test/unit/bio/data/test_aa.rb +90 -0
  277. data/test/unit/bio/data/test_codontable.rb +107 -0
  278. data/test/unit/bio/data/test_na.rb +80 -0
  279. data/test/unit/bio/db/embl/test_common.rb +117 -0
  280. data/test/unit/bio/db/embl/test_embl.rb +214 -0
  281. data/test/unit/bio/db/embl/test_embl_rel89.rb +219 -0
  282. data/test/unit/bio/db/embl/test_sptr.rb +1775 -0
  283. data/test/unit/bio/db/embl/test_uniprot.rb +31 -0
  284. data/test/unit/bio/db/kegg/test_genes.rb +45 -0
  285. data/test/unit/bio/db/pdb/test_pdb.rb +152 -0
  286. data/test/unit/bio/db/test_aaindex.rb +197 -0
  287. data/test/unit/bio/db/test_fasta.rb +250 -0
  288. data/test/unit/bio/db/test_gff.rb +127 -0
  289. data/test/unit/bio/db/test_lasergene.rb +95 -0
  290. data/test/unit/bio/db/test_newick.rb +293 -0
  291. data/test/unit/bio/db/test_nexus.rb +360 -0
  292. data/test/unit/bio/db/test_prosite.rb +1437 -0
  293. data/test/unit/bio/db/test_rebase.rb +101 -0
  294. data/test/unit/bio/db/test_soft.rb +138 -0
  295. data/test/unit/bio/io/test_ddbjxml.rb +75 -0
  296. data/test/unit/bio/io/test_ensembl.rb +109 -0
  297. data/test/unit/bio/io/test_fastacmd.rb +42 -0
  298. data/test/unit/bio/io/test_flatfile.rb +237 -0
  299. data/test/unit/bio/io/test_soapwsdl.rb +32 -0
  300. data/test/unit/bio/sequence/test_aa.rb +103 -0
  301. data/test/unit/bio/sequence/test_common.rb +174 -0
  302. data/test/unit/bio/sequence/test_compat.rb +69 -0
  303. data/test/unit/bio/sequence/test_na.rb +330 -0
  304. data/test/unit/bio/shell/plugin/test_seq.rb +185 -0
  305. data/test/unit/bio/test_alignment.rb +1025 -0
  306. data/test/unit/bio/test_command.rb +288 -0
  307. data/test/unit/bio/test_db.rb +96 -0
  308. data/test/unit/bio/test_feature.rb +116 -0
  309. data/test/unit/bio/test_location.rb +39 -0
  310. data/test/unit/bio/test_map.rb +230 -0
  311. data/test/unit/bio/test_pathway.rb +473 -0
  312. data/test/unit/bio/test_reference.rb +224 -0
  313. data/test/unit/bio/test_sequence.rb +329 -0
  314. data/test/unit/bio/test_shell.rb +18 -0
  315. data/test/unit/bio/test_tree.rb +593 -0
  316. data/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb +299 -0
  317. data/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb +103 -0
  318. data/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb +240 -0
  319. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb +101 -0
  320. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb +75 -0
  321. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb +73 -0
  322. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb +53 -0
  323. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb +104 -0
  324. data/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb +83 -0
  325. data/test/unit/bio/util/restriction_enzyme/test_analysis.rb +246 -0
  326. data/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb +44 -0
  327. data/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb +115 -0
  328. data/test/unit/bio/util/restriction_enzyme/test_single_strand.rb +147 -0
  329. data/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb +147 -0
  330. data/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb +60 -0
  331. data/test/unit/bio/util/test_color_scheme.rb +33 -0
  332. data/test/unit/bio/util/test_contingency_table.rb +94 -0
  333. data/test/unit/bio/util/test_restriction_enzyme.rb +42 -0
  334. data/test/unit/bio/util/test_sirna.rb +245 -0
  335. metadata +479 -0
@@ -0,0 +1,135 @@
1
+ #
2
+ # = bio/appl/blast/rexml.rb - BLAST XML output (-m 7) parser by REXML
3
+ #
4
+ # Copyright:: Copyright (C) 2002, 2003 Toshiaki Katayama <k@bioruby.org>
5
+ # License:: The Ruby License
6
+ #
7
+ # $Id: rexml.rb,v 1.13 2008/05/12 13:11:45 ngoto Exp $
8
+ #
9
+ # == Note
10
+ #
11
+ # This file is automatically loaded by bio/appl/blast/report.rb
12
+ #
13
+
14
+ begin
15
+ require 'rexml/document'
16
+ rescue LoadError
17
+ end
18
+
19
+ module Bio
20
+ class Blast
21
+ class Report
22
+
23
+ private
24
+
25
+ def rexml_parse(xml)
26
+ dom = REXML::Document.new(xml)
27
+ rexml_parse_program(dom)
28
+ dom.elements.each("*//Iteration") do |e|
29
+ @iterations.push(rexml_parse_iteration(e))
30
+ end
31
+ end
32
+
33
+ def rexml_parse_program(dom)
34
+ hash = {}
35
+ dom.root.each_element_with_text do |e|
36
+ name, text = e.name, e.text
37
+ case name
38
+ when 'BlastOutput_param'
39
+ e.elements["Parameters"].each_element_with_text do |p|
40
+ xml_set_parameter(p.name, p.text)
41
+ end
42
+ else
43
+ hash[name] = text if text.strip.size > 0
44
+ end
45
+ end
46
+ @program = hash['BlastOutput_program']
47
+ @version = hash['BlastOutput_version']
48
+ @reference = hash['BlastOutput_reference']
49
+ @db = hash['BlastOutput_db']
50
+ @query_id = hash['BlastOutput_query-ID']
51
+ @query_def = hash['BlastOutput_query-def']
52
+ @query_len = hash['BlastOutput_query-len'].to_i
53
+ end
54
+
55
+ def rexml_parse_iteration(e)
56
+ iteration = Iteration.new
57
+ e.elements.each do |i|
58
+ case i.name
59
+ when 'Iteration_iter-num'
60
+ iteration.num = i.text.to_i
61
+ when 'Iteration_hits'
62
+ i.elements.each("Hit") do |h|
63
+ iteration.hits.push(rexml_parse_hit(h))
64
+ end
65
+ when 'Iteration_message'
66
+ iteration.message = i.text
67
+ when 'Iteration_stat'
68
+ i.elements["Statistics"].each_element_with_text do |s|
69
+ k = s.name.sub(/Statistics_/, '')
70
+ v = s.text =~ /\D/ ? s.text.to_f : s.text.to_i
71
+ iteration.statistics[k] = v
72
+ end
73
+ end
74
+ end
75
+ return iteration
76
+ end
77
+
78
+ def rexml_parse_hit(e)
79
+ hit = Hit.new
80
+ hash = {}
81
+ hit.query_id = @query_id
82
+ hit.query_def = @query_def
83
+ hit.query_len = @query_len
84
+ e.elements.each do |h|
85
+ case h.name
86
+ when 'Hit_hsps'
87
+ h.elements.each("Hsp") do |s|
88
+ hit.hsps.push(rexml_parse_hsp(s))
89
+ end
90
+ else
91
+ hash[h.name] = h.text
92
+ end
93
+ end
94
+ hit.num = hash['Hit_num'].to_i
95
+ hit.hit_id = hash['Hit_id']
96
+ hit.len = hash['Hit_len'].to_i
97
+ hit.definition = hash['Hit_def']
98
+ hit.accession = hash['Hit_accession']
99
+ return hit
100
+ end
101
+
102
+ def rexml_parse_hsp(e)
103
+ hsp = Hsp.new
104
+ hash = {}
105
+ e.each_element_with_text do |h|
106
+ hash[h.name] = h.text
107
+ end
108
+ hsp.num = hash['Hsp_num'].to_i
109
+ hsp.bit_score = hash['Hsp_bit-score'].to_f
110
+ hsp.score = hash['Hsp_score'].to_i
111
+ hsp.evalue = hash['Hsp_evalue'].to_f
112
+ hsp.query_from = hash['Hsp_query-from'].to_i
113
+ hsp.query_to = hash['Hsp_query-to'].to_i
114
+ hsp.hit_from = hash['Hsp_hit-from'].to_i
115
+ hsp.hit_to = hash['Hsp_hit-to'].to_i
116
+ hsp.pattern_from = hash['Hsp_pattern-from'].to_i
117
+ hsp.pattern_to = hash['Hsp_pattern-to'].to_i
118
+ hsp.query_frame = hash['Hsp_query-frame'].to_i
119
+ hsp.hit_frame = hash['Hsp_hit-frame'].to_i
120
+ hsp.identity = hash['Hsp_identity'].to_i
121
+ hsp.positive = hash['Hsp_positive'].to_i
122
+ hsp.gaps = hash['Hsp_gaps'].to_i
123
+ hsp.align_len = hash['Hsp_align-len'].to_i
124
+ hsp.density = hash['Hsp_density'].to_i
125
+ hsp.qseq = hash['Hsp_qseq']
126
+ hsp.hseq = hash['Hsp_hseq']
127
+ hsp.midline = hash['Hsp_midline']
128
+ return hsp
129
+ end
130
+
131
+ end
132
+ end
133
+ end
134
+
135
+
@@ -0,0 +1,176 @@
1
+ #
2
+ # = bio/appl/blast/rpsblast.rb - NCBI RPS Blast default output parser
3
+ #
4
+ # Copyright:: Copyright (C) 2008 Naohisa Goto <ng@bioruby.org>
5
+ # License:: The Ruby License
6
+ #
7
+ # $Id: rpsblast.rb,v 1.1 2008/04/15 13:54:39 ngoto Exp $
8
+ #
9
+ # == Description
10
+ #
11
+ # NCBI RPS Blast (Reversed Position Specific Blast) default
12
+ # (-m 0 option) output parser class, Bio::Blast::RPSBlast::Report
13
+ # and related classes/modules.
14
+ #
15
+ # == References
16
+ #
17
+ # * Altschul, Stephen F., Thomas L. Madden, Alejandro A. Schaffer,
18
+ # Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman (1997),
19
+ # "Gapped BLAST and PSI-BLAST: a new generation of protein database search
20
+ # programs", Nucleic Acids Res. 25:3389-3402.
21
+ # * ftp://ftp.ncbi.nih.gov/blast/documents/rpsblast.html
22
+ # * http://www.ncbi.nlm.nih.gov/Structure/cdd/cdd_help.shtml
23
+ #
24
+
25
+ require 'bio/appl/blast/format0'
26
+
27
+ module Bio
28
+ class Blast
29
+
30
+ # NCBI RPS Blast (Reversed Position Specific Blast) namespace.
31
+ # Currently, this module is existing only for separating namespace.
32
+ # To parse RPSBlast results, see Bio::Blast::RPSBlast::Report documents.
33
+ module RPSBlast
34
+
35
+ # NCBI RPS Blast (Reversed Position Specific Blast)
36
+ # default output parser.
37
+ #
38
+ # It supports defalut (-m 0 option) output of the "rpsblast" command.
39
+ #
40
+ # Because this class inherits Bio::Blast::Default::Report,
41
+ # almost all methods are eqaul to Bio::Blast::Default::Report.
42
+ # Only DELIMITER (and RS) and few methods are different.
43
+ #
44
+ # Note for multi-fasta result: When parsing output of rpsblast command
45
+ # with multi-fasta sequences as input data,
46
+ # each query's result is stored as an "iteration" of PSI-Blast,
47
+ # because rpsblast's output with multi-fasta input is hard to split
48
+ # by query.
49
+ # This behavior may be changed in the future.
50
+ #
51
+ # Note for nucleotide results: This class is not tested with
52
+ # nucleotide query and/or nucleotide databases.
53
+ #
54
+ class Report < Bio::Blast::Default::Report
55
+ # Delimter of each entry for TBLAST. Bio::FlatFile uses it.
56
+ DELIMITER = RS = "\nRPS-BLAST"
57
+
58
+ # (Integer) excess read size included in DELIMITER.
59
+ DELIMITER_OVERRUN = 9 # "RPS-BLAST"
60
+
61
+ # Creates a new Report object from a string.
62
+ #
63
+ # Note for multi-fasta results: When parsing an output of rpsblast
64
+ # command running with multi-fasta sequences,
65
+ # each query's result is stored as an "iteration" of PSI-Blast,
66
+ # because rpsblast's output with multi-fasta input is hard to split
67
+ # by query.
68
+ # This behavior may be changed in the future.
69
+ #
70
+ # Note for nucleotide results: This class is not tested with
71
+ # nucleotide query and/or nucleotide databases.
72
+ #
73
+ def initialize(str)
74
+ str = str.sub(/\A\s+/, '')
75
+ # remove trailing entries for sure
76
+ str.sub!(/\n(RPS\-BLAST.*)/m, "\n")
77
+ @entry_overrun = $1
78
+ @entry = str
79
+ data = str.split(/(?:^[ \t]*\n)+/)
80
+
81
+ format0_split_headers(data)
82
+ @iterations = format0_split_search(data)
83
+ format0_split_stat_params(data)
84
+ end
85
+
86
+ # Returns definition of the query.
87
+ # For a result of multi-fasta input, the first query's definition
88
+ # is returned (The same as <tt>iterations.first.query_def</tt>).
89
+ def query_def
90
+ iterations.first.query_def
91
+ end
92
+
93
+ # Returns length of the query.
94
+ # For a result of multi-fasta input, the first query's length
95
+ # is returned (The same as <tt>iterations.first.query_len</tt>).
96
+ def query_len
97
+ iterations.first.query_len
98
+ end
99
+
100
+ private
101
+
102
+ # Splits headers into the first line, reference, query line and
103
+ # database line.
104
+ def format0_split_headers(data)
105
+ @f0header = data.shift
106
+ @f0references = []
107
+ while data[0] and /\ADatabase\:/ !~ data[0]
108
+ @f0references.push data.shift
109
+ end
110
+ @f0database = data.shift
111
+ # In special case, a void line is inserted after database name.
112
+ if /\A +[\d\,]+ +sequences\; +[\d\,]+ total +letters\s*\z/ =~ data[0] then
113
+ @f0database.concat "\n"
114
+ @f0database.concat data.shift
115
+ end
116
+ end
117
+
118
+ # Splits the search results.
119
+ def format0_split_search(data)
120
+ iterations = []
121
+ dummystr = 'Searching..................................................done'
122
+ if r = data[0] and /^Searching/ =~ r then
123
+ dummystr = data.shift
124
+ end
125
+ while r = data[0] and /^Query\=/ =~ r
126
+ iterations << Iteration.new(data, dummystr)
127
+ end
128
+ iterations
129
+ end
130
+
131
+ # Iteration class for RPS-Blast.
132
+ # Though RPS-Blast does not iterate like PSI-BLAST,
133
+ # it aims to store a result of single query sequence.
134
+ #
135
+ # Normally, the instance of the class is generated
136
+ # by Bio::Blast::RPSBlast::Report object.
137
+ #
138
+ class Iteration < Bio::Blast::Default::Report::Iteration
139
+ # Creates a new Iteration object.
140
+ # It is designed to be called only internally from
141
+ # the Bio::Blast::RPSBlast::Report class.
142
+ # Users shall not use the method directly.
143
+ def initialize(data, dummystr)
144
+ if /\AQuery\=/ =~ data[0] then
145
+ sc = StringScanner.new(data.shift)
146
+ sc.skip(/\s*/)
147
+ if sc.skip_until(/Query\= */) then
148
+ q = []
149
+ begin
150
+ q << sc.scan(/.*/)
151
+ sc.skip(/\s*^ ?/)
152
+ end until !sc.rest or r = sc.skip(/ *\( *([\,\d]+) *letters *\)\s*\z/)
153
+ @query_len = sc[1].delete(',').to_i if r
154
+ @query_def = q.join(' ')
155
+ end
156
+ end
157
+ data.unshift(dummystr)
158
+
159
+ super(data)
160
+ end
161
+
162
+ # definition of the query
163
+ attr_reader :query_def
164
+
165
+ # length of the query sequence
166
+ attr_reader :query_len
167
+
168
+ end #class Iteration
169
+
170
+ end #class Report
171
+
172
+ end #module RPSBlast
173
+
174
+ end #module Blast
175
+ end #module Bio
176
+
@@ -0,0 +1,550 @@
1
+ #
2
+ # = bio/appl/blast/wublast.rb - WU-BLAST default output parser
3
+ #
4
+ # Copyright:: Copyright (C) 2003 GOTO Naohisa <ng@bioruby.org>
5
+ # License:: The Ruby License
6
+ #
7
+ # $Id: wublast.rb,v 1.12 2007/12/27 17:28:57 ngoto Exp $
8
+ #
9
+ # == Description
10
+ #
11
+ # WU-BLAST default output parser.
12
+ #
13
+ # The parser is still incomplete and may contain many bugs,
14
+ # because I didn't have WU-BLAST license.
15
+ # It was tested under web-based WU-BLAST results and
16
+ # obsolete version downloaded from http://blast.wustl.edu/ .
17
+ #
18
+ # == References
19
+ #
20
+ # * http://blast.wustl.edu/
21
+ # * http://www.ebi.ac.uk/blast2/
22
+ #
23
+
24
+ require 'bio/appl/blast/format0'
25
+
26
+ module Bio
27
+ class Blast
28
+ module WU #:nodoc:
29
+
30
+ # Bio::Blast::WU::Report parses WU-BLAST default output
31
+ # and stores information in the data.
32
+ # It may contain a Bio::Blast::WU::Report::Iteration object.
33
+ # Because it inherits Bio::Blast::Default::Report,
34
+ # please also refer Bio::Blast::Default::Report.
35
+ class Report < Default::Report
36
+
37
+ # Returns parameters (???)
38
+ def parameters
39
+ parse_parameters
40
+ @parameters
41
+ end
42
+
43
+ # Returns parameter matrix (???)
44
+ def parameter_matrix
45
+ parse_parameters
46
+ @parameter_matrix
47
+ end
48
+
49
+ # Returns e-value threshold specified when BLAST was executed.
50
+ def expect; parse_parameters; @parameters['E']; end
51
+
52
+ # Returns warning messages.
53
+ def warnings
54
+ unless defined?(@warnings)
55
+ @warnings = @f0warnings
56
+ iterations.each { |x| @warnings.concat(x.warnings) }
57
+ end
58
+ @warnings
59
+ end
60
+
61
+ # Returns notice messages.
62
+ def notice
63
+ unless defined?(@notice)
64
+ @notice = @f0notice.to_s.gsub(/\s+/, ' ').strip
65
+ end #unless
66
+ @notice
67
+ end
68
+
69
+ private
70
+ # Splits headers.
71
+ def format0_split_headers(data)
72
+ @f0header = data.shift
73
+ @f0references = []
74
+ while r = data.first
75
+ case r
76
+ when /^Reference\: /
77
+ @f0references.push data.shift
78
+ when /^Copyright /
79
+ @f0copyright = data.shift
80
+ when /^Notice\: /
81
+ @f0notice = data.shift
82
+ when /^Query\= /
83
+ break
84
+ else
85
+ break
86
+ end
87
+ end
88
+ @f0query = data.shift
89
+ if r = data.first and !(/^Database\: / =~ r)
90
+ @f0translate_info = data.shift
91
+ end
92
+ @f0database = data.shift
93
+ end
94
+
95
+ # Splits search data.
96
+ def format0_split_search(data)
97
+ [ Iteration.new(data) ]
98
+ end
99
+
100
+ # Splits statistics parameters.
101
+ def format0_split_stat_params(data)
102
+ @f0warnings = []
103
+ if r = data.first and r =~ /^WARNING\: / then
104
+ @f0warnings << data.shift
105
+ end
106
+ @f0wu_params = []
107
+ @f0wu_stats = []
108
+ while r = data.shift and !(r =~ /^Statistics\:/)
109
+ @f0wu_params << r
110
+ end
111
+ @f0wu_stats << r if r
112
+ while r = data.shift
113
+ @f0wu_stats << r
114
+ end
115
+ @f0dbstat = F0dbstat.new(@f0wu_stats)
116
+ itr = @iterations[0]
117
+ x = @f0dbstat
118
+ itr.instance_eval { @f0dbstat = x } if itr
119
+ end
120
+
121
+ # Splits parameters.
122
+ def parse_parameters
123
+ unless defined?(@parse_parameters)
124
+ @parameters = {}
125
+ @parameter_matrix = []
126
+ @f0wu_params.each do |x|
127
+ if /^ Query/ =~ x then
128
+ @parameter_matrix << x
129
+ else
130
+ x.split(/^/).each do |y|
131
+ if /\A\s*(.+)\s*\=\s*(.*)\s*/ =~ y then
132
+ @parameters[$1] = $2
133
+ elsif /\AParameters\:/ =~ y then
134
+ ; #ignore this
135
+ elsif /\A\s*(.+)\s*$/ =~ y then
136
+ @parameters[$1] = true
137
+ end
138
+ end
139
+ end
140
+ end
141
+ if ev = @parameters['E'] then
142
+ ev = '1' + ev if ev[0] == ?e
143
+ @parameters['E'] = ev.to_f
144
+ end
145
+ @parse_parameters = true
146
+ end
147
+ end
148
+
149
+ # Stores database statistics.
150
+ # Internal use only. Users must not use the class.
151
+ class F0dbstat < Default::Report::F0dbstat #:nodoc:
152
+ def initialize(ary)
153
+ @f0stat = ary
154
+ @hash = {}
155
+ end
156
+
157
+ #--
158
+ #undef :f0params
159
+ #undef :matrix, :gap_open, :gap_extend,
160
+ # :eff_space, :expect, :sc_match, :sc_mismatch,
161
+ # :num_hits
162
+ #++
163
+
164
+ # Parses database statistics.
165
+ def parse_dbstat
166
+ unless defined?(@parse_dbstat)
167
+ parse_colon_separated_params(@hash, @f0stat)
168
+ @database = @hash['Database']
169
+ @posted_date = @hash['Posted']
170
+ if val = @hash['# of letters in database'] then
171
+ @db_len = val.tr(',', '').to_i
172
+ end
173
+ if val = @hash['# of sequences in database'] then
174
+ @db_num = val.tr(',', '').to_i
175
+ end
176
+ @parse_dbstat = true
177
+ end #unless
178
+ end #def
179
+ private :parse_dbstat
180
+
181
+ end #class F0dbstat
182
+
183
+ #--
184
+ #class Frame
185
+ #end #class FrameParams
186
+ #++
187
+
188
+ # Iteration class for WU-BLAST report.
189
+ # Though WU-BLAST does not iterate like PSI-BLAST,
190
+ # Bio::Blast::WU::Report::Iteration aims to keep compatibility
191
+ # with Bio::Blast::Default::Report::* classes.
192
+ # It may contain some Bio::Blast::WU::Report::Hit objects.
193
+ # Because it inherits Bio::Blast::Default::Report::Iteration,
194
+ # please also refer Bio::Blast::Default::Report::Iteration.
195
+ class Iteration < Default::Report::Iteration
196
+ # Creates a new Iteration object.
197
+ # It is designed to be called only internally from
198
+ # the Bio::Blast::WU::Report class.
199
+ # Users shall not use the method directly.
200
+ def initialize(data)
201
+ @f0stat = []
202
+ @f0dbstat = Default::Report::AlwaysNil.instance
203
+ @f0hitlist = []
204
+ @hits = []
205
+ @num = 1
206
+ @f0message = []
207
+ @f0warnings = []
208
+ return unless r = data.shift
209
+ @f0hitlist << r
210
+ return unless r = data.shift
211
+ unless /\*{3} +NONE +\*{3}/ =~ r then
212
+ @f0hitlist << r
213
+ while r = data.first and /^WARNING\: / =~ r
214
+ @f0warnings << data.shift
215
+ end
216
+ while r = data.first and /^\>/ =~ r
217
+ @hits << Hit.new(data)
218
+ end
219
+ end #unless
220
+ end
221
+
222
+ # Returns warning messages.
223
+ def warnings
224
+ @f0warnings
225
+ end
226
+
227
+ private
228
+ # Parses hit list.
229
+ def parse_hitlist
230
+ unless defined?(@parse_hitlist)
231
+ r = @f0hitlist.shift.to_s
232
+ if /Reading/ =~ r and /Frame/ =~ r then
233
+ flag_tblast = true
234
+ spnum = 5
235
+ else
236
+ flag_tblast = nil
237
+ spnum = 4
238
+ end
239
+ i = 0
240
+ @f0hitlist.each do |x|
241
+ b = x.split(/^/)
242
+ b.collect! { |y| y.empty? ? nil : y }
243
+ b.compact!
244
+ b.each do |y|
245
+ y.strip!
246
+ y.reverse!
247
+ z = y.split(/\s+/, spnum)
248
+ z.each { |y| y.reverse! }
249
+ dfl = z.pop
250
+ h = @hits[i]
251
+ unless h then
252
+ h = Hit.new([ dfl.to_s.sub(/\.+\z/, '') ])
253
+ @hits[i] = h
254
+ end
255
+ z.pop if flag_tblast #ignore Reading Frame
256
+ scr = z.pop
257
+ scr = (scr ? scr.to_i : nil)
258
+ pval = z.pop.to_s
259
+ pval = '1' + pval if pval[0] == ?e
260
+ pval = (pval.empty? ? (1.0/0.0) : pval.to_f)
261
+ nnum = z.pop.to_i
262
+ h.instance_eval {
263
+ @score = scr
264
+ @pvalue = pval
265
+ @n_number = nnum
266
+ }
267
+ i += 1
268
+ end
269
+ end #each
270
+ @parse_hitlist = true
271
+ end #unless
272
+ end
273
+ end #class Iteration
274
+
275
+ # Bio::Blast::WU::Report::Hit contains information about a hit.
276
+ # It may contain some Bio::Blast::WU::Report::HSP objects.
277
+ #
278
+ # Because it inherits Bio::Blast::Default::Report::Hit,
279
+ # please also refer Bio::Blast::Default::Report::Hit.
280
+ class Hit < Default::Report::Hit
281
+ # Creates a new Hit object.
282
+ # It is designed to be called only internally from the
283
+ # Bio::Blast::WU::Report::Iteration class.
284
+ # Users should not call the method directly.
285
+ def initialize(data)
286
+ @f0hitname = data.shift
287
+ @hsps = []
288
+ while r = data.first
289
+ if r =~ /^\s*(?:Plus|Minus) +Strand +HSPs\:/ then
290
+ data.shift
291
+ r = data.first
292
+ end
293
+ if /\A\s+Score/ =~ r then
294
+ @hsps << HSP.new(data)
295
+ else
296
+ break
297
+ end
298
+ end
299
+ @again = false
300
+ end
301
+
302
+ # Returns score.
303
+ def score
304
+ @score
305
+ end
306
+ # p-value
307
+ attr_reader :pvalue
308
+ # n-number (???)
309
+ attr_reader :n_number
310
+ end #class Hit
311
+
312
+ # Bio::Blast::WU::Report::HSP holds information about the hsp
313
+ # (high-scoring segment pair).
314
+ #
315
+ # Because it inherits Bio::Blast::Default::Report::HSP,
316
+ # please also refer Bio::Blast::Default::Report::HSP.
317
+ class HSP < Default::Report::HSP
318
+ # p-value
319
+ attr_reader :pvalue if false #dummy
320
+ method_after_parse_score :pvalue
321
+ # p_sum_n (???)
322
+ attr_reader :p_sum_n if false #dummy
323
+ method_after_parse_score :p_sum_n
324
+ end #class HSP
325
+
326
+ end #class Report
327
+
328
+ # WU-BLAST default output parser for TBLAST.
329
+ # All methods are equal to Bio::Blast::WU::Report.
330
+ # Only DELIMITER (and RS) is different.
331
+ class Report_TBlast < Report
332
+ # Delimter of each entry for TBLAST. Bio::FlatFile uses it.
333
+ DELIMITER = RS = "\nTBLAST"
334
+
335
+ # (Integer) excess read size included in DELIMITER.
336
+ DELIMITER_OVERRUN = 6 # "TBLAST"
337
+ end #class Report_TBlast
338
+
339
+ end #module WU
340
+ end #class Blast
341
+ end #module Bio
342
+
343
+ ######################################################################
344
+
345
+ if __FILE__ == $0
346
+
347
+ Bio::FlatFile.open(Bio::Blast::WU::Report, ARGF) do |ff|
348
+ ff.each do |rep|
349
+
350
+ print "# === Bio::Blast::WU::Report\n"
351
+ puts
352
+ print " rep.program #=> "; p rep.program
353
+ print " rep.version #=> "; p rep.version
354
+ print " rep.reference #=> "; p rep.reference
355
+ print " rep.notice #=> "; p rep.notice
356
+ print " rep.db #=> "; p rep.db
357
+ #print " rep.query_id #=> "; p rep.query_id
358
+ print " rep.query_def #=> "; p rep.query_def
359
+ print " rep.query_len #=> "; p rep.query_len
360
+ #puts
361
+ print " rep.version_number #=> "; p rep.version_number
362
+ print " rep.version_date #=> "; p rep.version_date
363
+ puts
364
+
365
+ print "# === Parameters\n"
366
+ #puts
367
+ print " rep.parameters #=> "; p rep.parameters
368
+ puts
369
+ #@#print " rep.matrix #=> "; p rep.matrix
370
+ print " rep.expect #=> "; p rep.expect
371
+ #print " rep.inclusion #=> "; p rep.inclusion
372
+ #@#print " rep.sc_match #=> "; p rep.sc_match
373
+ #@#print " rep.sc_mismatch #=> "; p rep.sc_mismatch
374
+ #@#print " rep.gap_open #=> "; p rep.gap_open
375
+ #@#print " rep.gap_extend #=> "; p rep.gap_extend
376
+ #print " rep.filter #=> "; p rep.filter
377
+ #@#print " rep.pattern #=> "; p rep.pattern
378
+ #print " rep.entrez_query #=> "; p rep.entrez_query
379
+ #puts
380
+ #@#print " rep.pattern_positions #=> "; p rep.pattern_positions
381
+ puts
382
+
383
+ print "# === Statistics (last iteration's)\n"
384
+ #puts
385
+ #print " rep.statistics #=> "; p rep.statistics
386
+ puts
387
+ print " rep.db_num #=> "; p rep.db_num
388
+ print " rep.db_len #=> "; p rep.db_len
389
+ #print " rep.hsp_len #=> "; p rep.hsp_len
390
+ #@#print " rep.eff_space #=> "; p rep.eff_space
391
+ #@#print " rep.kappa #=> "; p rep.kappa
392
+ #@#print " rep.lambda #=> "; p rep.lambda
393
+ #@#print " rep.entropy #=> "; p rep.entropy
394
+ puts
395
+ #@#print " rep.num_hits #=> "; p rep.num_hits
396
+ #@#print " rep.gapped_kappa #=> "; p rep.gapped_kappa
397
+ #@#print " rep.gapped_lambda #=> "; p rep.gapped_lambda
398
+ #@#print " rep.gapped_entropy #=> "; p rep.gapped_entropy
399
+ #@#print " rep.posted_date #=> "; p rep.posted_date
400
+ puts
401
+
402
+ #@#print "# === Message (last iteration's)\n"
403
+ #@#puts
404
+ #@#print " rep.message #=> "; p rep.message
405
+ #puts
406
+ #@#print " rep.converged? #=> "; p rep.converged?
407
+ #puts
408
+
409
+ print "# === Warning messages\n"
410
+ print " rep.warnings #=> "; p rep.warnings
411
+
412
+ print "# === Iterations\n"
413
+ puts
414
+ print " rep.itrerations.each do |itr|\n"
415
+ puts
416
+
417
+ rep.iterations.each do |itr|
418
+
419
+ print "# --- Bio::Blast::WU::Report::Iteration\n"
420
+ puts
421
+
422
+ print " itr.num #=> "; p itr.num
423
+ #print " itr.statistics #=> "; p itr.statistics
424
+ puts
425
+ print " itr.warnings #=> "; p itr.warnings
426
+ print " itr.message #=> "; p itr.message
427
+ print " itr.hits.size #=> "; p itr.hits.size
428
+ #puts
429
+ #@#print " itr.hits_newly_found.size #=> "; p itr.hits_newly_found.size;
430
+ #@#print " itr.hits_found_again.size #=> "; p itr.hits_found_again.size;
431
+ if itr.hits_for_pattern then
432
+ itr.hits_for_pattern.each_with_index do |hp, hpi|
433
+ print " itr.hits_for_pattern[#{hpi}].size #=> "; p hp.size;
434
+ end
435
+ end
436
+ print " itr.converged? #=> "; p itr.converged?
437
+ puts
438
+
439
+ print " itr.hits.each do |hit|\n"
440
+ puts
441
+
442
+ itr.hits.each_with_index do |hit, i|
443
+
444
+ print "# --- Bio::Blast::WU::Report::Hit"
445
+ print " ([#{i}])\n"
446
+ puts
447
+
448
+ #print " hit.num #=> "; p hit.num
449
+ #print " hit.hit_id #=> "; p hit.hit_id
450
+ print " hit.len #=> "; p hit.len
451
+ print " hit.definition #=> "; p hit.definition
452
+ #print " hit.accession #=> "; p hit.accession
453
+ #puts
454
+ print " hit.found_again? #=> "; p hit.found_again?
455
+ #puts
456
+ print " hit.score #=> "; p hit.score
457
+ print " hit.pvalue #=> "; p hit.pvalue
458
+ print " hit.n_number #=> "; p hit.n_number
459
+
460
+ print " --- compatible/shortcut ---\n"
461
+ #print " hit.query_id #=> "; p hit.query_id
462
+ #print " hit.query_def #=> "; p hit.query_def
463
+ #print " hit.query_len #=> "; p hit.query_len
464
+ #print " hit.target_id #=> "; p hit.target_id
465
+ print " hit.target_def #=> "; p hit.target_def
466
+ print " hit.target_len #=> "; p hit.target_len
467
+
468
+ print " --- first HSP's values (shortcut) ---\n"
469
+ print " hit.evalue #=> "; p hit.evalue
470
+ print " hit.bit_score #=> "; p hit.bit_score
471
+ print " hit.identity #=> "; p hit.identity
472
+ #print " hit.overlap #=> "; p hit.overlap
473
+
474
+ print " hit.query_seq #=> "; p hit.query_seq
475
+ print " hit.midline #=> "; p hit.midline
476
+ print " hit.target_seq #=> "; p hit.target_seq
477
+
478
+ print " hit.query_start #=> "; p hit.query_start
479
+ print " hit.query_end #=> "; p hit.query_end
480
+ print " hit.target_start #=> "; p hit.target_start
481
+ print " hit.target_end #=> "; p hit.target_end
482
+ print " hit.lap_at #=> "; p hit.lap_at
483
+ print " --- first HSP's vaules (shortcut) ---\n"
484
+ print " --- compatible/shortcut ---\n"
485
+
486
+ puts
487
+ print " hit.hsps.size #=> "; p hit.hsps.size
488
+ if hit.hsps.size == 0 then
489
+ puts " (HSP not found: please see blastall's -b and -v options)"
490
+ puts
491
+ else
492
+
493
+ puts
494
+ print " hit.hsps.each do |hsp|\n"
495
+ puts
496
+
497
+ hit.hsps.each_with_index do |hsp, j|
498
+
499
+ print "# --- Bio::Blast::WU::Report::Hsp"
500
+ print " ([#{j}])\n"
501
+ puts
502
+ #print " hsp.num #=> "; p hsp.num
503
+ print " hsp.bit_score #=> "; p hsp.bit_score
504
+ print " hsp.score #=> "; p hsp.score
505
+ print " hsp.evalue #=> "; p hsp.evalue
506
+ print " hsp.identity #=> "; p hsp.identity
507
+ print " hsp.gaps #=> "; p hsp.gaps
508
+ print " hsp.positive #=> "; p hsp.positive
509
+ print " hsp.align_len #=> "; p hsp.align_len
510
+ #print " hsp.density #=> "; p hsp.density
511
+ puts
512
+ print " hsp.pvalue #=> "; p hsp.pvalue
513
+ print " hsp.p_sum_n #=> "; p hsp.p_sum_n
514
+ puts
515
+
516
+ print " hsp.query_frame #=> "; p hsp.query_frame
517
+ print " hsp.query_from #=> "; p hsp.query_from
518
+ print " hsp.query_to #=> "; p hsp.query_to
519
+
520
+ print " hsp.hit_frame #=> "; p hsp.hit_frame
521
+ print " hsp.hit_from #=> "; p hsp.hit_from
522
+ print " hsp.hit_to #=> "; p hsp.hit_to
523
+
524
+ #print " hsp.pattern_from#=> "; p hsp.pattern_from
525
+ #print " hsp.pattern_to #=> "; p hsp.pattern_to
526
+
527
+ print " hsp.qseq #=> "; p hsp.qseq
528
+ print " hsp.midline #=> "; p hsp.midline
529
+ print " hsp.hseq #=> "; p hsp.hseq
530
+ puts
531
+ print " hsp.percent_identity #=> "; p hsp.percent_identity
532
+ #print " hsp.mismatch_count #=> "; p hsp.mismatch_count
533
+ #
534
+ print " hsp.query_strand #=> "; p hsp.query_strand
535
+ print " hsp.hit_strand #=> "; p hsp.hit_strand
536
+ print " hsp.percent_positive #=> "; p hsp.percent_positive
537
+ print " hsp.percent_gaps #=> "; p hsp.percent_gaps
538
+ puts
539
+
540
+ end #each
541
+ end #if hit.hsps.size == 0
542
+ end
543
+ end
544
+ end #ff.each
545
+ end #FlatFile.open
546
+
547
+ end #if __FILE__ == $0
548
+
549
+ ######################################################################
550
+