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,13 +5,15 @@
5
5
  #
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: test_flatfile.rb,v 1.2 2007/04/05 23:35:43 trevor Exp $
8
+ # $Id:$
9
9
  #
10
10
 
11
+ # loading helper routine for testing bioruby
11
12
  require 'pathname'
12
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5, 'lib')).cleanpath.to_s
13
- $:.unshift(libpath) unless $:.include?(libpath)
13
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
14
+ 'bioruby_test_helper.rb')).cleanpath.to_s
14
15
 
16
+ # libraries needed for the tests
15
17
  require 'test/unit'
16
18
  require 'bio'
17
19
 
@@ -20,10 +22,7 @@ module Bio::TestFlatFile
20
22
  # testing default AutoDetect's behavior
21
23
  class TestDefaultAutoDetect < Test::Unit::TestCase
22
24
 
23
- bioruby_root = Pathname.new(File.join(File.dirname(__FILE__),
24
- ['..'] * 5)).cleanpath.to_s
25
- TestDataPath = Pathname.new(File.join(bioruby_root,
26
- 'test', 'data')).cleanpath.to_s
25
+ TestDataPath = BioRubyTestDataPath
27
26
 
28
27
  def setup
29
28
  @ad = Bio::FlatFile::AutoDetect.default
@@ -8,18 +8,19 @@
8
8
  # $Id:$
9
9
  #
10
10
 
11
+ # loading helper routine for testing bioruby
11
12
  require 'pathname'
12
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5, 'lib')).cleanpath.to_s
13
- $:.unshift(libpath) unless $:.include?(libpath)
13
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
14
+ 'bioruby_test_helper.rb')).cleanpath.to_s
14
15
 
16
+ # libraries needed for the tests
15
17
  require 'test/unit'
16
- require 'bio'
17
18
  require 'stringio'
19
+ require 'bio/io/flatfile/buffer'
18
20
 
19
21
  module Bio::TestFlatFileBufferedInputStream
20
22
 
21
- bioruby_root = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5)).cleanpath.to_s
22
- TestDataPath = Pathname.new(File.join(bioruby_root, 'test', 'data')).cleanpath.to_s
23
+ TestDataPath = BioRubyTestDataPath
23
24
  TestDataFastaFormat01 = File.join(TestDataPath, 'fasta', 'example1.txt')
24
25
 
25
26
  class TestBufferedInputStreamClassMethod < Test::Unit::TestCase
@@ -8,14 +8,14 @@
8
8
  # $Id:$
9
9
  #
10
10
 
11
+ # loading helper routine for testing bioruby
11
12
  require 'pathname'
12
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5, 'lib')).cleanpath.to_s
13
- $:.unshift(libpath) unless $:.include?(libpath)
13
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
14
+ 'bioruby_test_helper.rb')).cleanpath.to_s
14
15
 
16
+ # libraries needed for the tests
15
17
  require 'test/unit'
16
18
  require 'stringio'
17
-
18
- require 'bio'
19
19
  require 'bio/io/flatfile/splitter'
20
20
  require 'bio/io/flatfile/buffer'
21
21
 
@@ -7,11 +7,12 @@
7
7
  # $Id:$
8
8
  #
9
9
 
10
+ # loading helper routine for testing bioruby
10
11
  require 'pathname'
11
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
12
- $:.unshift(libpath) unless $:.include?(libpath)
13
-
12
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
13
+ 'bioruby_test_helper.rb')).cleanpath.to_s
14
14
 
15
+ # libraries needed for the tests
15
16
  require 'test/unit'
16
17
  require 'bio/io/ddbjxml'
17
18
 
@@ -5,13 +5,15 @@
5
5
  # Mitsuteru C. Nakao <n@bioruby.org>
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: test_ensembl.rb,v 1.6 2007/04/05 23:35:43 trevor Exp $
8
+ # $Id:$
9
9
  #
10
10
 
11
+ # loading helper routine for testing bioruby
11
12
  require 'pathname'
12
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
13
- $:.unshift(libpath) unless $:.include?(libpath)
13
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
14
+ 'bioruby_test_helper.rb')).cleanpath.to_s
14
15
 
16
+ # libraries needed for the tests
15
17
  require 'test/unit'
16
18
  require 'bio/io/ensembl'
17
19
 
@@ -7,11 +7,12 @@
7
7
  # $Id:$
8
8
  #
9
9
 
10
+ # loading helper routine for testing bioruby
10
11
  require 'pathname'
11
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
12
- $:.unshift(libpath) unless $:.include?(libpath)
13
-
12
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
13
+ 'bioruby_test_helper.rb')).cleanpath.to_s
14
14
 
15
+ # libraries needed for the tests
15
16
  require 'test/unit'
16
17
  require 'bio/io/fastacmd'
17
18
 
@@ -5,13 +5,15 @@
5
5
  #
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: test_flatfile.rb,v 1.2 2007/04/05 23:35:43 trevor Exp $
8
+ # $Id:$
9
9
  #
10
10
 
11
+ # loading helper routine for testing bioruby
11
12
  require 'pathname'
12
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
13
- $:.unshift(libpath) unless $:.include?(libpath)
13
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
14
+ 'bioruby_test_helper.rb')).cleanpath.to_s
14
15
 
16
+ # libraries needed for the tests
15
17
  require 'test/unit'
16
18
  require 'bio'
17
19
  require 'stringio'
@@ -21,8 +23,7 @@ module Bio
21
23
 
22
24
  module TestFlatFile
23
25
 
24
- bioruby_root = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4)).cleanpath.to_s
25
- TestDataPath = Pathname.new(File.join(bioruby_root, 'test', 'data')).cleanpath.to_s
26
+ TestDataPath = BioRubyTestDataPath
26
27
  TestData01 = File.join(TestDataPath, 'fasta', 'example1.txt')
27
28
 
28
29
  TestData01Ent1def =
@@ -7,11 +7,12 @@
7
7
  # $Id:$
8
8
  #
9
9
 
10
+ # loading helper routine for testing bioruby
10
11
  require 'pathname'
11
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
12
- $:.unshift(libpath) unless $:.include?(libpath)
13
-
12
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
13
+ 'bioruby_test_helper.rb')).cleanpath.to_s
14
14
 
15
+ # libraries needed for the tests
15
16
  require 'test/unit'
16
17
  require 'bio/io/soapwsdl'
17
18
 
@@ -8,10 +8,12 @@
8
8
  # $Id:$
9
9
  #
10
10
 
11
+ # loading helper routine for testing bioruby
11
12
  require 'pathname'
12
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
13
- $:.unshift(libpath) unless $:.include?(libpath)
13
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
14
+ 'bioruby_test_helper.rb')).cleanpath.to_s
14
15
 
16
+ # libraries needed for the tests
15
17
  require 'uri'
16
18
  require 'net/http'
17
19
  require 'bio/version'
@@ -5,13 +5,15 @@
5
5
  # Mitsuteru C. Nakao <n@bioruby.org>
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: test_aa.rb,v 1.5 2007/12/03 06:19:12 nakao Exp $
8
+ # $Id:$
9
9
  #
10
10
 
11
+ # loading helper routine for testing bioruby
11
12
  require 'pathname'
12
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
13
- $:.unshift(libpath) unless $:.include?(libpath)
13
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
14
+ 'bioruby_test_helper.rb')).cleanpath.to_s
14
15
 
16
+ # libraries needed for the tests
15
17
  require 'test/unit'
16
18
  require 'bio/sequence'
17
19
  require 'bio/sequence/aa'
@@ -9,10 +9,12 @@
9
9
  # $Id:$
10
10
  #
11
11
 
12
+ # loading helper routine for testing bioruby
12
13
  require 'pathname'
13
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
14
- $:.unshift(libpath) unless $:.include?(libpath)
14
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
15
+ 'bioruby_test_helper.rb')).cleanpath.to_s
15
16
 
17
+ # libraries needed for the tests
16
18
  require 'test/unit'
17
19
  require 'bio/sequence'
18
20
  require 'bio/sequence/common'
@@ -7,10 +7,12 @@
7
7
  # $Id:$
8
8
  #
9
9
 
10
+ # loading helper routine for testing bioruby
10
11
  require 'pathname'
11
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
12
- $:.unshift(libpath) unless $:.include?(libpath)
12
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
13
+ 'bioruby_test_helper.rb')).cleanpath.to_s
13
14
 
15
+ # libraries needed for the tests
14
16
  require 'test/unit'
15
17
  require 'bio/sequence'
16
18
  require 'bio/sequence/compat'
@@ -4,13 +4,15 @@
4
4
  # Copyright:: Copyright (C) 2008 Naohisa Goto <ng@bioruby.org>
5
5
  # License:: The Ruby License
6
6
  #
7
- # $Id: test_dblink.rb,v 1.1.2.1 2008/06/17 15:44:22 ngoto Exp $
7
+ # $Id:$
8
8
  #
9
9
 
10
+ # loading helper routine for testing bioruby
10
11
  require 'pathname'
11
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
12
- $:.unshift(libpath) unless $:.include?(libpath)
12
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
13
+ 'bioruby_test_helper.rb')).cleanpath.to_s
13
14
 
15
+ # libraries needed for the tests
14
16
  require 'test/unit'
15
17
  require 'bio/sequence'
16
18
  require 'bio/sequence/dblink'
@@ -8,10 +8,12 @@
8
8
  # $Id:$
9
9
  #
10
10
 
11
+ # loading helper routine for testing bioruby
11
12
  require 'pathname'
12
- libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
13
- $:.unshift(libpath) unless $:.include?(libpath)
13
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
14
+ 'bioruby_test_helper.rb')).cleanpath.to_s
14
15
 
16
+ # libraries needed for the tests
15
17
  require 'test/unit'
16
18
  require 'bio/sequence'
17
19
  require 'bio/sequence/na'
@@ -0,0 +1,330 @@
1
+ #
2
+ # test/unit/bio/sequence/test_quality_score.rb - Unit test for Bio::Sequence::QualityScore
3
+ #
4
+ # Copyright:: Copyright (C) 2009
5
+ # Naohisa Goto <ng@bioruby.org>
6
+ # License:: The Ruby License
7
+ #
8
+ # $Id:$
9
+ #
10
+
11
+ # loading helper routine for testing bioruby
12
+ require 'pathname'
13
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
14
+ 'bioruby_test_helper.rb')).cleanpath.to_s
15
+
16
+ # libraries needed for the tests
17
+ require 'test/unit'
18
+ require 'bio/sequence/quality_score'
19
+
20
+ module Bio
21
+ module TestSequenceQualityScore
22
+
23
+ # A module providing methods to compare float arrays
24
+ module FloatArrayComparison
25
+ private
26
+ def float_array_equivalent?(expected, actual, *arg)
27
+ assert_equal(expected.size, actual.size, *arg)
28
+ dt = Float::EPSILON * 1024
29
+ (0...(expected.size)).each do |i|
30
+ e = expected[i]
31
+ a = actual[i]
32
+ #assert_equal(e, a)
33
+ assert_in_delta(e, a, e.abs * dt)
34
+ end
35
+ end
36
+ end #module FloatArrayComparison
37
+
38
+ module TestConverterMethods
39
+
40
+ Query = (-20..100).to_a.freeze
41
+ Result_phred2solexa_1to100 =
42
+ ([ -6, -2, 0, 2, 3, 5, 6, 7, 8, 10 ] + (11..100).to_a).freeze
43
+
44
+ Result_solexa2phred =
45
+ ([ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 3,
46
+ 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 10 ] + (11..100).to_a).freeze
47
+
48
+ def test_convert_scores_from_phred_to_solexa
49
+ result = @obj.convert_scores_from_phred_to_solexa(Query)
50
+ assert_equal(Result_phred2solexa_1to100, result[21..-1])
51
+ (0..20).each do |i|
52
+ assert_operator(-6, :>, result[i])
53
+ end
54
+ end
55
+
56
+ def test_convert_scores_from_solexa_to_phred
57
+ result = @obj.convert_scores_from_solexa_to_phred(Query)
58
+ assert_equal(Result_solexa2phred, result)
59
+ end
60
+
61
+ def test_convert_nothing
62
+ result = @obj.convert_nothing(Query)
63
+ assert_equal(Query, result)
64
+ end
65
+
66
+ private
67
+
68
+ def do_test_from_phred_to_solexa(obj, meth)
69
+ result = obj.__send__(meth, Query)
70
+ assert_equal(Result_phred2solexa_1to100, result[21..-1])
71
+ (0..20).each do |i|
72
+ assert_operator(-6, :>, result[i])
73
+ end
74
+ end
75
+
76
+ def do_test_from_solexa_to_phred(obj, meth)
77
+ result = obj.__send__(meth, Query)
78
+ assert_equal(Result_solexa2phred, result)
79
+ end
80
+
81
+ def do_test_convert_nothing(obj, meth)
82
+ result = obj.__send__(meth, Query)
83
+ assert_equal(Query, result)
84
+ end
85
+ end #module TestConverterMethods
86
+
87
+ class TestConverter < Test::Unit::TestCase
88
+ include TestConverterMethods
89
+
90
+ class Dummy
91
+ include Bio::Sequence::QualityScore::Converter
92
+ end #class Dummy
93
+
94
+ def setup
95
+ @obj = Dummy.new
96
+ end
97
+ end #class TestConverter
98
+
99
+ class TestPhred < Test::Unit::TestCase
100
+ include FloatArrayComparison
101
+ include TestConverterMethods
102
+
103
+ class Dummy
104
+ include Bio::Sequence::QualityScore::Phred
105
+ end #class Dummy
106
+
107
+ Qscores = (-20..100).to_a.freeze
108
+ Q2P =
109
+ [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
110
+ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
111
+ 1.0, 0.794328234724281, 0.630957344480193, 0.501187233627272,
112
+ 0.398107170553497, 0.316227766016838, 0.251188643150958,
113
+ 0.199526231496888, 0.158489319246111, 0.125892541179417,
114
+ 0.1, 0.0794328234724281, 0.0630957344480193, 0.0501187233627272,
115
+ 0.0398107170553497, 0.0316227766016838, 0.0251188643150958,
116
+ 0.0199526231496888, 0.0158489319246111, 0.0125892541179417,
117
+ 0.01, 0.00794328234724281, 0.00630957344480193,
118
+ 0.00501187233627272, 0.00398107170553497, 0.00316227766016838,
119
+ 0.00251188643150958, 0.00199526231496888, 0.00158489319246111,
120
+ 0.00125892541179417, 0.001, 0.000794328234724281,
121
+ 0.000630957344480193, 0.000501187233627273, 0.000398107170553497,
122
+ 0.000316227766016838, 0.000251188643150958, 0.000199526231496888,
123
+ 0.000158489319246111, 0.000125892541179417, 0.0001,
124
+ 7.94328234724282e-05, 6.30957344480193e-05, 5.01187233627273e-05,
125
+ 3.98107170553497e-05, 3.16227766016838e-05, 2.51188643150958e-05,
126
+ 1.99526231496888e-05, 1.58489319246111e-05, 1.25892541179417e-05,
127
+ 1.0e-05, 7.94328234724282e-06, 6.30957344480193e-06,
128
+ 5.01187233627272e-06, 3.98107170553497e-06, 3.16227766016838e-06,
129
+ 2.51188643150958e-06, 1.99526231496888e-06, 1.58489319246111e-06,
130
+ 1.25892541179417e-06, 1.0e-06, 7.94328234724282e-07,
131
+ 6.30957344480193e-07, 5.01187233627272e-07, 3.98107170553497e-07,
132
+ 3.16227766016838e-07, 2.51188643150958e-07, 1.99526231496888e-07,
133
+ 1.58489319246111e-07, 1.25892541179417e-07, 1.0e-07,
134
+ 7.94328234724282e-08, 6.30957344480193e-08, 5.01187233627272e-08,
135
+ 3.98107170553497e-08, 3.16227766016838e-08, 2.51188643150958e-08,
136
+ 1.99526231496888e-08, 1.58489319246111e-08, 1.25892541179417e-08,
137
+ 1.0e-08, 7.94328234724282e-09, 6.30957344480194e-09,
138
+ 5.01187233627271e-09, 3.98107170553497e-09, 3.16227766016838e-09,
139
+ 2.51188643150958e-09, 1.99526231496888e-09, 1.58489319246111e-09,
140
+ 1.25892541179417e-09, 1.0e-09, 7.94328234724282e-10,
141
+ 6.30957344480194e-10, 5.01187233627271e-10, 3.98107170553497e-10,
142
+ 3.16227766016838e-10, 2.51188643150958e-10, 1.99526231496888e-10,
143
+ 1.58489319246111e-10, 1.25892541179417e-10, 1.0e-10 ].freeze
144
+ P2Q = ( [ 0 ] * 20 + (0..100).to_a ).freeze
145
+
146
+ def setup
147
+ @obj = Dummy.new
148
+ end
149
+
150
+ def test_quality_score_type
151
+ assert_equal(:phred, @obj.quality_score_type)
152
+ end
153
+
154
+ def test_phred_q2p
155
+ result = @obj.phred_q2p(Qscores)
156
+ float_array_equivalent?(Q2P, result)
157
+ end
158
+
159
+ def test_q2p
160
+ result = @obj.q2p(Qscores)
161
+ float_array_equivalent?(Q2P, result)
162
+ end
163
+
164
+ def test_self_q2p
165
+ result = Bio::Sequence::QualityScore::Phred.q2p(Qscores)
166
+ float_array_equivalent?(Q2P, result)
167
+ end
168
+
169
+ def test_phred_p2q
170
+ result = @obj.phred_p2q(Q2P)
171
+ assert_equal(P2Q, result)
172
+ end
173
+
174
+ def test_p2q
175
+ result = @obj.p2q(Q2P)
176
+ assert_equal(P2Q, result)
177
+ end
178
+
179
+ def test_self_p2q
180
+ result = Bio::Sequence::QualityScore::Phred.p2q(Q2P)
181
+ assert_equal(P2Q, result)
182
+ end
183
+
184
+ def test_convert_scores_from_phred
185
+ do_test_convert_nothing(@obj, :convert_scores_from_phred)
186
+ end
187
+
188
+ def test_convert_scores_to_phred
189
+ do_test_convert_nothing(@obj, :convert_scores_to_phred)
190
+ end
191
+
192
+ def test_convert_scores_from_solexa
193
+ do_test_from_solexa_to_phred(@obj, :convert_scores_from_solexa)
194
+ end
195
+
196
+ def test_convert_scores_to_solexa
197
+ do_test_from_phred_to_solexa(@obj, :convert_scores_to_solexa)
198
+ end
199
+
200
+ def test_self_convert_scores_to_solexa
201
+ do_test_from_phred_to_solexa(Bio::Sequence::QualityScore::Phred,
202
+ :convert_scores_to_solexa)
203
+ end
204
+ end #class TestPhred
205
+
206
+ class TestSolexa < Test::Unit::TestCase
207
+ include FloatArrayComparison
208
+ include TestConverterMethods
209
+
210
+ class Dummy
211
+ include Bio::Sequence::QualityScore::Solexa
212
+ end #class Dummy
213
+
214
+ Qscores = [ -200, -175, -150, -125, -100, -75, -50, -25,
215
+ *(-20..100).to_a ].freeze
216
+ Q2P =
217
+ [ 1.0, 1.0, 0.999999999999999, 0.999999999999684, 0.9999999999,
218
+ 0.999999968377224, 0.999990000099999, 0.99684769081674,
219
+ 0.99009900990099, 0.987567264745558, 0.98439833775817,
220
+ 0.98043769612742, 0.975496632449664, 0.969346569968284,
221
+ 0.961713496117745, 0.952273278965796, 0.940649056897232,
222
+ 0.926412443882426, 0.909090909090909, 0.888184230221883,
223
+ 0.86319311139679, 0.833662469183438, 0.799239991086898,
224
+ 0.759746926647958, 0.715252751049199, 0.666139424583122,
225
+ 0.613136820153143, 0.557311633762293, 0.5, 0.442688366237707,
226
+ 0.386863179846857, 0.333860575416878, 0.284747248950801,
227
+ 0.240253073352042, 0.200760008913102, 0.166337530816562,
228
+ 0.13680688860321, 0.111815769778117, 0.0909090909090909,
229
+ 0.0735875561175735, 0.0593509431027676, 0.0477267210342039,
230
+ 0.0382865038822547, 0.0306534300317155, 0.024503367550336,
231
+ 0.0195623038725795, 0.0156016622418296, 0.0124327352544424,
232
+ 0.0099009900990099, 0.00788068385033028, 0.00627001234143384,
233
+ 0.00498687873668797, 0.0039652856191522, 0.00315230918326021,
234
+ 0.00250559266728573, 0.00199128917072832, 0.00158238528080172,
235
+ 0.00125734251135529, 0.000999000999000999, 0.000793697778169244,
236
+ 0.000630559488339893, 0.000500936170813599, 0.000397948744304877,
237
+ 0.000316127797629618, 0.000251125563261462, 0.00019948642872153,
238
+ 0.000158464204362237, 0.000125876694242503, 9.99900009999e-05,
239
+ 7.94265144001309e-05, 6.30917536274865e-05, 5.0116211602182e-05,
240
+ 3.98091322252505e-05, 3.16217766333056e-05, 2.51182333735999e-05,
241
+ 1.99522250504614e-05, 1.5848680739949e-05, 1.25890956306177e-05,
242
+ 9.99990000099999e-06, 7.94321925200956e-06, 6.30953363433606e-06,
243
+ 5.0118472175343e-06, 3.98105585666614e-06, 3.1622676602e-06,
244
+ 2.51188012195199e-06, 1.99525833390512e-06, 1.58489068057866e-06,
245
+ 1.25892382690297e-06, 9.99999000001e-07, 7.94327603767439e-07,
246
+ 6.30956946373274e-07, 5.01186982438755e-07, 3.98107012064241e-07,
247
+ 3.1622766601687e-07, 2.5118858005524e-07, 1.99526191686179e-07,
248
+ 1.58489294127251e-07, 1.25892525330487e-07, 9.9999990000001e-08,
249
+ 7.94328171628553e-08, 6.30957304669478e-08, 5.01187208508409e-08,
250
+ 3.98107154704566e-08, 3.16227756016838e-08, 2.51188636841385e-08,
251
+ 1.99526227515816e-08, 1.58489316734225e-08, 1.25892539594523e-08,
252
+ 9.9999999e-09, 7.94328228414709e-09, 6.30957340499123e-09,
253
+ 5.01187231115385e-09, 3.98107168968604e-09, 3.16227765016838e-09,
254
+ 2.51188642520001e-09, 1.99526231098781e-09, 1.58489318994922e-09,
255
+ 1.25892541020927e-09, 9.99999999e-10, 7.94328234093325e-10,
256
+ 6.30957344082087e-10, 5.01187233376083e-10, 3.98107170395008e-10,
257
+ 3.16227765916838e-10, 2.51188643087862e-10, 1.99526231457078e-10,
258
+ 1.58489319220992e-10, 1.25892541163568e-10, 9.999999999e-11 ].freeze
259
+ P2Q_valid =
260
+ [ -150, -125, -100, -75, -50, -25, *((-20..100).to_a) ].freeze
261
+
262
+ def setup
263
+ @obj = Dummy.new
264
+ end
265
+
266
+ def test_quality_score_type
267
+ assert_equal(:solexa, @obj.quality_score_type)
268
+ end
269
+
270
+ def test_solexa_q2p
271
+ result = @obj.solexa_q2p(Qscores)
272
+ float_array_equivalent?(Q2P, result)
273
+ end
274
+
275
+ def test_q2p
276
+ result = @obj.q2p(Qscores)
277
+ float_array_equivalent?(Q2P, result)
278
+ end
279
+
280
+ def test_self_q2p
281
+ result = Bio::Sequence::QualityScore::Solexa.q2p(Qscores)
282
+ float_array_equivalent?(Q2P, result)
283
+ end
284
+
285
+ def test_solexa_p2q
286
+ result = @obj.solexa_p2q(Q2P)
287
+ assert_equal(P2Q_valid, result[2..-1])
288
+ assert_operator(-150, :>, result[0])
289
+ assert_operator(-150, :>, result[1])
290
+ end
291
+
292
+ def test_p2q
293
+ result = @obj.p2q(Q2P)
294
+ assert_equal(P2Q_valid, result[2..-1])
295
+ assert_operator(-150, :>, result[0])
296
+ assert_operator(-150, :>, result[1])
297
+ end
298
+
299
+ def test_self_p2q
300
+ result = Bio::Sequence::QualityScore::Solexa.p2q(Q2P)
301
+ assert_equal(P2Q_valid, result[2..-1])
302
+ assert_operator(-150, :>, result[0])
303
+ assert_operator(-150, :>, result[1])
304
+ end
305
+
306
+ def test_convert_scores_from_phred
307
+ do_test_from_phred_to_solexa(@obj, :convert_scores_from_phred)
308
+ end
309
+
310
+ def test_convert_scores_to_phred
311
+ do_test_from_solexa_to_phred(@obj, :convert_scores_to_phred)
312
+ end
313
+
314
+ def test_self_convert_scores_to_phred
315
+ do_test_from_solexa_to_phred(Bio::Sequence::QualityScore::Solexa,
316
+ :convert_scores_to_phred)
317
+ end
318
+
319
+ def test_convert_scores_from_solexa
320
+ do_test_convert_nothing(@obj, :convert_scores_from_solexa)
321
+ end
322
+
323
+ def test_convert_scores_to_solexa
324
+ do_test_convert_nothing(@obj, :convert_scores_to_solexa)
325
+ end
326
+ end #class TestSolexa
327
+
328
+ end #module TestSequenceQualityScore
329
+ end #module Bio
330
+