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,151 @@
1
+ #
2
+ # = bio/appl/sosui/report.rb - SOSUI report class
3
+ #
4
+ # Copyright:: Copyright (C) 2003
5
+ # Mitsuteru C. Nakao <n@bioruby.org>
6
+ # License:: The Ruby License
7
+ #
8
+ # $Id: report.rb,v 1.11 2007/04/05 23:35:40 trevor Exp $
9
+ #
10
+ # == Example
11
+ #
12
+ # == References
13
+ #
14
+ # * http://sosui.proteome.bio.tuat.ac.jp/sosui_submit.html
15
+ #
16
+
17
+
18
+ module Bio
19
+
20
+ class SOSUI
21
+
22
+ # = SOSUI output report parsing class
23
+ #
24
+ # == References
25
+ # * http://sosui.proteome.bio.tuat.ac.jp/sosui_submit.html
26
+ class Report
27
+
28
+ # Delimiter
29
+ DELIMITER = "\n>"
30
+ RS = DELIMITER
31
+
32
+ # Query entry_id
33
+ attr_reader :entry_id
34
+
35
+ # Returns the prediction result whether "MEMBRANE PROTEIN" or
36
+ # "SOLUBLE PROTEIN".
37
+ attr_reader :prediction
38
+
39
+ # Transmembrane helixes ary
40
+ attr_reader :tmhs
41
+
42
+ # Parser for SOSUI output report.
43
+ def initialize(output_report)
44
+ entry = output_report.split(/\n/)
45
+
46
+ @entry_id = entry[0].strip.sub(/^>/,'')
47
+ @prediction = entry[1].strip
48
+ @tms = 0
49
+ @tmhs = []
50
+ parse_tmh(entry) if /MEMBRANE/ =~ @prediction
51
+ end
52
+
53
+ private
54
+
55
+ # Parser for TMH lines.
56
+ def parse_tmh(entry)
57
+ entry.each do |line|
58
+ if /NUMBER OF TM HELIX = (\d+)/ =~ line
59
+ @tms = $1
60
+ elsif /TM (\d+) +(\d+)- *(\d+) (\w+) +(\w+)/ =~ line
61
+ tmh = $1.to_i
62
+ range = Range.new($2.to_i, $3.to_i)
63
+ grade = $4
64
+ seq = $5
65
+ @tmhs.push(TMH.new(range, grade, seq))
66
+ end
67
+ end
68
+ end
69
+
70
+
71
+ # = Bio::SOSUI::Report::TMH
72
+ # Container class for transmembrane helix information.
73
+ #
74
+ # TM 1 31- 53 SECONDARY HIRMTFLRKVYSILSLQVLLTTV
75
+ class TMH
76
+
77
+ # Returns aRng of transmembrane helix
78
+ attr_reader :range
79
+
80
+ # Retruns ``PRIMARY'' or ``SECONDARY'' of helix.
81
+ attr_reader :grade
82
+
83
+ # Returns the sequence. of transmembrane helix.
84
+ attr_reader :sequence
85
+
86
+ # Sets values.
87
+ def initialize(range, grade, sequence)
88
+ @range = range
89
+ @grade = grade
90
+ @sequence = sequence
91
+ end
92
+ end
93
+
94
+ end # class Report
95
+
96
+ end # class SOSUI
97
+
98
+ end # module Bio
99
+
100
+
101
+
102
+ if __FILE__ == $0
103
+
104
+ begin
105
+ require 'pp'
106
+ alias p pp
107
+ rescue LoadError
108
+ end
109
+
110
+
111
+ sample = <<HOGE
112
+ >HOGE1
113
+ MEMBRANE PROTEIN
114
+ NUMBER OF TM HELIX = 6
115
+ TM 1 12- 34 SECONDARY LLVPILLPEKCYDQLFVQWDLLH
116
+ TM 2 36- 58 PRIMARY PCLKILLSKGLGLGIVAGSLLVK
117
+ TM 3 102- 124 SECONDARY SWGEALFLMLQTITICFLVMHYR
118
+ TM 4 126- 148 PRIMARY QTVKGVAFLACYGLVLLVLLSPL
119
+ TM 5 152- 174 SECONDARY TVVTLLQASNVPAVVVGRLLQAA
120
+ TM 6 214- 236 SECONDARY AGTFVVSSLCNGLIAAQLLFYWN
121
+
122
+ >HOGE2
123
+ SOLUBLE PROTEIN
124
+
125
+ HOGE
126
+
127
+ def hoge(ent)
128
+ puts '==='
129
+ puts ent
130
+ puts '==='
131
+ sosui = Bio::SOSUI::Report.new(ent)
132
+ p [:entry_id, sosui.entry_id]
133
+ p [:prediction, sosui.prediction]
134
+ p [:tmhs.size, sosui.tmhs]
135
+ pp [:tmhs, sosui.tmh]
136
+ end
137
+
138
+ sample.split(/#{Bio::SOSUI::Report::DELIMITER}/).each {|ent|
139
+ hoge(ent)
140
+ }
141
+
142
+ exit if ARGV.size == 0
143
+
144
+ while ent = $<.gets(Bio::SOSUI::Report::DELIMITER)
145
+ hoge(ent)
146
+ end
147
+
148
+ end
149
+
150
+
151
+
@@ -0,0 +1,593 @@
1
+ #
2
+ # = bio/appl/spidey/report.rb - SPIDEY result parser
3
+ #
4
+ # Copyright:: Copyright (C) 2004 GOTO Naohisa <ng@bioruby.org>
5
+ # License:: The Ruby License
6
+ #
7
+ # $Id: report.rb,v 1.10 2007/04/05 23:35:40 trevor Exp $
8
+ #
9
+ # NCBI Spidey result parser.
10
+ # Currently, output of default (-p 0 option) or -p 1 option are supported.
11
+ #
12
+ # == Notes
13
+ #
14
+ # The mRNA sequence is regarded as a query, and
15
+ # the enomic sequence is regarded as a target (subject, hit).
16
+ #
17
+ # == References
18
+ #
19
+ # * Wheelan, S.J., et al., Spidey: a tool for mRNA-to-genomic alignments,
20
+ # Genome Research, 11, 1952--1957, 2001.
21
+ # http://www.genome.org/cgi/content/abstract/11/11/1952
22
+ # * http://www.ncbi.nlm.nih.gov/spidey/
23
+ #
24
+
25
+ require 'bio'
26
+
27
+ module Bio
28
+ class Spidey
29
+
30
+ # Spidey report parser class.
31
+ # Please see bio/appl/spidey/report.rb for details.
32
+ #
33
+ # Its object may contain some Bio::Spidey::Report::Hit objects.
34
+ class Report #< DB
35
+ #--
36
+ # File format: -p 0 (default) or -p 1 options
37
+ #++
38
+
39
+ # Delimiter of each entry. Bio::FlatFile uses it.
40
+ DELIMITER = RS = "\n--SPIDEY "
41
+
42
+ # (Integer) excess read size included in DELIMITER.
43
+ DELIMITER_OVERRUN = 9 # "--SPIDEY ".length
44
+
45
+ # Creates a new Bio::Spidey::Report object from String.
46
+ # You can use Bio::FlatFile to read a file.
47
+ def initialize(str)
48
+ str = str.sub(/\A\s+/, '')
49
+ str.sub!(/\n(^\-\-SPIDEY .*)/m, '') # remove trailing entries for sure
50
+ @entry_overrun = $1
51
+ data = str.split(/\r?\n(?:\r?\n)+/)
52
+ d0 = data.shift.to_s.split(/\r?\n/)
53
+ @hit = Hit.new(data, d0)
54
+ @all_hits = [ @hit ]
55
+ if d0.empty? or /\ANo alignment found\.\s*\z/ =~ d0[-1] then
56
+ @hits = []
57
+ else
58
+ @hits = [ @hit ]
59
+ end
60
+ end
61
+ # piece of next entry. Bio::FlatFile uses it.
62
+ attr_reader :entry_overrun
63
+
64
+ # Returns an Array of Bio::Spidey::Report::Hit objects.
65
+ # Because current version of SPIDEY supports only 1 genomic sequences,
66
+ # the number of hits is 1 or 0.
67
+ attr_reader :hits
68
+
69
+ # Returns an Array of Bio::Spidey::Report::Hit objects.
70
+ # Unlike Bio::Spidey::Report#hits, the method returns
71
+ # results of all trials of pairwise alignment.
72
+ # This would be a Bio::Spidey specific method.
73
+ attr_reader :all_hits
74
+
75
+ # SeqDesc stores sequence information of query or subject.
76
+ class SeqDesc
77
+ #--
78
+ # description/definitions of a sequence
79
+ #++
80
+
81
+ # Creates a new SeqDesc object.
82
+ # It is designed to be called from Bio::Spidey::Report::* classes.
83
+ # Users shall not call it directly.
84
+ def initialize(seqid, seqdef, len)
85
+ @entry_id = seqid
86
+ @definition = seqdef
87
+ @len = len
88
+ end
89
+
90
+ # Identifier of the sequence.
91
+ attr_reader :entry_id
92
+
93
+ # Definition of the sequence.
94
+ attr_reader :definition
95
+
96
+ # Length of the sequence.
97
+ attr_reader :len
98
+
99
+ # Parses piece of Spidey result text and creates a new SeqDesc object.
100
+ # It is designed to be called from Bio::Spidey::Report::* classes.
101
+ # Users shall not call it directly.
102
+ def self.parse(str)
103
+ /^(Genomic|mRNA)\:\s*(([^\s]*) (.+))\, (\d+) bp\s*$/ =~ str.to_s
104
+ seqid = $3
105
+ seqdef = $2
106
+ len = ($5 ? $5.to_i : nil)
107
+ self.new(seqid, seqdef, len)
108
+ end
109
+ end #class SeqDesc
110
+
111
+ # Sequence segment pair of Spidey result.
112
+ # Similar to Bio::Blast::Report::Hsp but lacks many methods.
113
+ # For mRNA-genome mapping programs, unlike other homology search
114
+ # programs, the class is used not only for exons but also for introns.
115
+ # (Note that intron data would not be available according to run-time
116
+ # options of the program.)
117
+ class SegmentPair
118
+ #--
119
+ # segment pair (like Bio::BLAST::*::Report::Hsp)
120
+ #++
121
+
122
+ # Creates a new SegmentPair object.
123
+ # It is designed to be called from Bio::Spidey::Report::* classes.
124
+ # Users shall not call it directly.
125
+ def initialize(genomic, mrna, midline, aaseqline,
126
+ percent_identity, mismatches, gaps, splice_site,
127
+ align_len)
128
+ @genomic = genomic
129
+ @mrna = mrna
130
+ @midline = midline
131
+ @aaseqline = aaseqline
132
+ @percent_identity = percent_identity
133
+ @mismaches = mismatches
134
+ @gaps = gaps
135
+ @splice_site = splice_site
136
+ @align_len = align_len
137
+ end
138
+
139
+ # Returns segment informations of the 'Genomic'.
140
+ # Returns a Bio::Spidey::Report::Segment object.
141
+ # This would be a Bio::Spidey specific method.
142
+ attr_reader :genomic
143
+
144
+ # Returns segment informations of the 'mRNA'.
145
+ # Returns a Bio::Spidey::Report::Segment object.
146
+ # This would be a Bio::Spidey specific method.
147
+ attr_reader :mrna
148
+
149
+ # Returns the middle line of the alignment of the segment pair.
150
+ # Returns nil if no alignment data are available.
151
+ attr_reader :midline
152
+
153
+ # Returns amino acide sequence in alignment.
154
+ # Returns String, because white spaces is also important.
155
+ # Returns nil if no alignment data are available.
156
+ attr_reader :aaseqline
157
+
158
+ # Returns percent identity of the segment pair.
159
+ attr_reader :percent_identity
160
+
161
+ # Returns mismatches.
162
+ attr_reader :mismatches
163
+ alias mismatch_count mismatches
164
+
165
+ # Returns gaps.
166
+ attr_reader :gaps
167
+
168
+ # Returns splice site information.
169
+ # Returns a hash which contains :d and :a for keys and
170
+ # 0, 1, or nil for values.
171
+ # This would be a Bio::Spidey specific methods.
172
+ attr_reader :splice_site
173
+
174
+ # Returns alignment length of the segment pair.
175
+ # Returns nil if no alignment data are available.
176
+ attr_reader :align_len
177
+
178
+ # Creates a new SegmentPair object when the segment pair is an intron.
179
+ # It is designed to be called internally from
180
+ # Bio::Spidey::Report::* classes.
181
+ # Users shall not call it directly.
182
+ def self.new_intron(from, to, strand, aln)
183
+ genomic = Segment.new(from, to, strand, aln[0])
184
+ mrna = Segment.new(nil, nil, nil, aln[2])
185
+ midline = aln[1]
186
+ aaseqline = aln[3]
187
+ self.new(genomic, mrna, midline, aaseqline,
188
+ nil, nil, nil, nil, nil)
189
+ end
190
+
191
+ # Parses a piece of Spidey result text and creates a new
192
+ # SegmentPair object.
193
+ # It is designed to be called internally from
194
+ # Bio::Spidey::Report::* classes.
195
+ # Users shall not call it directly.
196
+ def self.parse(str, strand, complement, aln)
197
+ /\AExon\s*\d+(\(\-\))?\:\s*(\d+)\-(\d+)\s*\(gen\)\s+(\d+)\-(\d+)\s*\(mRNA\)\s+id\s*([\d\.]+)\s*\%\s+mismatches\s+(\d+)\s+gaps\s+(\d+)\s+splice site\s*\(d +a\)\s*\:\s*(\d+)\s+(\d+)/ =~ str
198
+ if strand == 'minus' then
199
+ genomic = Segment.new($3, $2, strand, aln[0])
200
+ else
201
+ genomic = Segment.new($2, $3, 'plus', aln[0])
202
+ end
203
+ if complement then
204
+ mrna = Segment.new($4, $5, 'minus', aln[2])
205
+ else
206
+ mrna = Segment.new($4, $5, 'plus', aln[2])
207
+ end
208
+ percent_identity = $6
209
+ mismatches = ($7 ? $7.to_i : nil)
210
+ gaps = ($8 ? $8.to_i : nil)
211
+ splice_site = {
212
+ :d => ($9 ? $9.to_i : nil),
213
+ :a => ($10 ? $10.to_i : nil)
214
+ }
215
+ midline = aln[1]
216
+ aaseqline = aln[3]
217
+ self.new(genomic, mrna, midline, aaseqline,
218
+ percent_identity, mismatches, gaps, splice_site,
219
+ (midline ? midline.length : nil))
220
+ end
221
+
222
+ #--
223
+ # Bio::BLAST::*::Report::Hsp compatible methods
224
+ # Methods already defined: midline, percent_identity,
225
+ # gaps, align_len, mismatch_count
226
+ #++
227
+
228
+ # Returns start position of the mRNA (query) (the first position is 1).
229
+ def query_from; @mrna.from; end
230
+
231
+ # Returns end position (including its position) of the mRNA (query).
232
+ def query_to; @mrna.to; end
233
+
234
+ # Returns the sequence (with gaps) of the mRNA (query).
235
+ def qseq; @mrna.seq; end
236
+
237
+ # Returns strand information of the mRNA (query).
238
+ # Returns 'plus', 'minus', or nil.
239
+ def query_strand; @mrna.strand; end
240
+
241
+ # Returns start position of the genomic (target, hit)
242
+ # (the first position is 1).
243
+ def hit_from; @genomic.from; end
244
+
245
+ # Returns end position (including its position) of the
246
+ # genomic (target, hit).
247
+ def hit_to; @genomic.to; end
248
+
249
+ # Returns the sequence (with gaps) of the genomic (target, hit).
250
+ def hseq; @genomic.seq; end
251
+
252
+ # Returns strand information of the genomic (target, hit).
253
+ # Returns 'plus', 'minus', or nil.
254
+ def hit_strand; @genomic.strand; end
255
+ end #class SegmentPair
256
+
257
+ # Segment informations of a segment pair.
258
+ class Segment
259
+ # Creates a new Segment object.
260
+ # It is designed to be called internally from
261
+ # Bio::Spidey::Report::* classes.
262
+ # Users shall not call it directly.
263
+ def initialize(pos_st, pos_ed, strand = nil, seq = nil)
264
+ @from = pos_st ? pos_st.to_i : nil
265
+ @to = pos_ed ? pos_ed.to_i : nil
266
+ @strand = strand
267
+ @seq = seq
268
+ end
269
+
270
+ # start position
271
+ attr_reader :from
272
+
273
+ # end position
274
+ attr_reader :to
275
+
276
+ # strand information
277
+ attr_reader :strand
278
+
279
+ # sequence data
280
+ attr_reader :seq
281
+ end #class Segment
282
+
283
+ # Hit object of Spidey result.
284
+ # Similar to Bio::Blast::Report::Hit but lacks many methods.
285
+ class Hit
286
+ # Creates a new Hit object.
287
+ # It is designed to be called internally from
288
+ # Bio::Spidey::Report::* classes.
289
+ # Users shall not call it directly.
290
+ def initialize(data, d0)
291
+ @data = data
292
+ @d0 = d0
293
+ end
294
+
295
+ # Fetches fields.
296
+ def field_fetch(t, ary)
297
+ reg = Regexp.new(/^#{Regexp.escape(t)}\:\s*(.+)\s*$/)
298
+ if ary.find { |x| reg =~ x }
299
+ $1.strip
300
+ else
301
+ nil
302
+ end
303
+ end
304
+ private :field_fetch
305
+
306
+ # Parses information about strand.
307
+ def parse_strand
308
+ x = field_fetch('Strand', @d0)
309
+ if x =~ /^(.+)Reverse +complement\s*$/ then
310
+ @strand = $1.strip
311
+ @complement = true
312
+ else
313
+ @strand = x
314
+ @complement = nil
315
+ end
316
+ end
317
+ private :parse_strand
318
+
319
+ # Returns strand information of the hit.
320
+ # Returns 'plus', 'minus', or nil.
321
+ # This would be a Bio::Spidey specific method.
322
+ def strand
323
+ unless defined?(@strand); parse_strand; end
324
+ @strand
325
+ end
326
+
327
+ # Returns true if the result reports 'Reverse complement'.
328
+ # Otherwise, return false or nil.
329
+ # This would be a Bio::Spidey specific method.
330
+ def complement?
331
+ unless defined?(@complement); parse_strand; end
332
+ @complement
333
+ end
334
+
335
+ # Returns number of exons in the hit.
336
+ def number_of_exons
337
+ unless defined?(@number_of_exons)
338
+ @number_of_exons = field_fetch('Number of exons', @d0).to_i
339
+ end
340
+ @number_of_exons
341
+ end
342
+
343
+ # Returns number of splice sites of the hit.
344
+ def number_of_splice_sites
345
+ unless defined?(@number_of_splice_sites)
346
+ @number_of_splice_sites =
347
+ field_fetch('Number of splice sites', @d0).to_i
348
+ end
349
+ @number_of_splice_sites
350
+ end
351
+
352
+ # Returns overall percent identity of the hit.
353
+ def percent_identity
354
+ unless defined?(@percent_identity)
355
+ x = field_fetch('overall percent identity', @d0)
356
+ @percent_identity =
357
+ (/([\d\.]+)\s*\%/ =~ x.to_s) ? $1 : nil
358
+ end
359
+ @percent_identity
360
+ end
361
+
362
+ # Returns missing mRNA ends of the hit.
363
+ def missing_mrna_ends
364
+ unless defined?(@missing_mrna_ends)
365
+ @missing_mrna_ends = field_fetch('Missing mRNA ends', @d0)
366
+ end
367
+ @missing_mrna_ends
368
+ end
369
+
370
+ # Returns sequence informations of the 'Genomic'.
371
+ # Returns a Bio::Spidey::Report::SeqDesc object.
372
+ # This would be a Bio::Spidey specific method.
373
+ def genomic
374
+ unless defined?(@genomic)
375
+ @genomic = SeqDesc.parse(@d0.find { |x| /^Genomic\:/ =~ x })
376
+ end
377
+ @genomic
378
+ end
379
+
380
+ # Returns sequence informations of the mRNA.
381
+ # Returns a Bio::Spidey::Report::SeqDesc object.
382
+ # This would be a Bio::Spidey specific method.
383
+ def mrna
384
+ unless defined?(@mrna)
385
+ @mrna = SeqDesc.parse(@d0.find { |x| /^mRNA\:/ =~ x })
386
+ end
387
+ @mrna
388
+ end
389
+
390
+ # Parses segment pairs.
391
+ def parse_segmentpairs
392
+ aln = self.align.dup
393
+ ex = []
394
+ itr = []
395
+ segpairs = []
396
+ cflag = self.complement?
397
+ strand = self.strand
398
+ if strand == 'minus' then
399
+ d_to = 1; d_from = -1
400
+ else
401
+ d_to = -1; d_from = 1
402
+ end
403
+ @d0.each do |x|
404
+ #p x
405
+ if x =~ /^Exon\s*\d+(\(.*\))?\:/ then
406
+ if a = aln.shift then
407
+ y = SegmentPair.parse(x, strand, cflag, a[1])
408
+ ex << y
409
+ if a[0][0].to_s.length > 0 then
410
+ to = y.genomic.from + d_to
411
+ i0 = SegmentPair.new_intron(nil, to, strand, a[0])
412
+ itr << i0
413
+ segpairs << i0
414
+ end
415
+ segpairs << y
416
+ if a[2][0].to_s.length > 0 then
417
+ from = y.genomic.to + d_from
418
+ i2 = SegmentPair.new_intron(from, nil, strand, a[2])
419
+ itr << i2
420
+ segpairs << i2
421
+ end
422
+ else
423
+ y = SegmentPair.parse(x, strand, cflag, [])
424
+ ex << y
425
+ segpairs << y
426
+ end
427
+ end
428
+ end
429
+ @exons = ex
430
+ @introns = itr
431
+ @segmentpairs = segpairs
432
+ end
433
+ private :parse_segmentpairs
434
+
435
+ # Returns exons of the hit.
436
+ # Returns an array of Bio::Spidey::Report::SegmentPair object.
437
+ def exons
438
+ unless defined?(@exons); parse_segmentpairs; end
439
+ @exons
440
+ end
441
+
442
+ # Returns introns of the hit.
443
+ # Some of them would contain untranscribed regions.
444
+ # Returns an array of Bio::Spidey::Report::SegmentPair objects.
445
+ # (Note that intron data is not always available
446
+ # according to run-time options of the program.)
447
+ def introns
448
+ unless defined?(@introns); parse_segmentpairs; end
449
+ @introns
450
+ end
451
+
452
+ # Returns segment pairs (exons and introns) of the hit.
453
+ # Each segment pair is a Bio::Spidey::Report::SegmentPair object.
454
+ # Returns an array of Bio::Spidey::Report::SegmentPair objects.
455
+ # (Note that intron data is not always available
456
+ # according to run-time options of the program.)
457
+ def segmentpairs
458
+ unless defined?(@segmentparis); parse_segmentpairs; end
459
+ @segmentpairs
460
+ end
461
+
462
+ # Returns alignments.
463
+ # Returns an Array of arrays.
464
+ # This would be a Bio::Spidey specific method.
465
+ def align
466
+ unless defined?(@align); parse_align; end
467
+ @align
468
+ end
469
+
470
+ # Parses alignment lines.
471
+ def parse_align_lines(data)
472
+ misc = [ [], [], [], [] ]
473
+ data.each do |x|
474
+ a = x.split(/\r?\n/)
475
+ if g = a.shift then
476
+ misc[0] << g
477
+ (1..3).each do |i|
478
+ if y = a.shift then
479
+ if y.length < g.length
480
+ y << ' ' * (g.length - y.length)
481
+ end
482
+ misc[i] << y
483
+ else
484
+ misc[i] << ' ' * g.length
485
+ end
486
+ end
487
+ end
488
+ end
489
+ misc.collect! { |x| x.join('') }
490
+ left = []
491
+ if /\A +/ =~ misc[2] then
492
+ len = $&.size
493
+ left = misc.collect { |x| x[0, len] }
494
+ misc.each { |x| x[0, len] = '' }
495
+ end
496
+ right = []
497
+ if / +\z/ =~ misc[2] then
498
+ len = $&.size
499
+ right = misc.collect { |x| x[(-len)..-1] }
500
+ misc.each { |x| x[(-len)..-1] = '' }
501
+ end
502
+ body = misc
503
+ [ left, body, right ]
504
+ end
505
+ private :parse_align_lines
506
+
507
+ # Parses alignments.
508
+ def parse_align
509
+ r = []
510
+ data = @data
511
+ while !data.empty?
512
+ a = []
513
+ while x = data.shift and !(x =~ /^(Genomic|Exon\s*\d+)\:/)
514
+ a.push x
515
+ end
516
+ r.push parse_align_lines(a) unless a.empty?
517
+ end
518
+ @align = r
519
+ end
520
+ private :parse_align
521
+
522
+ #--
523
+ # Bio::BLAST::*::Report::Hit compatible methods
524
+ #++
525
+
526
+ # Length of the mRNA (query) sequence.
527
+ # Same as Bio::Spidey::Report#query_len.
528
+ def query_len; mrna.len; end
529
+
530
+ # Identifier of the mRNA (query).
531
+ # Same as Bio::Spidey::Report#query_id.
532
+ def query_id; mrna.entry_id; end
533
+
534
+ # Definition of the mRNA (query).
535
+ # Same as Bio::Spidey::Report#query_def.
536
+ def query_def; mrna.definition; end
537
+
538
+ # The genomic (target) sequence length.
539
+ def target_len; genomic.len; end
540
+
541
+ # Identifier of the genomic (target) sequence.
542
+ def target_id; genomic.entry_id; end
543
+
544
+ # Definition of the genomic (target) sequence.
545
+ def target_def; genomic.definition; end
546
+
547
+ alias hit_id target_id
548
+ alias len target_len
549
+ alias definition target_def
550
+
551
+ alias hsps exons
552
+
553
+ # Iterates over each exon of the hit.
554
+ # Yields Bio::Spidey::Report::SegmentPair object.
555
+ def each(&x) #:yields: segmentpair
556
+ exons.each(&x)
557
+ end
558
+ end #class Hit
559
+
560
+ # Returns sequence informationsof the mRNA.
561
+ # Returns a Bio::Spidey::Report::SeqDesc object.
562
+ # This would be a Bio::Spidey specific method.
563
+ def mrna; @hit.mrna; end
564
+
565
+ #--
566
+ #Bio::BLAST::*::Report compatible methods
567
+ #++
568
+
569
+ # Returns number of hits.
570
+ # Same as hits.size.
571
+ def num_hits; @hits.size; end
572
+
573
+ # Iterates over each hits.
574
+ # Same as hits.each.
575
+ # Yields a Bio::Spidey::Report::Hit object.
576
+ def each_hit(&x) #:yields: hit
577
+ @hits.each(&x)
578
+ end
579
+ alias each each_hit
580
+
581
+ # Returns definition of the mRNA (query) sequence.
582
+ def query_def; @hit.mrna.definition; end
583
+
584
+ # Returns identifier of the mRNA (query) sequence.
585
+ def query_id; @hit.mrna.entry_id; end
586
+
587
+ # Returns the length of the mRNA (query) sequence.
588
+ def query_len; @hit.mrna.len; end
589
+ end #class Report
590
+
591
+ end #class Spidey
592
+ end #module Bio
593
+