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
@@ -580,7 +580,7 @@ end # Blast
580
580
  end # Bio
581
581
 
582
582
 
583
- if __FILE__ == $0
583
+ #if __FILE__ == $0
584
584
 
585
585
  =begin
586
586
 
@@ -617,151 +617,6 @@ if __FILE__ == $0
617
617
 
618
618
  =end
619
619
 
620
- Bio::Blast.reports(ARGF) do |rep| # for multiple xml reports
621
-
622
- print "# === Bio::Tools::Blast::Report\n"
623
- puts
624
- print " rep.program #=> "; p rep.program
625
- print " rep.version #=> "; p rep.version
626
- print " rep.reference #=> "; p rep.reference
627
- print " rep.db #=> "; p rep.db
628
- print " rep.query_id #=> "; p rep.query_id
629
- print " rep.query_def #=> "; p rep.query_def
630
- print " rep.query_len #=> "; p rep.query_len
631
- puts
632
-
633
- print "# === Parameters\n"
634
- puts
635
- print " rep.parameters #=> "; p rep.parameters
636
- puts
637
- print " rep.matrix #=> "; p rep.matrix
638
- print " rep.expect #=> "; p rep.expect
639
- print " rep.inclusion #=> "; p rep.inclusion
640
- print " rep.sc_match #=> "; p rep.sc_match
641
- print " rep.sc_mismatch #=> "; p rep.sc_mismatch
642
- print " rep.gap_open #=> "; p rep.gap_open
643
- print " rep.gap_extend #=> "; p rep.gap_extend
644
- print " rep.filter #=> "; p rep.filter
645
- print " rep.pattern #=> "; p rep.pattern
646
- print " rep.entrez_query #=> "; p rep.entrez_query
647
- puts
648
-
649
- print "# === Statistics (last iteration's)\n"
650
- puts
651
- print " rep.statistics #=> "; p rep.statistics
652
- puts
653
- print " rep.db_num #=> "; p rep.db_num
654
- print " rep.db_len #=> "; p rep.db_len
655
- print " rep.hsp_len #=> "; p rep.hsp_len
656
- print " rep.eff_space #=> "; p rep.eff_space
657
- print " rep.kappa #=> "; p rep.kappa
658
- print " rep.lambda #=> "; p rep.lambda
659
- print " rep.entropy #=> "; p rep.entropy
660
- puts
661
-
662
- print "# === Message (last iteration's)\n"
663
- puts
664
- print " rep.message #=> "; p rep.message
665
- puts
666
-
667
- print "# === Iterations\n"
668
- puts
669
- print " rep.itrerations.each do |itr|\n"
670
- puts
671
-
672
- rep.iterations.each do |itr|
673
-
674
- print "# --- Bio::Blast::Report::Iteration\n"
675
- puts
676
-
677
- print " itr.num #=> "; p itr.num
678
- print " itr.statistics #=> "; p itr.statistics
679
- print " itr.message #=> "; p itr.message
680
- print " itr.hits.size #=> "; p itr.hits.size
681
- puts
682
-
683
- print " itr.hits.each do |hit|\n"
684
- puts
685
-
686
- itr.hits.each do |hit|
687
-
688
- print "# --- Bio::Blast::Report::Hit\n"
689
- puts
690
-
691
- print " hit.num #=> "; p hit.num
692
- print " hit.hit_id #=> "; p hit.hit_id
693
- print " hit.len #=> "; p hit.len
694
- print " hit.definition #=> "; p hit.definition
695
- print " hit.accession #=> "; p hit.accession
696
-
697
- print " --- compatible/shortcut ---\n"
698
- print " hit.query_id #=> "; p hit.query_id
699
- print " hit.query_def #=> "; p hit.query_def
700
- print " hit.query_len #=> "; p hit.query_len
701
- print " hit.target_id #=> "; p hit.target_id
702
- print " hit.target_def #=> "; p hit.target_def
703
- print " hit.target_len #=> "; p hit.target_len
704
-
705
- print " hit.evalue #=> "; p hit.evalue
706
- print " hit.bit_score #=> "; p hit.bit_score
707
- print " hit.identity #=> "; p hit.identity
708
- print " hit.overlap #=> "; p hit.overlap
709
-
710
- print " hit.query_seq #=> "; p hit.query_seq
711
- print " hit.midline #=> "; p hit.midline
712
- print " hit.target_seq #=> "; p hit.target_seq
713
-
714
- print " hit.query_start #=> "; p hit.query_start
715
- print " hit.query_end #=> "; p hit.query_end
716
- print " hit.target_start #=> "; p hit.target_start
717
- print " hit.target_end #=> "; p hit.target_end
718
- print " hit.lap_at #=> "; p hit.lap_at
719
- print " --- compatible/shortcut ---\n"
720
-
721
- print " hit.hsps.size #=> "; p hit.hsps.size
722
- puts
723
-
724
- print " hit.hsps.each do |hsp|\n"
725
- puts
726
-
727
- hit.hsps.each do |hsp|
728
-
729
- print "# --- Bio::Blast::Report::Hsp\n"
730
- puts
731
- print " hsp.num #=> "; p hsp.num
732
- print " hsp.bit_score #=> "; p hsp.bit_score
733
- print " hsp.score #=> "; p hsp.score
734
- print " hsp.evalue #=> "; p hsp.evalue
735
- print " hsp.identity #=> "; p hsp.identity
736
- print " hsp.gaps #=> "; p hsp.gaps
737
- print " hsp.positive #=> "; p hsp.positive
738
- print " hsp.align_len #=> "; p hsp.align_len
739
- print " hsp.density #=> "; p hsp.density
740
-
741
- print " hsp.query_frame #=> "; p hsp.query_frame
742
- print " hsp.query_from #=> "; p hsp.query_from
743
- print " hsp.query_to #=> "; p hsp.query_to
744
-
745
- print " hsp.hit_frame #=> "; p hsp.hit_frame
746
- print " hsp.hit_from #=> "; p hsp.hit_from
747
- print " hsp.hit_to #=> "; p hsp.hit_to
748
-
749
- print " hsp.pattern_from#=> "; p hsp.pattern_from
750
- print " hsp.pattern_to #=> "; p hsp.pattern_to
751
-
752
- print " hsp.qseq #=> "; p hsp.qseq
753
- print " hsp.midline #=> "; p hsp.midline
754
- print " hsp.hseq #=> "; p hsp.hseq
755
- puts
756
- print " hsp.percent_identity #=> "; p hsp.percent_identity
757
- print " hsp.mismatch_count #=> "; p hsp.mismatch_count
758
- puts
759
-
760
- end
761
- end
762
- end
763
- end # for multiple xml reports
764
-
765
- end
620
+ #end
766
621
 
767
622
 
@@ -461,211 +461,3 @@ module Bio
461
461
  end #class Blast
462
462
  end #module Bio
463
463
 
464
- ######################################################################
465
-
466
- if __FILE__ == $0
467
-
468
- Bio::FlatFile.open(Bio::Blast::WU::Report, ARGF) do |ff|
469
- ff.each do |rep|
470
-
471
- print "# === Bio::Blast::WU::Report\n"
472
- puts
473
- print " rep.program #=> "; p rep.program
474
- print " rep.version #=> "; p rep.version
475
- print " rep.reference #=> "; p rep.reference
476
- print " rep.notice #=> "; p rep.notice
477
- print " rep.db #=> "; p rep.db
478
- #print " rep.query_id #=> "; p rep.query_id
479
- print " rep.query_def #=> "; p rep.query_def
480
- print " rep.query_len #=> "; p rep.query_len
481
- #puts
482
- print " rep.version_number #=> "; p rep.version_number
483
- print " rep.version_date #=> "; p rep.version_date
484
- puts
485
-
486
- print "# === Parameters\n"
487
- #puts
488
- print " rep.parameters #=> "; p rep.parameters
489
- puts
490
- #@#print " rep.matrix #=> "; p rep.matrix
491
- print " rep.expect #=> "; p rep.expect
492
- #print " rep.inclusion #=> "; p rep.inclusion
493
- #@#print " rep.sc_match #=> "; p rep.sc_match
494
- #@#print " rep.sc_mismatch #=> "; p rep.sc_mismatch
495
- #@#print " rep.gap_open #=> "; p rep.gap_open
496
- #@#print " rep.gap_extend #=> "; p rep.gap_extend
497
- #print " rep.filter #=> "; p rep.filter
498
- #@#print " rep.pattern #=> "; p rep.pattern
499
- #print " rep.entrez_query #=> "; p rep.entrez_query
500
- #puts
501
- #@#print " rep.pattern_positions #=> "; p rep.pattern_positions
502
- puts
503
-
504
- print "# === Statistics (last iteration's)\n"
505
- #puts
506
- #print " rep.statistics #=> "; p rep.statistics
507
- puts
508
- print " rep.db_num #=> "; p rep.db_num
509
- print " rep.db_len #=> "; p rep.db_len
510
- #print " rep.hsp_len #=> "; p rep.hsp_len
511
- #@#print " rep.eff_space #=> "; p rep.eff_space
512
- #@#print " rep.kappa #=> "; p rep.kappa
513
- #@#print " rep.lambda #=> "; p rep.lambda
514
- #@#print " rep.entropy #=> "; p rep.entropy
515
- puts
516
- #@#print " rep.num_hits #=> "; p rep.num_hits
517
- #@#print " rep.gapped_kappa #=> "; p rep.gapped_kappa
518
- #@#print " rep.gapped_lambda #=> "; p rep.gapped_lambda
519
- #@#print " rep.gapped_entropy #=> "; p rep.gapped_entropy
520
- #@#print " rep.posted_date #=> "; p rep.posted_date
521
- puts
522
-
523
- #@#print "# === Message (last iteration's)\n"
524
- #@#puts
525
- #@#print " rep.message #=> "; p rep.message
526
- #puts
527
- #@#print " rep.converged? #=> "; p rep.converged?
528
- #puts
529
-
530
- print "# === Warning messages\n"
531
- print " rep.warnings #=> "; p rep.warnings
532
-
533
- print "# === Iterations\n"
534
- puts
535
- print " rep.itrerations.each do |itr|\n"
536
- puts
537
-
538
- rep.iterations.each do |itr|
539
-
540
- print "# --- Bio::Blast::WU::Report::Iteration\n"
541
- puts
542
-
543
- print " itr.num #=> "; p itr.num
544
- #print " itr.statistics #=> "; p itr.statistics
545
- puts
546
- print " itr.warnings #=> "; p itr.warnings
547
- print " itr.message #=> "; p itr.message
548
- print " itr.hits.size #=> "; p itr.hits.size
549
- #puts
550
- #@#print " itr.hits_newly_found.size #=> "; p itr.hits_newly_found.size;
551
- #@#print " itr.hits_found_again.size #=> "; p itr.hits_found_again.size;
552
- if itr.hits_for_pattern then
553
- itr.hits_for_pattern.each_with_index do |hp, hpi|
554
- print " itr.hits_for_pattern[#{hpi}].size #=> "; p hp.size;
555
- end
556
- end
557
- print " itr.converged? #=> "; p itr.converged?
558
- puts
559
-
560
- print " itr.hits.each do |hit|\n"
561
- puts
562
-
563
- itr.hits.each_with_index do |hit, i|
564
-
565
- print "# --- Bio::Blast::WU::Report::Hit"
566
- print " ([#{i}])\n"
567
- puts
568
-
569
- #print " hit.num #=> "; p hit.num
570
- #print " hit.hit_id #=> "; p hit.hit_id
571
- print " hit.len #=> "; p hit.len
572
- print " hit.definition #=> "; p hit.definition
573
- #print " hit.accession #=> "; p hit.accession
574
- #puts
575
- print " hit.found_again? #=> "; p hit.found_again?
576
- #puts
577
- print " hit.score #=> "; p hit.score
578
- print " hit.pvalue #=> "; p hit.pvalue
579
- print " hit.n_number #=> "; p hit.n_number
580
-
581
- print " --- compatible/shortcut ---\n"
582
- #print " hit.query_id #=> "; p hit.query_id
583
- #print " hit.query_def #=> "; p hit.query_def
584
- #print " hit.query_len #=> "; p hit.query_len
585
- #print " hit.target_id #=> "; p hit.target_id
586
- print " hit.target_def #=> "; p hit.target_def
587
- print " hit.target_len #=> "; p hit.target_len
588
-
589
- print " --- first HSP's values (shortcut) ---\n"
590
- print " hit.evalue #=> "; p hit.evalue
591
- print " hit.bit_score #=> "; p hit.bit_score
592
- print " hit.identity #=> "; p hit.identity
593
- #print " hit.overlap #=> "; p hit.overlap
594
-
595
- print " hit.query_seq #=> "; p hit.query_seq
596
- print " hit.midline #=> "; p hit.midline
597
- print " hit.target_seq #=> "; p hit.target_seq
598
-
599
- print " hit.query_start #=> "; p hit.query_start
600
- print " hit.query_end #=> "; p hit.query_end
601
- print " hit.target_start #=> "; p hit.target_start
602
- print " hit.target_end #=> "; p hit.target_end
603
- print " hit.lap_at #=> "; p hit.lap_at
604
- print " --- first HSP's vaules (shortcut) ---\n"
605
- print " --- compatible/shortcut ---\n"
606
-
607
- puts
608
- print " hit.hsps.size #=> "; p hit.hsps.size
609
- if hit.hsps.size == 0 then
610
- puts " (HSP not found: please see blastall's -b and -v options)"
611
- puts
612
- else
613
-
614
- puts
615
- print " hit.hsps.each do |hsp|\n"
616
- puts
617
-
618
- hit.hsps.each_with_index do |hsp, j|
619
-
620
- print "# --- Bio::Blast::WU::Report::Hsp"
621
- print " ([#{j}])\n"
622
- puts
623
- #print " hsp.num #=> "; p hsp.num
624
- print " hsp.bit_score #=> "; p hsp.bit_score
625
- print " hsp.score #=> "; p hsp.score
626
- print " hsp.evalue #=> "; p hsp.evalue
627
- print " hsp.identity #=> "; p hsp.identity
628
- print " hsp.gaps #=> "; p hsp.gaps
629
- print " hsp.positive #=> "; p hsp.positive
630
- print " hsp.align_len #=> "; p hsp.align_len
631
- #print " hsp.density #=> "; p hsp.density
632
- puts
633
- print " hsp.pvalue #=> "; p hsp.pvalue
634
- print " hsp.p_sum_n #=> "; p hsp.p_sum_n
635
- puts
636
-
637
- print " hsp.query_frame #=> "; p hsp.query_frame
638
- print " hsp.query_from #=> "; p hsp.query_from
639
- print " hsp.query_to #=> "; p hsp.query_to
640
-
641
- print " hsp.hit_frame #=> "; p hsp.hit_frame
642
- print " hsp.hit_from #=> "; p hsp.hit_from
643
- print " hsp.hit_to #=> "; p hsp.hit_to
644
-
645
- #print " hsp.pattern_from#=> "; p hsp.pattern_from
646
- #print " hsp.pattern_to #=> "; p hsp.pattern_to
647
-
648
- print " hsp.qseq #=> "; p hsp.qseq
649
- print " hsp.midline #=> "; p hsp.midline
650
- print " hsp.hseq #=> "; p hsp.hseq
651
- puts
652
- print " hsp.percent_identity #=> "; p hsp.percent_identity
653
- #print " hsp.mismatch_count #=> "; p hsp.mismatch_count
654
- #
655
- print " hsp.query_strand #=> "; p hsp.query_strand
656
- print " hsp.hit_strand #=> "; p hsp.hit_strand
657
- print " hsp.percent_positive #=> "; p hsp.percent_positive
658
- print " hsp.percent_gaps #=> "; p hsp.percent_gaps
659
- puts
660
-
661
- end #each
662
- end #if hit.hsps.size == 0
663
- end
664
- end
665
- end #ff.each
666
- end #FlatFile.open
667
-
668
- end #if __FILE__ == $0
669
-
670
- ######################################################################
671
-
@@ -191,10 +191,13 @@ class Fasta
191
191
  txt.sub!(/\<\/pre\>.*\z/m, '')
192
192
  txt.sub!(/.*^((T?FASTA|SSEARCH) (searches|compares))/m, '\1')
193
193
  txt.sub!(/^\<form method\=\"POST\" name\=\"clust_check\"\>.*\n/, '')
194
+ txt.sub!(/^\<select +name\=\"allch\".+\r?\n/i, '') # 2009.11.26
194
195
  txt.gsub!(/\<input[^\>]+value\=\"[^\"]*\"[^\>]*\>/i, '')
195
196
  txt.gsub!(/\<(a|form|select|input|option|img)\s+[^\>]+\>/i, '')
196
197
  txt.gsub!(/\<\/(a|form|select|input|option|img)\>/i, '')
197
- @output = txt.gsub(/\&lt\;/, '<')
198
+ txt.gsub!(/\&lt\;/, '<')
199
+ txt.gsub!(/\&gt\;/, '>') # 2009.11.26
200
+ @output = txt
198
201
  report = parse_result(@output.dup)
199
202
  else
200
203
  raise 'cannot understand response'
@@ -208,21 +211,3 @@ end # Fasta
208
211
 
209
212
  end # Bio
210
213
 
211
-
212
- if __FILE__ == $0
213
- begin
214
- require 'pp'
215
- alias p pp
216
- rescue
217
- end
218
-
219
- # serv = Bio::Fasta.local('fasta34', 'hoge.nuc')
220
- # serv = Bio::Fasta.local('fasta34', 'hoge.pep')
221
- # serv = Bio::Fasta.local('ssearch34', 'hoge.pep')
222
-
223
- # This may take 3 minutes or so.
224
- serv = Bio::Fasta.remote('fasta', 'genes')
225
- p serv.query(ARGF.read)
226
- end
227
-
228
-
@@ -399,17 +399,3 @@ end # Report
399
399
  end # Fasta
400
400
  end # Bio
401
401
 
402
-
403
- if __FILE__ == $0
404
- begin
405
- require 'pp'
406
- alias p pp
407
- rescue
408
- end
409
-
410
- rep = Bio::Fasta::Report.new(ARGF.read)
411
- p rep
412
-
413
- end
414
-
415
-
@@ -374,179 +374,3 @@ end # class Genscan
374
374
 
375
375
  end # module Bio
376
376
 
377
-
378
-
379
-
380
-
381
- # testing code
382
-
383
- if __FILE__ == $0
384
-
385
- if $<.filename != '-'
386
- report = $<.read
387
- else
388
- report = File.open(__FILE__, 'r').read.scan(/^>>>> (.+)$/).join("\n")
389
- end
390
-
391
-
392
- puts "= class Bio::Genscan::Report "
393
- report = Bio::Genscan::Report.new(report)
394
-
395
-
396
- print " report.genscan_version #=> "
397
- p report.genscan_version
398
- print " report.date_run #=> "
399
- p report.date_run
400
- print " report.time #=> "
401
- p report.time
402
-
403
- print " report.query_name #=> "
404
- p report.query_name
405
- print " report.length #=> "
406
- p report.length
407
- print " report.gccontent #=> "
408
- p report.gccontent
409
- print " report.isochore #=> "
410
- p report.isochore
411
-
412
- print " report.matrix #=> "
413
- p report.matrix
414
-
415
- puts " report.predictions (Array of Bio::Genscan::Report::Gene) "
416
- print " report.predictions.size #=> "
417
- p report.predictions.size
418
-
419
-
420
- report.predictions.each {|gene|
421
- puts "\n== class Bio::Genscan::Report::Gene "
422
- print " gene.number #=> "
423
- p gene.number
424
- print " gene.aaseq (Bio::FastaFormat) #=> "
425
- p gene.aaseq
426
- print " gene.naseq (Bio::FastaFormat) #=> "
427
- p gene.naseq
428
- print " ene.promoter (Bio::Genscan::Report::Exon) #=> "
429
- p gene.promoter
430
- print " gene.polyA (Bio::Genscan::Report::Exon) #=> "
431
- p gene.polyA
432
- puts " gene.exons (Array of Bio::Genscan::Report::Exon) "
433
- print " gene.exons.size #=> "
434
- p gene.exons.size
435
-
436
-
437
- gene.exons.each {|exon|
438
- puts "\n== class Bio::Genscan::Report::Exon "
439
- print " exon.number #=> "
440
- p exon.number
441
- print " exon.exon_type #=> "
442
- p exon.exon_type
443
- print " exon.exon_type_long #=> "
444
- p exon.exon_type_long
445
- print " exon.strand #=> "
446
- p exon.strand
447
- print " exon.first #=> "
448
- p exon.first
449
- print " exon.last #=> "
450
- p exon.last
451
- print " exon.range (Range) #=> "
452
- p exon.range
453
- print " exon.frame #=> "
454
- p exon.frame
455
- print " exon.phase #=> "
456
- p exon.phase
457
- print " exon.acceptor_score #=> "
458
- p exon.acceptor_score
459
- print " exon.donor_score #=> "
460
- p exon.donor_score
461
- print " exon.initiation_score #=> "
462
- p exon.initiation_score
463
- print " exon.termination_score #=> "
464
- p exon.termination_score
465
- print " exon.score #=> "
466
- p exon.score
467
- print " exon.p_value #=> "
468
- p exon.p_value
469
- print " exon.t_score #=> "
470
- p exon.t_score
471
- puts
472
- }
473
- puts
474
- }
475
-
476
- end
477
-
478
-
479
-
480
-
481
-
482
- =begin
483
-
484
-
485
- = Sample Genscan report with '^>>>> '.
486
-
487
-
488
- >>>> GENSCAN 1.0 Date run: 30-May-103 Time: 14:06:28
489
- >>>>
490
- >>>> Sequence HUMRASH : 12942 bp : 68.17% C+G : Isochore 4 (57 - 100 C+G%)
491
- >>>>
492
- >>>> Parameter matrix: HumanIso.smat
493
- >>>>
494
- >>>> Predicted genes/exons:
495
- >>>>
496
- >>>> Gn.Ex Type S .Begin ...End .Len Fr Ph I/Ac Do/T CodRg P.... Tscr..
497
- >>>> ----- ---- - ------ ------ ---- -- -- ---- ---- ----- ----- ------
498
- >>>>
499
- >>>> 1.01 Init + 1664 1774 111 1 0 94 83 212 0.997 21.33
500
- >>>> 1.02 Intr + 2042 2220 179 1 2 104 66 408 0.997 40.12
501
- >>>> 1.03 Intr + 2374 2533 160 1 1 89 94 302 0.999 32.08
502
- >>>> 1.04 Term + 3231 3350 120 2 0 115 48 202 0.980 18.31
503
- >>>> 1.05 PlyA + 3722 3727 6 -5.80
504
- >>>>
505
- >>>> 2.00 Prom + 6469 6508 40 -7.92
506
- >>>> 2.01 Init + 8153 8263 111 1 0 94 83 212 0.998 21.33
507
- >>>> 2.02 Intr + 8531 8709 179 1 2 104 66 408 0.997 40.12
508
- >>>> 2.03 Intr + 8863 9022 160 1 1 89 94 302 0.999 32.08
509
- >>>> 2.04 Term + 9720 9839 120 2 0 115 48 202 0.961 18.31
510
- >>>>
511
- >>>> Predicted peptide sequence(s):
512
- >>>>
513
- >>>> Predicted coding sequence(s):
514
- >>>>
515
- >>>>
516
- >>>> >HUMRASH|GENSCAN_predicted_peptide_1|189_aa
517
- >>>> MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPTIEDSYRKQVVIDGETCLLDILDTAG
518
- >>>> QEEYSAMRDQYMRTGEGFLCVFAINNTKSFEDIHQYREQIKRVKDSDDVPMVLVGNKCDL
519
- >>>> AARTVESRQAQDLARSYGIPYIETSAKTRQGVEDAFYTLVREIRQHKLRKLNPPDESGPG
520
- >>>> CMSCKCVLS
521
- >>>>
522
- >>>> >HUMRASH|GENSCAN_predicted_CDS_1|570_bp
523
- >>>> atgacggaatataagctggtggtggtgggcgccggcggtgtgggcaagagtgcgctgacc
524
- >>>> atccagctgatccagaaccattttgtggacgaatacgaccccactatagaggattcctac
525
- >>>> cggaagcaggtggtcattgatggggagacgtgcctgttggacatcctggataccgccggc
526
- >>>> caggaggagtacagcgccatgcgggaccagtacatgcgcaccggggagggcttcctgtgt
527
- >>>> gtgtttgccatcaacaacaccaagtcttttgaggacatccaccagtacagggagcagatc
528
- >>>> aaacgggtgaaggactcggatgacgtgcccatggtgctggtggggaacaagtgtgacctg
529
- >>>> gctgcacgcactgtggaatctcggcaggctcaggacctcgcccgaagctacggcatcccc
530
- >>>> tacatcgagacctcggccaagacccggcagggagtggaggatgccttctacacgttggtg
531
- >>>> cgtgagatccggcagcacaagctgcggaagctgaaccctcctgatgagagtggccccggc
532
- >>>> tgcatgagctgcaagtgtgtgctctcctga
533
- >>>>
534
- >>>> >HUMRASH|GENSCAN_predicted_peptide_2|189_aa
535
- >>>> MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPTIEDSYRKQVVIDGETCLLDILDTAG
536
- >>>> QEEYSAMRDQYMRTGEGFLCVFAINNTKSFEDIHQYREQIKRVKDSDDVPMVLVGNKCDL
537
- >>>> AARTVESRQAQDLARSYGIPYIETSAKTRQGVEDAFYTLVREIRQHKLRKLNPPDESGPG
538
- >>>> CMSCKCVLS
539
- >>>>
540
- >>>> >HUMRASH|GENSCAN_predicted_CDS_2|570_bp
541
- >>>> atgacggaatataagctggtggtggtgggcgccggcggtgtgggcaagagtgcgctgacc
542
- >>>> atccagctgatccagaaccattttgtggacgaatacgaccccactatagaggattcctac
543
- >>>> cggaagcaggtggtcattgatggggagacgtgcctgttggacatcctggataccgccggc
544
- >>>> caggaggagtacagcgccatgcgggaccagtacatgcgcaccggggagggcttcctgtgt
545
- >>>> gtgtttgccatcaacaacaccaagtcttttgaggacatccaccagtacagggagcagatc
546
- >>>> aaacgggtgaaggactcggatgacgtgcccatggtgctggtggggaacaagtgtgacctg
547
- >>>> gctgcacgcactgtggaatctcggcaggctcaggacctcgcccgaagctacggcatcccc
548
- >>>> tacatcgagacctcggccaagacccggcagggagtggaggatgccttctacacgttggtg
549
- >>>> cgtgagatccggcagcacaagctgcggaagctgaaccctcctgatgagagtggccccggc
550
- >>>> tgcatgagctgcaagtgtgtgctctcctga
551
-
552
- =end