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
@@ -5,7 +5,7 @@
5
5
  # Mitsuteru C. Nakao <n@bioruby.org>
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: report.rb,v 1.15 2007/04/05 23:35:40 trevor Exp $
8
+ # $Id:$
9
9
  #
10
10
  # == A Report classes for PSORT Systems
11
11
  #
@@ -411,47 +411,3 @@ module Bio
411
411
 
412
412
  end # module Bio
413
413
 
414
-
415
-
416
-
417
-
418
- # testing code
419
-
420
- if __FILE__ == $0
421
-
422
-
423
- while entry = $<.gets(Bio::PSORT::PSORT2::Report::DELIMITER)
424
-
425
- puts "\n ==> a = Bio::PSORT::PSORT2::Report.parser(entry)"
426
- a = Bio::PSORT::PSORT2::Report.parser(entry)
427
-
428
- puts "\n ==> a.entry_id "
429
- p a.entry_id
430
- puts "\n ==> a.scl "
431
- p a.scl
432
- puts "\n ==> a.pred "
433
- p a.pred
434
- puts "\n ==> a.prob "
435
- p a.prob
436
- p a.prob.keys.sort.map {|k| k.rjust(4)}.inspect.gsub('"','')
437
- p a.prob.keys.sort.map {|k| a.prob[k].to_s.rjust(4) }.inspect.gsub('"','')
438
-
439
- puts "\n ==> a.k "
440
- p a.k
441
- puts "\n ==> a.definition"
442
- p a.definition
443
- puts "\n ==> a.seq"
444
- p a.seq
445
-
446
- puts "\n ==> a.features.keys.sort "
447
- p a.features.keys.sort
448
-
449
- a.features.keys.sort.each do |key|
450
- puts "\n ==> a.features['#{key}'] "
451
- puts a.features[key]
452
- end
453
-
454
-
455
- end
456
-
457
- end
@@ -41,7 +41,7 @@ require 'bio/command'
41
41
  # == References
42
42
  #
43
43
  # * The PTS1 predictor
44
- # http://mendel.imp.ac.at/mendeljsp/sat/pts1/PTS1predictor.jsp
44
+ # http://mendel.imp.ac.at/pts1/
45
45
  #
46
46
  # * Neuberger G, Maurer-Stroh S, Eisenhaber B, Hartig A, Eisenhaber F.
47
47
  # Motif refinement of the peroxisomal targeting signal 1 and evaluation
@@ -90,8 +90,7 @@ class PTS1
90
90
  # serv_fungi_specific = Bio::PTS1.new(2) # See Bio::PTS1::FUNCTION.
91
91
  #
92
92
  def initialize(func = 'METAZOA-specific')
93
- @host = "mendel.imp.ac.at"
94
- @cgi_path = "/sat/pts1/cgi-bin/pts1.cgi"
93
+ @uri = "http://mendel.imp.ac.at/jspcgi/cgi-bin/pts1/pts1.cgi"
95
94
  @output = nil
96
95
  @function = function(func)
97
96
  end
@@ -145,7 +144,6 @@ class PTS1
145
144
  @form_data = {'function' => @function.values.join(''),
146
145
  'sequence' => seq.seq,
147
146
  'name' => seq.definition }
148
- @uri = URI.parse(["http:/", @host, @cgi_path].join('/'))
149
147
 
150
148
  result = Bio::Command.post_form(@uri, @form_data)
151
149
  @output = Report.new(result.body)
@@ -5,13 +5,14 @@
5
5
  # Mitsuteru C. Nakao <n@bioruby.org>
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: report.rb,v 1.11 2007/04/05 23:35:40 trevor Exp $
8
+ # $Id:$
9
9
  #
10
10
  # == Example
11
11
  #
12
12
  # == References
13
13
  #
14
- # * http://sosui.proteome.bio.tuat.ac.jp/sosui_submit.html
14
+ # * http://bp.nuap.nagoya-u.ac.jp/sosui/
15
+ # * http://bp.nuap.nagoya-u.ac.jp/sosui/sosui_submit.html
15
16
  #
16
17
 
17
18
 
@@ -22,7 +23,8 @@ module Bio
22
23
  # = SOSUI output report parsing class
23
24
  #
24
25
  # == References
25
- # * http://sosui.proteome.bio.tuat.ac.jp/sosui_submit.html
26
+ # * http://bp.nuap.nagoya-u.ac.jp/sosui/
27
+ # * http://bp.nuap.nagoya-u.ac.jp/sosui/sosui_submit.html
26
28
  class Report
27
29
 
28
30
  # Delimiter
@@ -98,54 +100,3 @@ module Bio
98
100
  end # module Bio
99
101
 
100
102
 
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
-
@@ -5,7 +5,7 @@
5
5
  # Mitsuteru C. Nakao <n@bioruby.org>
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: report.rb,v 1.9 2007/04/05 23:35:40 trevor Exp $
8
+ # $Id:$
9
9
  #
10
10
  # == Description
11
11
  #
@@ -162,106 +162,3 @@ module Bio
162
162
 
163
163
  end # moudel Bio
164
164
 
165
-
166
-
167
- if __FILE__ == $0
168
-
169
- begin
170
- require 'pp'
171
- alias p pp
172
- rescue LoadError
173
- end
174
-
175
-
176
- plant = <<HOGE
177
-
178
- ### ### ### T A R G E T P 1.0 prediction results ### ### ###
179
-
180
- # Number of input sequences: 1
181
- # Cleavage site predictions not included.
182
- # Using PLANT networks.
183
-
184
- # Name Length cTP mTP SP other Loc. RC
185
- #----------------------------------------------------------------------------------
186
- MGI_2141503 640 0.031 0.161 0.271 0.844 _ 3
187
- #----------------------------------------------------------------------------------
188
- # cutoff 0.00 0.00 0.00 0.00
189
-
190
-
191
- HOGE
192
-
193
- plant_c = <<HOGE
194
-
195
- ### ### ### T A R G E T P 1.0 prediction results ### ### ###
196
-
197
- # Number of input sequences: 1
198
- # Cleavage site predictions included.
199
- # Using PLANT networks.
200
-
201
- # Name Length cTP mTP SP other Loc. RC TPlen
202
- #----------------------------------------------------------------------------------
203
- MGI_2141503 640 0.031 0.161 0.271 0.844 _ 3 -
204
- #----------------------------------------------------------------------------------
205
- # cutoff 0.00 0.00 0.00 0.00
206
-
207
-
208
-
209
- HOGE
210
-
211
- non_plant_c = <<HOGE
212
-
213
- ### ### ### T A R G E T P 1.0 prediction results ### ### ###
214
-
215
- # Number of input sequences: 1
216
- # Cleavage site predictions included.
217
- # Using NON-PLANT networks.
218
-
219
- # Name Length mTP SP other Loc. RC TPlen
220
- #--------------------------------------------------------------------------
221
- MGI_96083 2187 0.292 0.053 0.746 _ 3 -
222
- #--------------------------------------------------------------------------
223
- # cutoff 0.00 0.00 0.00
224
-
225
-
226
-
227
- HOGE
228
-
229
-
230
- def hoge(e)
231
- puts e
232
- ent = Bio::TargetP::Report.new(e)
233
- pp ent
234
-
235
- p [:entry_id, ent.entry_id]
236
- p [:name, ent.name]
237
- p [:version, ent.version]
238
- p [:query_sequnces, ent.query_sequences]
239
- p [:cleavage_site_prediction, ent.cleavage_site_prediction]
240
- p [:networks, ent.networks]
241
- p [:query_len, ent.query_len]
242
- p [:prediction, ent.prediction]
243
- p [:pred_Name, ent.pred['Name']]
244
- p [:pred_SP, ent.pred['SP']]
245
- p [:pred_mTP, ent.pred['mTP']]
246
- p [:cutoff, ent.cutoff]
247
- p [:loc, ent.loc]
248
- p [:rc, ent.rc]
249
-
250
- puts '=='
251
- end
252
-
253
-
254
- [plant, plant_c, non_plant_c].each {|e|
255
- hoge(e)
256
- }
257
-
258
- exit if ARGV.size == 0
259
-
260
- while ent = $<.gets(Bio::TargetP::Report::DELIMITER)
261
- hoge(ent)
262
- end
263
-
264
- end
265
-
266
-
267
-
@@ -193,39 +193,3 @@ module Bio
193
193
 
194
194
  end # module Bio
195
195
 
196
-
197
- if __FILE__ == $0
198
-
199
- begin
200
- require 'pp'
201
- alias p pp
202
- rescue LoadError
203
- end
204
-
205
- Bio::TMHMM.reports(ARGF.read) do |ent|
206
- puts '==>'
207
- puts ent.to_s
208
- pp ent
209
-
210
- p [:entry_id, ent.entry_id]
211
- p [:query_len, ent.query_len]
212
- p [:predicted_tmhs, ent.predicted_tmhs]
213
- p [:tmhs_size, ent.tmhs.size]
214
- p [:exp_aas_in_tmhs, ent.exp_aas_in_tmhs]
215
- p [:exp_first_60aa, ent.exp_first_60aa]
216
- p [:total_prob_of_N_in, ent.total_prob_of_N_in]
217
-
218
- ent.tmhs.each do |t|
219
- p t
220
- p [:entry_id, t.entry_id]
221
- p [:version, t.version]
222
- p [:status, t.status]
223
- p [:range, t.range]
224
- p [:pos, t.pos]
225
- end
226
-
227
- p [:helix, ent.helix]
228
- p ent.tmhs.map {|t| t if t.status == 'TMhelix' }.compact
229
- end
230
-
231
- end
@@ -357,22 +357,33 @@ module Command
357
357
 
358
358
  # Backport of Dir.mktmpdir in Ruby 1.9.
359
359
  #
360
- # Same as Dir.mktmpdir(prefix_suffix) in Ruby 1.9 except that
361
- # prefix must be a String, nil, or omitted.
360
+ # Same as Dir.mktmpdir(prefix_suffix) in Ruby 1.9.
362
361
  #
363
362
  # ---
364
363
  # *Arguments*:
365
- # * (optional) _prefix_: String
364
+ # * (optional) <em>prefix_suffix</em>: String (or Array, etc.)
365
+ # * (optional) <em>tmpdir</em>: String: temporary directory's path
366
366
  #
367
- def mktmpdir(prefix = 'd', tmpdir = nil, &block)
368
- prefix = prefix.to_str
367
+ def mktmpdir(prefix_suffix = nil, tmpdir = nil, &block)
369
368
  begin
370
- Dir.mktmpdir(prefix, tmpdir, &block)
369
+ Dir.mktmpdir(prefix_suffix, tmpdir, &block)
371
370
  rescue NoMethodError
372
- suffix = ''
373
- # backported from Ruby 1.9.0.
374
- # ***** Below is excerpted from Ruby 1.9.0's lib/tmpdir.rb ****
371
+ # backported from Ruby 1.9.2-preview1.
372
+ # ***** Below is excerpted from Ruby 1.9.2-preview1's lib/tmpdir.rb ****
375
373
  # ***** Be careful about copyright. ****
374
+ case prefix_suffix
375
+ when nil
376
+ prefix = "d"
377
+ suffix = ""
378
+ when String
379
+ prefix = prefix_suffix
380
+ suffix = ""
381
+ when Array
382
+ prefix = prefix_suffix[0]
383
+ suffix = prefix_suffix[1]
384
+ else
385
+ raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}"
386
+ end
376
387
  tmpdir ||= Dir.tmpdir
377
388
  t = Time.now.strftime("%Y%m%d")
378
389
  n = nil
@@ -396,10 +407,83 @@ module Command
396
407
  else
397
408
  path
398
409
  end
399
- # ***** Above is excerpted from Ruby 1.9.0's lib/tmpdir.rb ****
410
+ # ***** Above is excerpted from Ruby 1.9.2-preview1's lib/tmpdir.rb ****
400
411
  end
401
412
  end
402
413
 
414
+ # Bio::Command::Tmpdir is a wrapper class to handle temporary directory
415
+ # like Tempfile class. A temporary directory is created when the object
416
+ # of the class is created, and automatically removed when the object
417
+ # is destroyed by GC.
418
+ #
419
+ # BioRuby library internal use only.
420
+ class Tmpdir
421
+
422
+ # Returns finalizer object for Tmpdir class.
423
+ # Internal use only. Users should not call this method directly.
424
+ #
425
+ # Acknowledgement: The essense of the code is taken from tempfile.rb
426
+ # in Ruby 1.8.7.
427
+ #
428
+ # ---
429
+ # *Arguments*:
430
+ # * (required) _data_: Array containing internal data
431
+ # *Returns*:: Proc object
432
+ def self.callback(data)
433
+ pid = $$
434
+ lambda {
435
+ path, = *data
436
+ if pid == $$
437
+ $stderr.print "removing ", path, " ..." if $DEBUG
438
+ if path and !path.empty? and
439
+ File.directory?(path) and
440
+ !File.symlink?(path) then
441
+ Bio::Command.remove_entry_secure(path)
442
+ $stderr.print "done\n" if $DEBUG
443
+ else
444
+ $stderr.print "skipped\n" if $DEBUG
445
+ end
446
+ end
447
+ }
448
+ end
449
+
450
+ # Creates a new Tmpdir object.
451
+ # The arguments are the same as Bio::Command.mktmpdir.
452
+ #
453
+ # ---
454
+ # *Arguments*:
455
+ # * (optional) <em>prefix_suffix</em>: String (or Array)
456
+ # * (optional) <em>tmpdir</em>: String: temporary directory's path
457
+ # *Returns*:: Tmpdir object
458
+ def initialize(prefix_suffix = nil, tmpdir = nil)
459
+ @data = []
460
+ @clean_proc = self.class.callback(@data)
461
+ ObjectSpace.define_finalizer(self, @clean_proc)
462
+ @data.push(@path = Bio::Command.mktmpdir(prefix_suffix, tmpdir).freeze)
463
+ end
464
+
465
+ # Path to the temporay directory
466
+ #
467
+ # *Returns*:: String
468
+ def path
469
+ @path || raise(IOError, 'removed temporary directory')
470
+ end
471
+
472
+ # Removes the temporary directory.
473
+ #
474
+ # *Returns*:: nil
475
+ def close!
476
+ # raise error if path is nil
477
+ self.path
478
+ # finilizer object is called to remove the directory
479
+ @clean_proc.call
480
+ # unregister finalizer
481
+ ObjectSpace.undefine_finalizer(self)
482
+ # @data and @path is removed
483
+ @data = @path = nil
484
+ end
485
+ end #class Tmpdir
486
+
403
487
  # Same as OpenURI.open_uri(uri).read
404
488
  # and
405
489
  # it uses proxy if an environment variable (same as OpenURI.open_uri)
@@ -5,7 +5,7 @@
5
5
  # Toshiaki Katayama <k@bioruby.org>
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: aa.rb,v 0.22 2007/04/06 04:44:51 k Exp $
8
+ # $Id:$
9
9
  #
10
10
 
11
11
  module Bio
@@ -271,79 +271,3 @@ end
271
271
  end # module Bio
272
272
 
273
273
 
274
- if __FILE__ == $0
275
-
276
- puts "### aa = Bio::AminoAcid.new"
277
- aa = Bio::AminoAcid.new
278
-
279
- puts "# Bio::AminoAcid['A']"
280
- p Bio::AminoAcid['A']
281
- puts "# aa['A']"
282
- p aa['A']
283
-
284
- puts "# Bio::AminoAcid.name('A'), Bio::AminoAcid.name('Ala')"
285
- p Bio::AminoAcid.name('A'), Bio::AminoAcid.name('Ala')
286
- puts "# aa.name('A'), aa.name('Ala')"
287
- p aa.name('A'), aa.name('Ala')
288
-
289
- puts "# Bio::AminoAcid.to_1('alanine'), Bio::AminoAcid.one('alanine')"
290
- p Bio::AminoAcid.to_1('alanine'), Bio::AminoAcid.one('alanine')
291
- puts "# aa.to_1('alanine'), aa.one('alanine')"
292
- p aa.to_1('alanine'), aa.one('alanine')
293
- puts "# Bio::AminoAcid.to_1('Ala'), Bio::AminoAcid.one('Ala')"
294
- p Bio::AminoAcid.to_1('Ala'), Bio::AminoAcid.one('Ala')
295
- puts "# aa.to_1('Ala'), aa.one('Ala')"
296
- p aa.to_1('Ala'), aa.one('Ala')
297
- puts "# Bio::AminoAcid.to_1('A'), Bio::AminoAcid.one('A')"
298
- p Bio::AminoAcid.to_1('A'), Bio::AminoAcid.one('A')
299
- puts "# aa.to_1('A'), aa.one('A')"
300
- p aa.to_1('A'), aa.one('A')
301
-
302
- puts "# Bio::AminoAcid.to_3('alanine'), Bio::AminoAcid.three('alanine')"
303
- p Bio::AminoAcid.to_3('alanine'), Bio::AminoAcid.three('alanine')
304
- puts "# aa.to_3('alanine'), aa.three('alanine')"
305
- p aa.to_3('alanine'), aa.three('alanine')
306
- puts "# Bio::AminoAcid.to_3('Ala'), Bio::AminoAcid.three('Ala')"
307
- p Bio::AminoAcid.to_3('Ala'), Bio::AminoAcid.three('Ala')
308
- puts "# aa.to_3('Ala'), aa.three('Ala')"
309
- p aa.to_3('Ala'), aa.three('Ala')
310
- puts "# Bio::AminoAcid.to_3('A'), Bio::AminoAcid.three('A')"
311
- p Bio::AminoAcid.to_3('A'), Bio::AminoAcid.three('A')
312
- puts "# aa.to_3('A'), aa.three('A')"
313
- p aa.to_3('A'), aa.three('A')
314
-
315
- puts "# Bio::AminoAcid.one2three('A')"
316
- p Bio::AminoAcid.one2three('A')
317
- puts "# aa.one2three('A')"
318
- p aa.one2three('A')
319
-
320
- puts "# Bio::AminoAcid.three2one('Ala')"
321
- p Bio::AminoAcid.three2one('Ala')
322
- puts "# aa.three2one('Ala')"
323
- p aa.three2one('Ala')
324
-
325
- puts "# Bio::AminoAcid.one2name('A')"
326
- p Bio::AminoAcid.one2name('A')
327
- puts "# aa.one2name('A')"
328
- p aa.one2name('A')
329
-
330
- puts "# Bio::AminoAcid.name2one('alanine')"
331
- p Bio::AminoAcid.name2one('alanine')
332
- puts "# aa.name2one('alanine')"
333
- p aa.name2one('alanine')
334
-
335
- puts "# Bio::AminoAcid.three2name('Ala')"
336
- p Bio::AminoAcid.three2name('Ala')
337
- puts "# aa.three2name('Ala')"
338
- p aa.three2name('Ala')
339
-
340
- puts "# Bio::AminoAcid.name2three('alanine')"
341
- p Bio::AminoAcid.name2three('alanine')
342
- puts "# aa.name2three('alanine')"
343
- p aa.name2three('alanine')
344
-
345
- puts "# Bio::AminoAcid.to_re('BZACDEFGHIKLMNPQRSTVWYU')"
346
- p Bio::AminoAcid.to_re('BZACDEFGHIKLMNPQRSTVWYU')
347
-
348
- end
349
-