bio 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
data/lib/bio.rb CHANGED
@@ -113,8 +113,9 @@ module Bio
113
113
  ## other formats
114
114
 
115
115
  autoload :FastaFormat, 'bio/db/fasta'
116
- autoload :FastaNumericFormat, 'bio/db/fasta' # change to FastaFormat::Numeric ?
117
- autoload :FastaDefline, 'bio/db/fasta' # change to FastaFormat::Defline
116
+ autoload :FastaNumericFormat, 'bio/db/fasta/qual' # change to FastaFormat::Numeric ?
117
+ autoload :FastaDefline, 'bio/db/fasta/defline' # change to FastaFormat::Defline ?
118
+ autoload :Fastq, 'bio/db/fastq'
118
119
  autoload :GFF, 'bio/db/gff'
119
120
  autoload :AAindex, 'bio/db/aaindex'
120
121
  autoload :AAindex1, 'bio/db/aaindex' # change to AAindex::AAindex1 ?
@@ -130,10 +131,22 @@ module Bio
130
131
  autoload :REBASE, 'bio/db/rebase'
131
132
  autoload :SOFT, 'bio/db/soft'
132
133
  autoload :Lasergene, 'bio/db/lasergene'
134
+ autoload :SangerChromatogram, 'bio/db/sanger_chromatogram/chromatogram'
135
+ autoload :Scf, 'bio/db/sanger_chromatogram/scf'
136
+ autoload :Abif, 'bio/db/sanger_chromatogram/abif'
133
137
 
134
138
  autoload :Newick, 'bio/db/newick'
135
139
  autoload :Nexus, 'bio/db/nexus'
136
140
 
141
+ autoload :PhyloXML, 'bio/db/phyloxml/phyloxml_elements'
142
+ # Bio::Taxonomy will be moved to other file
143
+ autoload :Taxonomy, 'bio/db/phyloxml/phyloxml_elements'
144
+ ## below are described in bio/db/phyloxml/phyloxml_elements.rb
145
+ #module PhyloXML
146
+ # autoload :Parser, 'bio/db/phyloxml/phyloxml_parser'
147
+ # autoload :Writer, 'bio/db/phyloxml/phyloxml_writer'
148
+ #end
149
+
137
150
  ### IO interface modules
138
151
 
139
152
  autoload :Registry, 'bio/io/registry'
@@ -179,10 +192,12 @@ module Bio
179
192
  autoload :SOAP, 'bio/io/ebisoap'
180
193
  end
181
194
 
182
- class NCBI
183
- autoload :SOAP, 'bio/io/ncbisoap'
184
- autoload :REST, 'bio/io/ncbirest'
185
- end
195
+ autoload :NCBI, 'bio/io/ncbirest'
196
+ ## below are described in bio/io/ncbirest.rb
197
+ #class NCBI
198
+ # autoload :SOAP, 'bio/io/ncbisoap'
199
+ # autoload :REST, 'bio/io/ncbirest'
200
+ #end
186
201
 
187
202
  autoload :TogoWS, 'bio/io/togows'
188
203
 
@@ -1,12 +1,12 @@
1
1
  #
2
2
  # = bio/appl/bl2seq/report.rb - bl2seq (BLAST 2 sequences) parser
3
3
  #
4
- # Copyright:: Copyright (C) 2005 GOTO Naohisa <ng@bioruby.org>
4
+ # Copyright:: Copyright (C) 2005 Naohisa Goto <ng@bioruby.org>
5
5
  # License:: The Ruby License
6
6
  #
7
- # $Id: report.rb,v 1.8 2007/04/05 23:35:39 trevor Exp $
7
+ # $Id:$
8
8
  #
9
- # Bio::Bl2seq::Report is a NCBI bl2seq (BLAST 2 sequences) output parser.
9
+ # Bio::Blast::Bl2seq::Report is a NCBI bl2seq (BLAST 2 sequences) output parser.
10
10
  #
11
11
  # = Acknowledgements
12
12
  #
@@ -22,15 +22,16 @@ class Blast
22
22
 
23
23
  class Bl2seq
24
24
 
25
- # Bio::Bl2seq::Report is a NCBI bl2seq (BLAST 2 sequences) output parser.
25
+ # Bio::Blast::Bl2seq::Report is a NCBI bl2seq (BLAST 2 sequences) output parser.
26
26
  # It inherits Bio::Blast::Default::Report.
27
27
  # Most of its methods are the same as Bio::Blast::Default::Report,
28
28
  # but it lacks many methods.
29
29
  class Report < Bio::Blast::Default::Report
30
30
 
31
31
  # Delimiter of each entry. Bio::FlatFile uses it.
32
- # In Bio::Bl2seq::Report, it it nil (1 entry 1 file).
32
+ # In Bio::Blast::Bl2seq::Report, it it nil (1 entry 1 file).
33
33
  DELIMITER = RS = nil
34
+ DELIMITER_OVERRUN = nil
34
35
 
35
36
  undef format0_parse_header
36
37
  undef program, version, version_number, version_date,
@@ -77,9 +78,9 @@ class Blast
77
78
  end
78
79
  end #class F0dbstat
79
80
 
80
- # Bio::Bl2seq::Report::Iteration stores information about
81
+ # Bio::Blast::Bl2seq::Report::Iteration stores information about
81
82
  # a iteration.
82
- # Normally, it may contain some Bio::Bl2seq::Report::Hit objects.
83
+ # Normally, it may contain some Bio::Blast::Bl2seq::Report::Hit objects.
83
84
  #
84
85
  # Note that its main existance reason is to keep complatibility
85
86
  # between Bio::Blast::Default::Report::* classes.
@@ -99,7 +100,7 @@ class Blast
99
100
  end
100
101
 
101
102
  # Returns the hits of the iteration.
102
- # It returns an array of Bio::Bl2seq::Report::Hit objects.
103
+ # It returns an array of Bio::Blast::Bl2seq::Report::Hit objects.
103
104
  def hits; @hits; end
104
105
 
105
106
  undef message, pattern_in_database,
@@ -108,14 +109,14 @@ class Blast
108
109
  converged?
109
110
  end #class Iteration
110
111
 
111
- # Bio::Bl2seq::Report::Hit contains information about a hit.
112
+ # Bio::Blast::Bl2seq::Report::Hit contains information about a hit.
112
113
  # It may contain some Bio::Blast::Default::Report::HSP objects.
113
114
  # All methods are the same as Bio::Blast::Default::Report::Hit class.
114
115
  # Please refer to Bio::Blast::Default::Report::Hit.
115
116
  class Hit < Bio::Blast::Default::Report::Hit
116
117
  end #class Hit
117
118
 
118
- # Bio::Bl2seq::Report::HSP holds information about the hsp
119
+ # Bio::Blast::Bl2seq::Report::HSP holds information about the hsp
119
120
  # (high-scoring segment pair).
120
121
  # NOTE that the HSP class below is NOT used because
121
122
  # Ruby's constants namespace are normally statically determined
@@ -132,198 +133,6 @@ end #module Bio
132
133
 
133
134
  ######################################################################
134
135
 
135
- if __FILE__ == $0
136
-
137
- Bio::FlatFile.open(Bio::Blast::Bl2seq::Report, ARGF) do |ff|
138
- ff.each do |rep|
139
-
140
- print "# === Bio::Blast::Bl2seq::Report\n"
141
- puts
142
- #@#print " rep.program #=> "; p rep.program
143
- #@#print " rep.version #=> "; p rep.version
144
- #@#print " rep.reference #=> "; p rep.reference
145
- #@#print " rep.db #=> "; p rep.db
146
- #print " rep.query_id #=> "; p rep.query_id
147
- print " rep.query_def #=> "; p rep.query_def
148
- print " rep.query_len #=> "; p rep.query_len
149
- #puts
150
- #@#print " rep.version_number #=> "; p rep.version_number
151
- #@#print " rep.version_date #=> "; p rep.version_date
152
- puts
153
-
154
- print "# === Parameters\n"
155
- #puts
156
- #print " rep.parameters #=> "; p rep.parameters
157
- puts
158
- print " rep.matrix #=> "; p rep.matrix
159
- print " rep.expect #=> "; p rep.expect
160
- #print " rep.inclusion #=> "; p rep.inclusion
161
- print " rep.sc_match #=> "; p rep.sc_match
162
- print " rep.sc_mismatch #=> "; p rep.sc_mismatch
163
- print " rep.gap_open #=> "; p rep.gap_open
164
- print " rep.gap_extend #=> "; p rep.gap_extend
165
- #print " rep.filter #=> "; p rep.filter
166
- #@#print " rep.pattern #=> "; p rep.pattern
167
- #print " rep.entrez_query #=> "; p rep.entrez_query
168
- #puts
169
- #@#print " rep.pattern_positions #=> "; p rep.pattern_positions
170
- puts
171
-
172
- print "# === Statistics (last iteration's)\n"
173
- #puts
174
- #print " rep.statistics #=> "; p rep.statistics
175
- puts
176
- print " rep.db_num #=> "; p rep.db_num
177
- print " rep.db_len #=> "; p rep.db_len
178
- #print " rep.hsp_len #=> "; p rep.hsp_len
179
- print " rep.eff_space #=> "; p rep.eff_space
180
- print " rep.kappa #=> "; p rep.kappa
181
- print " rep.lambda #=> "; p rep.lambda
182
- print " rep.entropy #=> "; p rep.entropy
183
- puts
184
- print " rep.num_hits #=> "; p rep.num_hits
185
- print " rep.gapped_kappa #=> "; p rep.gapped_kappa
186
- print " rep.gapped_lambda #=> "; p rep.gapped_lambda
187
- print " rep.gapped_entropy #=> "; p rep.gapped_entropy
188
- print " rep.posted_date #=> "; p rep.posted_date
189
- puts
190
-
191
- #@#print "# === Message (last iteration's)\n"
192
- #@#puts
193
- #@#print " rep.message #=> "; p rep.message
194
- #puts
195
- #@#print " rep.converged? #=> "; p rep.converged?
196
- #@#puts
197
-
198
- print "# === Iterations\n"
199
- puts
200
- print " rep.itrerations.each do |itr|\n"
201
- puts
202
-
203
- rep.iterations.each do |itr|
204
-
205
- print "# --- Bio::Blast::Bl2seq::Report::Iteration\n"
206
- puts
207
-
208
- print " itr.num #=> "; p itr.num
209
- #print " itr.statistics #=> "; p itr.statistics
210
- #@#print " itr.message #=> "; p itr.message
211
- print " itr.hits.size #=> "; p itr.hits.size
212
- #puts
213
- #@#print " itr.hits_newly_found.size #=> "; p itr.hits_newly_found.size;
214
- #@#print " itr.hits_found_again.size #=> "; p itr.hits_found_again.size;
215
- #@#if itr.hits_for_pattern then
216
- #@#itr.hits_for_pattern.each_with_index do |hp, hpi|
217
- #@#print " itr.hits_for_pattern[#{hpi}].size #=> "; p hp.size;
218
- #@#end
219
- #@#end
220
- #@#print " itr.converged? #=> "; p itr.converged?
221
- puts
222
-
223
- print " itr.hits.each do |hit|\n"
224
- puts
225
-
226
- itr.hits.each_with_index do |hit, i|
227
-
228
- print "# --- Bio::Blast::Bl2seq::Default::Report::Hit"
229
- print " ([#{i}])\n"
230
- puts
231
-
232
- #print " hit.num #=> "; p hit.num
233
- #print " hit.hit_id #=> "; p hit.hit_id
234
- print " hit.len #=> "; p hit.len
235
- print " hit.definition #=> "; p hit.definition
236
- #print " hit.accession #=> "; p hit.accession
237
- #puts
238
- print " hit.found_again? #=> "; p hit.found_again?
239
-
240
- print " --- compatible/shortcut ---\n"
241
- #print " hit.query_id #=> "; p hit.query_id
242
- #print " hit.query_def #=> "; p hit.query_def
243
- #print " hit.query_len #=> "; p hit.query_len
244
- #print " hit.target_id #=> "; p hit.target_id
245
- print " hit.target_def #=> "; p hit.target_def
246
- print " hit.target_len #=> "; p hit.target_len
247
-
248
- print " --- first HSP's values (shortcut) ---\n"
249
- print " hit.evalue #=> "; p hit.evalue
250
- print " hit.bit_score #=> "; p hit.bit_score
251
- print " hit.identity #=> "; p hit.identity
252
- #print " hit.overlap #=> "; p hit.overlap
253
-
254
- print " hit.query_seq #=> "; p hit.query_seq
255
- print " hit.midline #=> "; p hit.midline
256
- print " hit.target_seq #=> "; p hit.target_seq
257
-
258
- print " hit.query_start #=> "; p hit.query_start
259
- print " hit.query_end #=> "; p hit.query_end
260
- print " hit.target_start #=> "; p hit.target_start
261
- print " hit.target_end #=> "; p hit.target_end
262
- print " hit.lap_at #=> "; p hit.lap_at
263
- print " --- first HSP's vaules (shortcut) ---\n"
264
- print " --- compatible/shortcut ---\n"
265
-
266
- puts
267
- print " hit.hsps.size #=> "; p hit.hsps.size
268
- if hit.hsps.size == 0 then
269
- puts " (HSP not found: please see blastall's -b and -v options)"
270
- puts
271
- else
272
-
273
- puts
274
- print " hit.hsps.each do |hsp|\n"
275
- puts
276
-
277
- hit.hsps.each_with_index do |hsp, j|
278
-
279
- print "# --- Bio::Blast::Default::Report::HSP (Bio::Blast::Bl2seq::Report::HSP)"
280
- print " ([#{j}])\n"
281
- puts
282
- #print " hsp.num #=> "; p hsp.num
283
- print " hsp.bit_score #=> "; p hsp.bit_score
284
- print " hsp.score #=> "; p hsp.score
285
- print " hsp.evalue #=> "; p hsp.evalue
286
- print " hsp.identity #=> "; p hsp.identity
287
- print " hsp.gaps #=> "; p hsp.gaps
288
- print " hsp.positive #=> "; p hsp.positive
289
- print " hsp.align_len #=> "; p hsp.align_len
290
- #print " hsp.density #=> "; p hsp.density
291
-
292
- print " hsp.query_frame #=> "; p hsp.query_frame
293
- print " hsp.query_from #=> "; p hsp.query_from
294
- print " hsp.query_to #=> "; p hsp.query_to
295
-
296
- print " hsp.hit_frame #=> "; p hsp.hit_frame
297
- print " hsp.hit_from #=> "; p hsp.hit_from
298
- print " hsp.hit_to #=> "; p hsp.hit_to
299
-
300
- #print " hsp.pattern_from#=> "; p hsp.pattern_from
301
- #print " hsp.pattern_to #=> "; p hsp.pattern_to
302
-
303
- print " hsp.qseq #=> "; p hsp.qseq
304
- print " hsp.midline #=> "; p hsp.midline
305
- print " hsp.hseq #=> "; p hsp.hseq
306
- puts
307
- print " hsp.percent_identity #=> "; p hsp.percent_identity
308
- #print " hsp.mismatch_count #=> "; p hsp.mismatch_count
309
- #
310
- print " hsp.query_strand #=> "; p hsp.query_strand
311
- print " hsp.hit_strand #=> "; p hsp.hit_strand
312
- print " hsp.percent_positive #=> "; p hsp.percent_positive
313
- print " hsp.percent_gaps #=> "; p hsp.percent_gaps
314
- puts
315
-
316
- end #each
317
- end #if hit.hsps.size == 0
318
- end
319
- end
320
- end #ff.each
321
- end #FlatFile.open
322
-
323
- end #if __FILE__ == $0
324
-
325
- ######################################################################
326
-
327
136
  =begin
328
137
 
329
138
  = Bio::Blast::Bl2seq::Report
@@ -1248,196 +1248,3 @@ module Bio
1248
1248
  end #class Blast
1249
1249
  end #module Bio
1250
1250
 
1251
- ######################################################################
1252
-
1253
- if __FILE__ == $0
1254
-
1255
- Bio::FlatFile.open(Bio::Blast::Default::Report, ARGF) do |ff|
1256
- ff.each do |rep|
1257
-
1258
- print "# === Bio::Blast::Default::Report\n"
1259
- puts
1260
- print " rep.program #=> "; p rep.program
1261
- print " rep.version #=> "; p rep.version
1262
- print " rep.reference #=> "; p rep.reference
1263
- print " rep.db #=> "; p rep.db
1264
- #print " rep.query_id #=> "; p rep.query_id
1265
- print " rep.query_def #=> "; p rep.query_def
1266
- print " rep.query_len #=> "; p rep.query_len
1267
- #puts
1268
- print " rep.version_number #=> "; p rep.version_number
1269
- print " rep.version_date #=> "; p rep.version_date
1270
- puts
1271
-
1272
- print "# === Parameters\n"
1273
- #puts
1274
- #print " rep.parameters #=> "; p rep.parameters
1275
- puts
1276
- print " rep.matrix #=> "; p rep.matrix
1277
- print " rep.expect #=> "; p rep.expect
1278
- #print " rep.inclusion #=> "; p rep.inclusion
1279
- print " rep.sc_match #=> "; p rep.sc_match
1280
- print " rep.sc_mismatch #=> "; p rep.sc_mismatch
1281
- print " rep.gap_open #=> "; p rep.gap_open
1282
- print " rep.gap_extend #=> "; p rep.gap_extend
1283
- #print " rep.filter #=> "; p rep.filter
1284
- print " rep.pattern #=> "; p rep.pattern
1285
- #print " rep.entrez_query #=> "; p rep.entrez_query
1286
- #puts
1287
- print " rep.pattern_positions #=> "; p rep.pattern_positions
1288
- puts
1289
-
1290
- print "# === Statistics (last iteration's)\n"
1291
- #puts
1292
- #print " rep.statistics #=> "; p rep.statistics
1293
- puts
1294
- print " rep.db_num #=> "; p rep.db_num
1295
- print " rep.db_len #=> "; p rep.db_len
1296
- #print " rep.hsp_len #=> "; p rep.hsp_len
1297
- print " rep.eff_space #=> "; p rep.eff_space
1298
- print " rep.kappa #=> "; p rep.kappa
1299
- print " rep.lambda #=> "; p rep.lambda
1300
- print " rep.entropy #=> "; p rep.entropy
1301
- puts
1302
- print " rep.num_hits #=> "; p rep.num_hits
1303
- print " rep.gapped_kappa #=> "; p rep.gapped_kappa
1304
- print " rep.gapped_lambda #=> "; p rep.gapped_lambda
1305
- print " rep.gapped_entropy #=> "; p rep.gapped_entropy
1306
- print " rep.posted_date #=> "; p rep.posted_date
1307
- puts
1308
-
1309
- print "# === Message (last iteration's)\n"
1310
- puts
1311
- print " rep.message #=> "; p rep.message
1312
- #puts
1313
- print " rep.converged? #=> "; p rep.converged?
1314
- puts
1315
-
1316
- print "# === Iterations\n"
1317
- puts
1318
- print " rep.itrerations.each do |itr|\n"
1319
- puts
1320
-
1321
- rep.iterations.each do |itr|
1322
-
1323
- print "# --- Bio::Blast::Default::Report::Iteration\n"
1324
- puts
1325
-
1326
- print " itr.num #=> "; p itr.num
1327
- #print " itr.statistics #=> "; p itr.statistics
1328
- print " itr.message #=> "; p itr.message
1329
- print " itr.hits.size #=> "; p itr.hits.size
1330
- #puts
1331
- print " itr.hits_newly_found.size #=> "; p itr.hits_newly_found.size;
1332
- print " itr.hits_found_again.size #=> "; p itr.hits_found_again.size;
1333
- if itr.hits_for_pattern then
1334
- itr.hits_for_pattern.each_with_index do |hp, hpi|
1335
- print " itr.hits_for_pattern[#{hpi}].size #=> "; p hp.size;
1336
- end
1337
- end
1338
- print " itr.converged? #=> "; p itr.converged?
1339
- puts
1340
-
1341
- print " itr.hits.each do |hit|\n"
1342
- puts
1343
-
1344
- itr.hits.each_with_index do |hit, i|
1345
-
1346
- print "# --- Bio::Blast::Default::Report::Hit"
1347
- print " ([#{i}])\n"
1348
- puts
1349
-
1350
- #print " hit.num #=> "; p hit.num
1351
- #print " hit.hit_id #=> "; p hit.hit_id
1352
- print " hit.len #=> "; p hit.len
1353
- print " hit.definition #=> "; p hit.definition
1354
- #print " hit.accession #=> "; p hit.accession
1355
- #puts
1356
- print " hit.found_again? #=> "; p hit.found_again?
1357
-
1358
- print " --- compatible/shortcut ---\n"
1359
- #print " hit.query_id #=> "; p hit.query_id
1360
- #print " hit.query_def #=> "; p hit.query_def
1361
- #print " hit.query_len #=> "; p hit.query_len
1362
- #print " hit.target_id #=> "; p hit.target_id
1363
- print " hit.target_def #=> "; p hit.target_def
1364
- print " hit.target_len #=> "; p hit.target_len
1365
-
1366
- print " --- first HSP's values (shortcut) ---\n"
1367
- print " hit.evalue #=> "; p hit.evalue
1368
- print " hit.bit_score #=> "; p hit.bit_score
1369
- print " hit.identity #=> "; p hit.identity
1370
- #print " hit.overlap #=> "; p hit.overlap
1371
-
1372
- print " hit.query_seq #=> "; p hit.query_seq
1373
- print " hit.midline #=> "; p hit.midline
1374
- print " hit.target_seq #=> "; p hit.target_seq
1375
-
1376
- print " hit.query_start #=> "; p hit.query_start
1377
- print " hit.query_end #=> "; p hit.query_end
1378
- print " hit.target_start #=> "; p hit.target_start
1379
- print " hit.target_end #=> "; p hit.target_end
1380
- print " hit.lap_at #=> "; p hit.lap_at
1381
- print " --- first HSP's vaules (shortcut) ---\n"
1382
- print " --- compatible/shortcut ---\n"
1383
-
1384
- puts
1385
- print " hit.hsps.size #=> "; p hit.hsps.size
1386
- if hit.hsps.size == 0 then
1387
- puts " (HSP not found: please see blastall's -b and -v options)"
1388
- puts
1389
- else
1390
-
1391
- puts
1392
- print " hit.hsps.each do |hsp|\n"
1393
- puts
1394
-
1395
- hit.hsps.each_with_index do |hsp, j|
1396
-
1397
- print "# --- Bio::Blast::Default::Report::Hsp"
1398
- print " ([#{j}])\n"
1399
- puts
1400
- #print " hsp.num #=> "; p hsp.num
1401
- print " hsp.bit_score #=> "; p hsp.bit_score
1402
- print " hsp.score #=> "; p hsp.score
1403
- print " hsp.evalue #=> "; p hsp.evalue
1404
- print " hsp.identity #=> "; p hsp.identity
1405
- print " hsp.gaps #=> "; p hsp.gaps
1406
- print " hsp.positive #=> "; p hsp.positive
1407
- print " hsp.align_len #=> "; p hsp.align_len
1408
- #print " hsp.density #=> "; p hsp.density
1409
-
1410
- print " hsp.query_frame #=> "; p hsp.query_frame
1411
- print " hsp.query_from #=> "; p hsp.query_from
1412
- print " hsp.query_to #=> "; p hsp.query_to
1413
-
1414
- print " hsp.hit_frame #=> "; p hsp.hit_frame
1415
- print " hsp.hit_from #=> "; p hsp.hit_from
1416
- print " hsp.hit_to #=> "; p hsp.hit_to
1417
-
1418
- #print " hsp.pattern_from#=> "; p hsp.pattern_from
1419
- #print " hsp.pattern_to #=> "; p hsp.pattern_to
1420
-
1421
- print " hsp.qseq #=> "; p hsp.qseq
1422
- print " hsp.midline #=> "; p hsp.midline
1423
- print " hsp.hseq #=> "; p hsp.hseq
1424
- puts
1425
- print " hsp.percent_identity #=> "; p hsp.percent_identity
1426
- #print " hsp.mismatch_count #=> "; p hsp.mismatch_count
1427
- #
1428
- print " hsp.query_strand #=> "; p hsp.query_strand
1429
- print " hsp.hit_strand #=> "; p hsp.hit_strand
1430
- print " hsp.percent_positive #=> "; p hsp.percent_positive
1431
- print " hsp.percent_gaps #=> "; p hsp.percent_gaps
1432
- puts
1433
-
1434
- end #each
1435
- end #if hit.hsps.size == 0
1436
- end
1437
- end
1438
- end #ff.each
1439
- end #FlatFile.open
1440
-
1441
- end #if __FILE__ == $0
1442
-
1443
- ######################################################################