bio 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -261,9 +261,22 @@ module Bio
261
261
  @pathway = Bio::Pathway.new([], true)
262
262
  @root = nil
263
263
  @options = {}
264
+ _init_cache
264
265
  self.concat(tree) if tree
265
266
  end
266
267
 
268
+ # (private) clear internal cache
269
+ def _init_cache
270
+ @cache_parent = {}
271
+ end
272
+ private :_init_cache
273
+
274
+ # (private) clear internal cache
275
+ def _clear_cache
276
+ @cache_parent.clear
277
+ end
278
+ private :_clear_cache
279
+
267
280
  # root node of this tree
268
281
  # (even if unrooted tree, it is used by some methods)
269
282
  attr_accessor :root
@@ -366,6 +379,7 @@ module Bio
366
379
  # Returns the newly added edge.
367
380
  # If the edge already exists, it is overwritten with new one.
368
381
  def add_edge(source, target, edge = Edge.new)
382
+ _clear_cache
369
383
  @pathway.append(Bio::Relation.new(source, target, edge))
370
384
  edge
371
385
  end
@@ -387,6 +401,7 @@ module Bio
387
401
  # Returns self.
388
402
  # If the node already exists, it does nothing.
389
403
  def add_node(node)
404
+ _clear_cache
390
405
  @pathway.graph[node] ||= {}
391
406
  self
392
407
  end
@@ -404,6 +419,7 @@ module Bio
404
419
  unless self.include?(node)
405
420
  raise IndexError, 'the node does not exist'
406
421
  end
422
+ _clear_cache
407
423
  @pathway.relations.delete_if do |rel|
408
424
  rel.node.include?(node)
409
425
  end
@@ -419,6 +435,7 @@ module Bio
419
435
  # Returns self.
420
436
  # If the node does not exist, raises IndexError.
421
437
  def remove_node(node)
438
+ #_clear_cache #done in clear_node(node)
422
439
  self.clear_node(node)
423
440
  @pathway.graph.delete(node)
424
441
  self
@@ -428,6 +445,7 @@ module Bio
428
445
  # All edges connected with the removed nodes are also removed.
429
446
  # Returns self.
430
447
  def remove_node_if
448
+ #_clear_cache #done in clear_node(node)
431
449
  all = self.nodes
432
450
  all.each do |node|
433
451
  if yield node then
@@ -449,6 +467,7 @@ module Bio
449
467
  unless self.get_edge(source, target) then
450
468
  raise IndexError, 'edge not found'
451
469
  end
470
+ _clear_cache
452
471
  fwd = [ source, target ]
453
472
  rev = [ target, source ]
454
473
  @pathway.relations.delete_if do |rel|
@@ -464,6 +483,7 @@ module Bio
464
483
  # Removes each edge if the block returns not nil.
465
484
  # Returns self.
466
485
  def remove_edge_if #:yields: source, target, edge
486
+ _clear_cache
467
487
  removed_rel = []
468
488
  @pathway.relations.delete_if do |rel|
469
489
  if yield rel.node[0], rel.node[1], edge then
@@ -485,6 +505,7 @@ module Bio
485
505
  # Replaces each node by each block's return value.
486
506
  # Returns self.
487
507
  def collect_node! #:yields: node
508
+ _clear_cache
488
509
  tr = {}
489
510
  self.each_node do |node|
490
511
  tr[node] = yield node
@@ -505,6 +526,7 @@ module Bio
505
526
  # Replaces each edge by each block's return value.
506
527
  # Returns self.
507
528
  def collect_edge! #:yields: source, target, edge
529
+ _clear_cache
508
530
  @pathway.relations.each do |rel|
509
531
  newedge = yield rel.node[0], rel.node[1], rel.relation
510
532
  rel.relation = newedge
@@ -573,6 +595,7 @@ module Bio
573
595
  # shared in the concatinated tree.
574
596
  def concat(other)
575
597
  #raise TypeError unless other.kind_of?(self.class)
598
+ _clear_cache
576
599
  other.each_node do |node|
577
600
  self.add_node(node)
578
601
  end
@@ -591,6 +614,7 @@ module Bio
591
614
  raise IndexError, 'node1 not found' unless @pathway.graph[node1]
592
615
  raise IndexError, 'node2 not found' unless @pathway.graph[node2]
593
616
  return [ node1 ] if node1 == node2
617
+ return [ node1, node2 ] if @pathway.graph[node1][node2]
594
618
  step, path = @pathway.bfs_shortest_path(node1, node2)
595
619
  unless path[0] == node1 and path[-1] == node2 then
596
620
  raise NoPathError, 'node1 and node2 are not connected'
@@ -622,13 +646,53 @@ module Bio
622
646
  distance
623
647
  end
624
648
 
649
+ # (private) get parent only by using cache
650
+ def _get_cached_parent(node, root)
651
+ @cache_parent[root] ||= Hash.new
652
+ cache = @cache_parent[root]
653
+ if node == root then
654
+ unless cache.has_key?(root) then
655
+ self.adjacent_nodes(root).each do |n|
656
+ cache[n] ||= root if n != root
657
+ end
658
+ cache[root] = nil
659
+ end
660
+ parent = nil
661
+ else
662
+ unless parent = cache[node] then
663
+ parent = self.adjacent_nodes(node).find { |n|
664
+ (m = cache[n]) && (m != node)
665
+ }
666
+ _cache_parent(node, parent, root) if parent
667
+ end
668
+ parent
669
+ end
670
+ end
671
+ private :_get_cached_parent
672
+
673
+ # (private) set parent cache
674
+ def _cache_parent(node, parent, root)
675
+ return unless parent
676
+ cache = @cache_parent[root]
677
+ cache[node] = parent
678
+ self.adjacent_nodes(node).each do |n|
679
+ cache[n] ||= node if n != parent
680
+ end
681
+ end
682
+ private :_cache_parent
683
+
625
684
  # Gets the parent node of the _node_.
626
685
  # If _root_ isn't specified or _root_ is <code>nil</code>, @root is used.
627
686
  # Returns an <code>Node</code> object or nil.
628
687
  # The result is unspecified for cyclic trees.
629
688
  def parent(node, root = nil)
630
689
  root ||= @root
631
- self.path(root, node)[-2]
690
+ raise IndexError, 'can not get parent for unrooted tree' unless root
691
+ unless ret = _get_cached_parent(node, root) then
692
+ ret = self.path(root, node)[-2]
693
+ _cache_parent(node, ret, root)
694
+ end
695
+ ret
632
696
  end
633
697
 
634
698
  # Gets the adjacent children nodes of the _node_.
@@ -637,10 +701,9 @@ module Bio
637
701
  # The result is unspecified for cyclic trees.
638
702
  def children(node, root = nil)
639
703
  root ||= @root
640
- path = self.path(root, node)
641
- result = self.adjacent_nodes(node)
642
- result -= path
643
- result
704
+ c = self.adjacent_nodes(node)
705
+ c.delete(self.parent(node, root))
706
+ c
644
707
  end
645
708
 
646
709
  # Gets all descendent nodes of the _node_.
@@ -788,6 +851,7 @@ module Bio
788
851
  # Returns removed nodes.
789
852
  # Note that orphan nodes are still kept unchanged.
790
853
  def remove_nonsense_nodes
854
+ _clear_cache
791
855
  hash = {}
792
856
  self.each_node do |node|
793
857
  hash[node] = true if @pathway.graph[node].size == 2
@@ -828,6 +892,7 @@ module Bio
828
892
  unless edge = self.get_edge(node1, node2) then
829
893
  raise IndexError, 'nodes not found or two nodes are not adjacent'
830
894
  end
895
+ _clear_cache
831
896
  new_edge = Edge.new(new_distance)
832
897
  self.remove_edge(node1, node2)
833
898
  self.add_edge(node1, new_node, new_edge)
@@ -68,8 +68,9 @@ class SingleStrand < Bio::Sequence::NA
68
68
  # *Returns*:: nothing
69
69
  def initialize( sequence, *c )
70
70
  c.flatten! # if an array was supplied as an argument
71
- validate_args(sequence, c)
72
- sequence.downcase!
71
+ # NOTE t| 2009-09-19 commented out for library efficiency
72
+ # validate_args(sequence, c)
73
+ sequence = sequence.downcase
73
74
 
74
75
  if sequence =~ re_cut_symbol
75
76
  @cut_locations_in_enzyme_notation = CutLocationsInEnzymeNotation.new( strip_padding(sequence) )
@@ -5,7 +5,7 @@
5
5
  # Itoshi NIKAIDO <dritoshi@gmail.com>
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: sirna.rb,v 1.11 2007/04/05 23:35:41 trevor Exp $
8
+ # $Id:$
9
9
  #
10
10
  # == Bio::SiRNA - Designing siRNA.
11
11
  #
@@ -250,28 +250,6 @@ module Bio
250
250
 
251
251
  end # module Bio
252
252
 
253
-
254
- if __FILE__ == $0
255
-
256
- seq = Bio::Sequence::NA.new(ARGF.read)
257
-
258
- sirna = Bio::SiRNA.new(seq)
259
- pairs = sirna.design # or .design('uitei') or .uitei or .reynolds
260
-
261
- pairs.each do |pair|
262
- puts pair.report
263
-
264
- shrna = Bio::SiRNA::ShRNA.new(pair)
265
- shrna.design # or .design('BLOCK-iT') or .block_it
266
- puts shrna.report
267
-
268
- puts "# as DNA"
269
- puts shrna.top_strand.dna
270
- puts shrna.bottom_strand.dna
271
- end
272
-
273
- end
274
-
275
253
  =begin
276
254
 
277
255
  = ChangeLog
@@ -10,7 +10,7 @@
10
10
  module Bio
11
11
 
12
12
  # BioRuby version (Array containing Integer)
13
- BIORUBY_VERSION = [1, 3, 1].extend(Comparable).freeze
13
+ BIORUBY_VERSION = [1, 4, 0].extend(Comparable).freeze
14
14
 
15
15
  # Extra version specifier (String or nil).
16
16
  # Existance of the value indicates pre-release version or modified version.
@@ -0,0 +1,67 @@
1
+ #
2
+ # = sample/demo_aaindex.rb - demonstration of Bio::AAindex1 and AAindex2
3
+ #
4
+ # Copyright:: Copyright (C) 2001
5
+ # KAWASHIMA Shuichi <s@bioruby.org>
6
+ # Copyright:: Copyright (C) 2006
7
+ # Mitsuteru C. Nakao <n@bioruby.org>
8
+ # License:: The Ruby License
9
+ #
10
+ #
11
+ # == Description
12
+ #
13
+ # Demonstration of Bio::AAindex1 and Bio::AAindex2.
14
+ #
15
+ # == Requirements
16
+ #
17
+ # Internet connection and/or OBDA (Open Bio Database Access) configuration.
18
+ #
19
+ # == Usage
20
+ #
21
+ # Simply run this script.
22
+ #
23
+ # $ ruby demo_aaindex.rb
24
+ #
25
+ # == Development information
26
+ #
27
+ # The code was moved from lib/bio/db/aaindex.rb.
28
+ #
29
+
30
+ require 'bio'
31
+
32
+ #if __FILE__ == $0
33
+
34
+ puts "### AAindex1 (PRAM900102)"
35
+ aax1 = Bio::AAindex1.new(Bio::Fetch.query('aaindex', 'PRAM900102', 'raw'))
36
+ p aax1.entry_id
37
+ p aax1.definition
38
+ p aax1.dblinks
39
+ p aax1.author
40
+ p aax1.title
41
+ p aax1.journal
42
+ p aax1.comment
43
+ p aax1.correlation_coefficient
44
+ p aax1.index
45
+ p aax1
46
+ puts "### AAindex2 (DAYM780301)"
47
+ aax2 = Bio::AAindex2.new(Bio::Fetch.query('aaindex', 'DAYM780301', 'raw'))
48
+ p aax2.entry_id
49
+ p aax2.definition
50
+ p aax2.dblinks
51
+ p aax2.author
52
+ p aax2.title
53
+ p aax2.journal
54
+ p aax1.comment
55
+ p aax2.rows
56
+ p aax2.cols
57
+ p aax2.matrix
58
+ p aax2.matrix[2,2]
59
+ p aax2.matrix[2,3]
60
+ p aax2.matrix[4,3]
61
+ p aax2.matrix.determinant
62
+ p aax2.matrix.rank
63
+ p aax2.matrix.transpose
64
+ p aax2
65
+
66
+ #end
67
+
@@ -0,0 +1,101 @@
1
+ #
2
+ # = sample/demo_aminoacid.rb - demonstration of Bio::AminoAcid
3
+ #
4
+ # Copyright:: Copyright (C) 2001, 2005
5
+ # Toshiaki Katayama <k@bioruby.org>
6
+ # License:: The Ruby License
7
+ #
8
+ #
9
+ # == Description
10
+ #
11
+ # Demonstration of Bio::AminoAcid, the class for amino acid data.
12
+ #
13
+ # == Usage
14
+ #
15
+ # Simply run this script.
16
+ #
17
+ # $ ruby demo_aminoacid.rb
18
+ #
19
+ # == Development information
20
+ #
21
+ # The code was moved from lib/bio/data/aa.rb.
22
+ #
23
+
24
+ require 'bio'
25
+
26
+ #if __FILE__ == $0
27
+
28
+ puts "### aa = Bio::AminoAcid.new"
29
+ aa = Bio::AminoAcid.new
30
+
31
+ puts "# Bio::AminoAcid['A']"
32
+ p Bio::AminoAcid['A']
33
+ puts "# aa['A']"
34
+ p aa['A']
35
+
36
+ puts "# Bio::AminoAcid.name('A'), Bio::AminoAcid.name('Ala')"
37
+ p Bio::AminoAcid.name('A'), Bio::AminoAcid.name('Ala')
38
+ puts "# aa.name('A'), aa.name('Ala')"
39
+ p aa.name('A'), aa.name('Ala')
40
+
41
+ puts "# Bio::AminoAcid.to_1('alanine'), Bio::AminoAcid.one('alanine')"
42
+ p Bio::AminoAcid.to_1('alanine'), Bio::AminoAcid.one('alanine')
43
+ puts "# aa.to_1('alanine'), aa.one('alanine')"
44
+ p aa.to_1('alanine'), aa.one('alanine')
45
+ puts "# Bio::AminoAcid.to_1('Ala'), Bio::AminoAcid.one('Ala')"
46
+ p Bio::AminoAcid.to_1('Ala'), Bio::AminoAcid.one('Ala')
47
+ puts "# aa.to_1('Ala'), aa.one('Ala')"
48
+ p aa.to_1('Ala'), aa.one('Ala')
49
+ puts "# Bio::AminoAcid.to_1('A'), Bio::AminoAcid.one('A')"
50
+ p Bio::AminoAcid.to_1('A'), Bio::AminoAcid.one('A')
51
+ puts "# aa.to_1('A'), aa.one('A')"
52
+ p aa.to_1('A'), aa.one('A')
53
+
54
+ puts "# Bio::AminoAcid.to_3('alanine'), Bio::AminoAcid.three('alanine')"
55
+ p Bio::AminoAcid.to_3('alanine'), Bio::AminoAcid.three('alanine')
56
+ puts "# aa.to_3('alanine'), aa.three('alanine')"
57
+ p aa.to_3('alanine'), aa.three('alanine')
58
+ puts "# Bio::AminoAcid.to_3('Ala'), Bio::AminoAcid.three('Ala')"
59
+ p Bio::AminoAcid.to_3('Ala'), Bio::AminoAcid.three('Ala')
60
+ puts "# aa.to_3('Ala'), aa.three('Ala')"
61
+ p aa.to_3('Ala'), aa.three('Ala')
62
+ puts "# Bio::AminoAcid.to_3('A'), Bio::AminoAcid.three('A')"
63
+ p Bio::AminoAcid.to_3('A'), Bio::AminoAcid.three('A')
64
+ puts "# aa.to_3('A'), aa.three('A')"
65
+ p aa.to_3('A'), aa.three('A')
66
+
67
+ puts "# Bio::AminoAcid.one2three('A')"
68
+ p Bio::AminoAcid.one2three('A')
69
+ puts "# aa.one2three('A')"
70
+ p aa.one2three('A')
71
+
72
+ puts "# Bio::AminoAcid.three2one('Ala')"
73
+ p Bio::AminoAcid.three2one('Ala')
74
+ puts "# aa.three2one('Ala')"
75
+ p aa.three2one('Ala')
76
+
77
+ puts "# Bio::AminoAcid.one2name('A')"
78
+ p Bio::AminoAcid.one2name('A')
79
+ puts "# aa.one2name('A')"
80
+ p aa.one2name('A')
81
+
82
+ puts "# Bio::AminoAcid.name2one('alanine')"
83
+ p Bio::AminoAcid.name2one('alanine')
84
+ puts "# aa.name2one('alanine')"
85
+ p aa.name2one('alanine')
86
+
87
+ puts "# Bio::AminoAcid.three2name('Ala')"
88
+ p Bio::AminoAcid.three2name('Ala')
89
+ puts "# aa.three2name('Ala')"
90
+ p aa.three2name('Ala')
91
+
92
+ puts "# Bio::AminoAcid.name2three('alanine')"
93
+ p Bio::AminoAcid.name2three('alanine')
94
+ puts "# aa.name2three('alanine')"
95
+ p aa.name2three('alanine')
96
+
97
+ puts "# Bio::AminoAcid.to_re('BZACDEFGHIKLMNPQRSTVWYU')"
98
+ p Bio::AminoAcid.to_re('BZACDEFGHIKLMNPQRSTVWYU')
99
+
100
+ #end
101
+
@@ -0,0 +1,220 @@
1
+ #
2
+ # = sample/demo_bl2seq_report.rb - demo of bl2seq (BLAST 2 sequences) parser
3
+ #
4
+ # Copyright:: Copyright (C) 2005 Naohisa Goto <ng@bioruby.org>
5
+ # License:: The Ruby License
6
+ #
7
+ # == Description
8
+ #
9
+ # Demonstration of Bio::Blast::Bl2seq::Report, bl2seq (BLAST 2 sequences)
10
+ # parser class.
11
+ #
12
+ # == Usage
13
+ #
14
+ # Run this script with specifying filename(s) containing bl2seq result(s).
15
+ #
16
+ # $ ruby demo_bl2seq_report.rb files...
17
+ #
18
+ # Example usage using test data:
19
+ #
20
+ # $ ruby -I lib sample/demo_bl2seq_report.rb test/data/bl2seq/cd8a_cd8b_blastp.bl2seq
21
+ #
22
+ # == Development information
23
+ #
24
+ # The code was moved from lib/bio/appl/bl2seq/report.rb
25
+ #
26
+
27
+ require 'bio'
28
+
29
+ if ARGV.empty? then
30
+ puts "Demonstration of bl2seq (BLAST 2 sequences) parser."
31
+ puts "Usage: #{$0} files..."
32
+ exit(0)
33
+ end
34
+
35
+ Bio::FlatFile.open(Bio::Blast::Bl2seq::Report, ARGF) do |ff|
36
+ ff.each do |rep|
37
+
38
+ print "# === Bio::Blast::Bl2seq::Report\n"
39
+ puts
40
+ #@#print " rep.program #=> "; p rep.program
41
+ #@#print " rep.version #=> "; p rep.version
42
+ #@#print " rep.reference #=> "; p rep.reference
43
+ #@#print " rep.db #=> "; p rep.db
44
+ #print " rep.query_id #=> "; p rep.query_id
45
+ print " rep.query_def #=> "; p rep.query_def
46
+ print " rep.query_len #=> "; p rep.query_len
47
+ #puts
48
+ #@#print " rep.version_number #=> "; p rep.version_number
49
+ #@#print " rep.version_date #=> "; p rep.version_date
50
+ puts
51
+
52
+ print "# === Parameters\n"
53
+ #puts
54
+ #print " rep.parameters #=> "; p rep.parameters
55
+ puts
56
+ print " rep.matrix #=> "; p rep.matrix
57
+ print " rep.expect #=> "; p rep.expect
58
+ #print " rep.inclusion #=> "; p rep.inclusion
59
+ print " rep.sc_match #=> "; p rep.sc_match
60
+ print " rep.sc_mismatch #=> "; p rep.sc_mismatch
61
+ print " rep.gap_open #=> "; p rep.gap_open
62
+ print " rep.gap_extend #=> "; p rep.gap_extend
63
+ #print " rep.filter #=> "; p rep.filter
64
+ #@#print " rep.pattern #=> "; p rep.pattern
65
+ #print " rep.entrez_query #=> "; p rep.entrez_query
66
+ #puts
67
+ #@#print " rep.pattern_positions #=> "; p rep.pattern_positions
68
+ puts
69
+
70
+ print "# === Statistics (last iteration's)\n"
71
+ #puts
72
+ #print " rep.statistics #=> "; p rep.statistics
73
+ puts
74
+ print " rep.db_num #=> "; p rep.db_num
75
+ print " rep.db_len #=> "; p rep.db_len
76
+ #print " rep.hsp_len #=> "; p rep.hsp_len
77
+ print " rep.eff_space #=> "; p rep.eff_space
78
+ print " rep.kappa #=> "; p rep.kappa
79
+ print " rep.lambda #=> "; p rep.lambda
80
+ print " rep.entropy #=> "; p rep.entropy
81
+ puts
82
+ print " rep.num_hits #=> "; p rep.num_hits
83
+ print " rep.gapped_kappa #=> "; p rep.gapped_kappa
84
+ print " rep.gapped_lambda #=> "; p rep.gapped_lambda
85
+ print " rep.gapped_entropy #=> "; p rep.gapped_entropy
86
+ print " rep.posted_date #=> "; p rep.posted_date
87
+ puts
88
+
89
+ #@#print "# === Message (last iteration's)\n"
90
+ #@#puts
91
+ #@#print " rep.message #=> "; p rep.message
92
+ #puts
93
+ #@#print " rep.converged? #=> "; p rep.converged?
94
+ #@#puts
95
+
96
+ print "# === Iterations\n"
97
+ puts
98
+ print " rep.itrerations.each do |itr|\n"
99
+ puts
100
+
101
+ rep.iterations.each do |itr|
102
+
103
+ print "# --- Bio::Blast::Bl2seq::Report::Iteration\n"
104
+ puts
105
+
106
+ print " itr.num #=> "; p itr.num
107
+ #print " itr.statistics #=> "; p itr.statistics
108
+ #@#print " itr.message #=> "; p itr.message
109
+ print " itr.hits.size #=> "; p itr.hits.size
110
+ #puts
111
+ #@#print " itr.hits_newly_found.size #=> "; p itr.hits_newly_found.size;
112
+ #@#print " itr.hits_found_again.size #=> "; p itr.hits_found_again.size;
113
+ #@#if itr.hits_for_pattern then
114
+ #@#itr.hits_for_pattern.each_with_index do |hp, hpi|
115
+ #@#print " itr.hits_for_pattern[#{hpi}].size #=> "; p hp.size;
116
+ #@#end
117
+ #@#end
118
+ #@#print " itr.converged? #=> "; p itr.converged?
119
+ puts
120
+
121
+ print " itr.hits.each do |hit|\n"
122
+ puts
123
+
124
+ itr.hits.each_with_index do |hit, i|
125
+
126
+ print "# --- Bio::Blast::Bl2seq::Default::Report::Hit"
127
+ print " ([#{i}])\n"
128
+ puts
129
+
130
+ #print " hit.num #=> "; p hit.num
131
+ #print " hit.hit_id #=> "; p hit.hit_id
132
+ print " hit.len #=> "; p hit.len
133
+ print " hit.definition #=> "; p hit.definition
134
+ #print " hit.accession #=> "; p hit.accession
135
+ #puts
136
+ print " hit.found_again? #=> "; p hit.found_again?
137
+
138
+ print " --- compatible/shortcut ---\n"
139
+ #print " hit.query_id #=> "; p hit.query_id
140
+ #print " hit.query_def #=> "; p hit.query_def
141
+ #print " hit.query_len #=> "; p hit.query_len
142
+ #print " hit.target_id #=> "; p hit.target_id
143
+ print " hit.target_def #=> "; p hit.target_def
144
+ print " hit.target_len #=> "; p hit.target_len
145
+
146
+ print " --- first HSP's values (shortcut) ---\n"
147
+ print " hit.evalue #=> "; p hit.evalue
148
+ print " hit.bit_score #=> "; p hit.bit_score
149
+ print " hit.identity #=> "; p hit.identity
150
+ #print " hit.overlap #=> "; p hit.overlap
151
+
152
+ print " hit.query_seq #=> "; p hit.query_seq
153
+ print " hit.midline #=> "; p hit.midline
154
+ print " hit.target_seq #=> "; p hit.target_seq
155
+
156
+ print " hit.query_start #=> "; p hit.query_start
157
+ print " hit.query_end #=> "; p hit.query_end
158
+ print " hit.target_start #=> "; p hit.target_start
159
+ print " hit.target_end #=> "; p hit.target_end
160
+ print " hit.lap_at #=> "; p hit.lap_at
161
+ print " --- first HSP's vaules (shortcut) ---\n"
162
+ print " --- compatible/shortcut ---\n"
163
+
164
+ puts
165
+ print " hit.hsps.size #=> "; p hit.hsps.size
166
+ if hit.hsps.size == 0 then
167
+ puts " (HSP not found: please see blastall's -b and -v options)"
168
+ puts
169
+ else
170
+
171
+ puts
172
+ print " hit.hsps.each do |hsp|\n"
173
+ puts
174
+
175
+ hit.hsps.each_with_index do |hsp, j|
176
+
177
+ print "# --- Bio::Blast::Default::Report::HSP (Bio::Blast::Bl2seq::Report::HSP)"
178
+ print " ([#{j}])\n"
179
+ puts
180
+ #print " hsp.num #=> "; p hsp.num
181
+ print " hsp.bit_score #=> "; p hsp.bit_score
182
+ print " hsp.score #=> "; p hsp.score
183
+ print " hsp.evalue #=> "; p hsp.evalue
184
+ print " hsp.identity #=> "; p hsp.identity
185
+ print " hsp.gaps #=> "; p hsp.gaps
186
+ print " hsp.positive #=> "; p hsp.positive
187
+ print " hsp.align_len #=> "; p hsp.align_len
188
+ #print " hsp.density #=> "; p hsp.density
189
+
190
+ print " hsp.query_frame #=> "; p hsp.query_frame
191
+ print " hsp.query_from #=> "; p hsp.query_from
192
+ print " hsp.query_to #=> "; p hsp.query_to
193
+
194
+ print " hsp.hit_frame #=> "; p hsp.hit_frame
195
+ print " hsp.hit_from #=> "; p hsp.hit_from
196
+ print " hsp.hit_to #=> "; p hsp.hit_to
197
+
198
+ #print " hsp.pattern_from#=> "; p hsp.pattern_from
199
+ #print " hsp.pattern_to #=> "; p hsp.pattern_to
200
+
201
+ print " hsp.qseq #=> "; p hsp.qseq
202
+ print " hsp.midline #=> "; p hsp.midline
203
+ print " hsp.hseq #=> "; p hsp.hseq
204
+ puts
205
+ print " hsp.percent_identity #=> "; p hsp.percent_identity
206
+ #print " hsp.mismatch_count #=> "; p hsp.mismatch_count
207
+ #
208
+ print " hsp.query_strand #=> "; p hsp.query_strand
209
+ print " hsp.hit_strand #=> "; p hsp.hit_strand
210
+ print " hsp.percent_positive #=> "; p hsp.percent_positive
211
+ print " hsp.percent_gaps #=> "; p hsp.percent_gaps
212
+ puts
213
+
214
+ end #each
215
+ end #if hit.hsps.size == 0
216
+ end
217
+ end
218
+ end #ff.each
219
+ end #FlatFile.open
220
+