BioDSL 1.0.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 (197) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/BioDSL.gemspec +64 -0
  4. data/LICENSE +339 -0
  5. data/README.md +205 -0
  6. data/Rakefile +94 -0
  7. data/examples/fastq_to_fasta.rb +8 -0
  8. data/lib/BioDSL/cary.rb +242 -0
  9. data/lib/BioDSL/command.rb +133 -0
  10. data/lib/BioDSL/commands/add_key.rb +110 -0
  11. data/lib/BioDSL/commands/align_seq_mothur.rb +194 -0
  12. data/lib/BioDSL/commands/analyze_residue_distribution.rb +222 -0
  13. data/lib/BioDSL/commands/assemble_pairs.rb +336 -0
  14. data/lib/BioDSL/commands/assemble_seq_idba.rb +230 -0
  15. data/lib/BioDSL/commands/assemble_seq_ray.rb +345 -0
  16. data/lib/BioDSL/commands/assemble_seq_spades.rb +252 -0
  17. data/lib/BioDSL/commands/classify_seq.rb +217 -0
  18. data/lib/BioDSL/commands/classify_seq_mothur.rb +226 -0
  19. data/lib/BioDSL/commands/clip_primer.rb +318 -0
  20. data/lib/BioDSL/commands/cluster_otus.rb +181 -0
  21. data/lib/BioDSL/commands/collapse_otus.rb +170 -0
  22. data/lib/BioDSL/commands/collect_otus.rb +150 -0
  23. data/lib/BioDSL/commands/complement_seq.rb +117 -0
  24. data/lib/BioDSL/commands/count.rb +135 -0
  25. data/lib/BioDSL/commands/count_values.rb +149 -0
  26. data/lib/BioDSL/commands/degap_seq.rb +253 -0
  27. data/lib/BioDSL/commands/dereplicate_seq.rb +168 -0
  28. data/lib/BioDSL/commands/dump.rb +157 -0
  29. data/lib/BioDSL/commands/filter_rrna.rb +239 -0
  30. data/lib/BioDSL/commands/genecall.rb +237 -0
  31. data/lib/BioDSL/commands/grab.rb +535 -0
  32. data/lib/BioDSL/commands/index_taxonomy.rb +226 -0
  33. data/lib/BioDSL/commands/mask_seq.rb +175 -0
  34. data/lib/BioDSL/commands/mean_scores.rb +168 -0
  35. data/lib/BioDSL/commands/merge_pair_seq.rb +175 -0
  36. data/lib/BioDSL/commands/merge_table.rb +225 -0
  37. data/lib/BioDSL/commands/merge_values.rb +113 -0
  38. data/lib/BioDSL/commands/plot_heatmap.rb +233 -0
  39. data/lib/BioDSL/commands/plot_histogram.rb +306 -0
  40. data/lib/BioDSL/commands/plot_matches.rb +282 -0
  41. data/lib/BioDSL/commands/plot_residue_distribution.rb +278 -0
  42. data/lib/BioDSL/commands/plot_scores.rb +285 -0
  43. data/lib/BioDSL/commands/random.rb +153 -0
  44. data/lib/BioDSL/commands/read_fasta.rb +222 -0
  45. data/lib/BioDSL/commands/read_fastq.rb +414 -0
  46. data/lib/BioDSL/commands/read_table.rb +329 -0
  47. data/lib/BioDSL/commands/reverse_seq.rb +113 -0
  48. data/lib/BioDSL/commands/slice_align.rb +400 -0
  49. data/lib/BioDSL/commands/slice_seq.rb +151 -0
  50. data/lib/BioDSL/commands/sort.rb +223 -0
  51. data/lib/BioDSL/commands/split_pair_seq.rb +220 -0
  52. data/lib/BioDSL/commands/split_values.rb +165 -0
  53. data/lib/BioDSL/commands/trim_primer.rb +314 -0
  54. data/lib/BioDSL/commands/trim_seq.rb +192 -0
  55. data/lib/BioDSL/commands/uchime_ref.rb +170 -0
  56. data/lib/BioDSL/commands/uclust.rb +286 -0
  57. data/lib/BioDSL/commands/unique_values.rb +145 -0
  58. data/lib/BioDSL/commands/usearch_global.rb +171 -0
  59. data/lib/BioDSL/commands/usearch_local.rb +171 -0
  60. data/lib/BioDSL/commands/write_fasta.rb +207 -0
  61. data/lib/BioDSL/commands/write_fastq.rb +191 -0
  62. data/lib/BioDSL/commands/write_table.rb +419 -0
  63. data/lib/BioDSL/commands/write_tree.rb +167 -0
  64. data/lib/BioDSL/commands.rb +31 -0
  65. data/lib/BioDSL/config.rb +55 -0
  66. data/lib/BioDSL/csv.rb +307 -0
  67. data/lib/BioDSL/debug.rb +42 -0
  68. data/lib/BioDSL/fasta.rb +133 -0
  69. data/lib/BioDSL/fastq.rb +77 -0
  70. data/lib/BioDSL/filesys.rb +137 -0
  71. data/lib/BioDSL/fork.rb +145 -0
  72. data/lib/BioDSL/hamming.rb +128 -0
  73. data/lib/BioDSL/helpers/aux_helper.rb +44 -0
  74. data/lib/BioDSL/helpers/email_helper.rb +66 -0
  75. data/lib/BioDSL/helpers/history_helper.rb +40 -0
  76. data/lib/BioDSL/helpers/log_helper.rb +55 -0
  77. data/lib/BioDSL/helpers/options_helper.rb +405 -0
  78. data/lib/BioDSL/helpers/status_helper.rb +132 -0
  79. data/lib/BioDSL/helpers.rb +35 -0
  80. data/lib/BioDSL/html_report.rb +200 -0
  81. data/lib/BioDSL/math.rb +55 -0
  82. data/lib/BioDSL/mummer.rb +216 -0
  83. data/lib/BioDSL/pipeline.rb +354 -0
  84. data/lib/BioDSL/seq/ambiguity.rb +66 -0
  85. data/lib/BioDSL/seq/assemble.rb +240 -0
  86. data/lib/BioDSL/seq/backtrack.rb +252 -0
  87. data/lib/BioDSL/seq/digest.rb +99 -0
  88. data/lib/BioDSL/seq/dynamic.rb +263 -0
  89. data/lib/BioDSL/seq/homopolymer.rb +59 -0
  90. data/lib/BioDSL/seq/kmer.rb +293 -0
  91. data/lib/BioDSL/seq/levenshtein.rb +113 -0
  92. data/lib/BioDSL/seq/translate.rb +109 -0
  93. data/lib/BioDSL/seq/trim.rb +188 -0
  94. data/lib/BioDSL/seq.rb +742 -0
  95. data/lib/BioDSL/serializer.rb +98 -0
  96. data/lib/BioDSL/stream.rb +113 -0
  97. data/lib/BioDSL/taxonomy.rb +691 -0
  98. data/lib/BioDSL/test.rb +42 -0
  99. data/lib/BioDSL/tmp_dir.rb +68 -0
  100. data/lib/BioDSL/usearch.rb +301 -0
  101. data/lib/BioDSL/verbose.rb +42 -0
  102. data/lib/BioDSL/version.rb +31 -0
  103. data/lib/BioDSL.rb +81 -0
  104. data/test/BioDSL/commands/test_add_key.rb +105 -0
  105. data/test/BioDSL/commands/test_align_seq_mothur.rb +99 -0
  106. data/test/BioDSL/commands/test_analyze_residue_distribution.rb +134 -0
  107. data/test/BioDSL/commands/test_assemble_pairs.rb +459 -0
  108. data/test/BioDSL/commands/test_assemble_seq_idba.rb +50 -0
  109. data/test/BioDSL/commands/test_assemble_seq_ray.rb +51 -0
  110. data/test/BioDSL/commands/test_assemble_seq_spades.rb +50 -0
  111. data/test/BioDSL/commands/test_classify_seq.rb +50 -0
  112. data/test/BioDSL/commands/test_classify_seq_mothur.rb +59 -0
  113. data/test/BioDSL/commands/test_clip_primer.rb +377 -0
  114. data/test/BioDSL/commands/test_cluster_otus.rb +128 -0
  115. data/test/BioDSL/commands/test_collapse_otus.rb +81 -0
  116. data/test/BioDSL/commands/test_collect_otus.rb +82 -0
  117. data/test/BioDSL/commands/test_complement_seq.rb +78 -0
  118. data/test/BioDSL/commands/test_count.rb +103 -0
  119. data/test/BioDSL/commands/test_count_values.rb +85 -0
  120. data/test/BioDSL/commands/test_degap_seq.rb +96 -0
  121. data/test/BioDSL/commands/test_dereplicate_seq.rb +92 -0
  122. data/test/BioDSL/commands/test_dump.rb +109 -0
  123. data/test/BioDSL/commands/test_filter_rrna.rb +128 -0
  124. data/test/BioDSL/commands/test_genecall.rb +50 -0
  125. data/test/BioDSL/commands/test_grab.rb +398 -0
  126. data/test/BioDSL/commands/test_index_taxonomy.rb +62 -0
  127. data/test/BioDSL/commands/test_mask_seq.rb +98 -0
  128. data/test/BioDSL/commands/test_mean_scores.rb +111 -0
  129. data/test/BioDSL/commands/test_merge_pair_seq.rb +115 -0
  130. data/test/BioDSL/commands/test_merge_table.rb +131 -0
  131. data/test/BioDSL/commands/test_merge_values.rb +83 -0
  132. data/test/BioDSL/commands/test_plot_heatmap.rb +185 -0
  133. data/test/BioDSL/commands/test_plot_histogram.rb +194 -0
  134. data/test/BioDSL/commands/test_plot_matches.rb +157 -0
  135. data/test/BioDSL/commands/test_plot_residue_distribution.rb +309 -0
  136. data/test/BioDSL/commands/test_plot_scores.rb +308 -0
  137. data/test/BioDSL/commands/test_random.rb +88 -0
  138. data/test/BioDSL/commands/test_read_fasta.rb +229 -0
  139. data/test/BioDSL/commands/test_read_fastq.rb +552 -0
  140. data/test/BioDSL/commands/test_read_table.rb +327 -0
  141. data/test/BioDSL/commands/test_reverse_seq.rb +79 -0
  142. data/test/BioDSL/commands/test_slice_align.rb +218 -0
  143. data/test/BioDSL/commands/test_slice_seq.rb +131 -0
  144. data/test/BioDSL/commands/test_sort.rb +128 -0
  145. data/test/BioDSL/commands/test_split_pair_seq.rb +164 -0
  146. data/test/BioDSL/commands/test_split_values.rb +95 -0
  147. data/test/BioDSL/commands/test_trim_primer.rb +329 -0
  148. data/test/BioDSL/commands/test_trim_seq.rb +150 -0
  149. data/test/BioDSL/commands/test_uchime_ref.rb +113 -0
  150. data/test/BioDSL/commands/test_uclust.rb +139 -0
  151. data/test/BioDSL/commands/test_unique_values.rb +98 -0
  152. data/test/BioDSL/commands/test_usearch_global.rb +123 -0
  153. data/test/BioDSL/commands/test_usearch_local.rb +125 -0
  154. data/test/BioDSL/commands/test_write_fasta.rb +159 -0
  155. data/test/BioDSL/commands/test_write_fastq.rb +166 -0
  156. data/test/BioDSL/commands/test_write_table.rb +411 -0
  157. data/test/BioDSL/commands/test_write_tree.rb +122 -0
  158. data/test/BioDSL/helpers/test_options_helper.rb +272 -0
  159. data/test/BioDSL/seq/test_assemble.rb +98 -0
  160. data/test/BioDSL/seq/test_backtrack.rb +176 -0
  161. data/test/BioDSL/seq/test_digest.rb +71 -0
  162. data/test/BioDSL/seq/test_dynamic.rb +133 -0
  163. data/test/BioDSL/seq/test_homopolymer.rb +58 -0
  164. data/test/BioDSL/seq/test_kmer.rb +134 -0
  165. data/test/BioDSL/seq/test_translate.rb +75 -0
  166. data/test/BioDSL/seq/test_trim.rb +101 -0
  167. data/test/BioDSL/test_cary.rb +176 -0
  168. data/test/BioDSL/test_command.rb +45 -0
  169. data/test/BioDSL/test_csv.rb +514 -0
  170. data/test/BioDSL/test_debug.rb +42 -0
  171. data/test/BioDSL/test_fasta.rb +154 -0
  172. data/test/BioDSL/test_fastq.rb +46 -0
  173. data/test/BioDSL/test_filesys.rb +145 -0
  174. data/test/BioDSL/test_fork.rb +85 -0
  175. data/test/BioDSL/test_math.rb +41 -0
  176. data/test/BioDSL/test_mummer.rb +79 -0
  177. data/test/BioDSL/test_pipeline.rb +187 -0
  178. data/test/BioDSL/test_seq.rb +790 -0
  179. data/test/BioDSL/test_serializer.rb +72 -0
  180. data/test/BioDSL/test_stream.rb +55 -0
  181. data/test/BioDSL/test_taxonomy.rb +336 -0
  182. data/test/BioDSL/test_test.rb +42 -0
  183. data/test/BioDSL/test_tmp_dir.rb +58 -0
  184. data/test/BioDSL/test_usearch.rb +33 -0
  185. data/test/BioDSL/test_verbose.rb +42 -0
  186. data/test/helper.rb +82 -0
  187. data/www/command.html.haml +14 -0
  188. data/www/css.html.haml +55 -0
  189. data/www/input_files.html.haml +3 -0
  190. data/www/layout.html.haml +12 -0
  191. data/www/output_files.html.haml +3 -0
  192. data/www/overview.html.haml +15 -0
  193. data/www/pipeline.html.haml +4 -0
  194. data/www/png.html.haml +2 -0
  195. data/www/status.html.haml +9 -0
  196. data/www/time.html.haml +11 -0
  197. metadata +503 -0
@@ -0,0 +1,459 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
3
+
4
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
5
+ # #
6
+ # Copyright (C) 2007-2015 Martin Asser Hansen (mail@maasha.dk). #
7
+ # #
8
+ # This program is free software; you can redistribute it and/or #
9
+ # modify it under the terms of the GNU General Public License #
10
+ # as published by the Free Software Foundation; either version 2 #
11
+ # of the License, or (at your option) any later version. #
12
+ # #
13
+ # This program is distributed in the hope that it will be useful, #
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16
+ # GNU General Public License for more details. #
17
+ # #
18
+ # You should have received a copy of the GNU General Public License #
19
+ # along with this program; if not, write to the Free Software #
20
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, #
21
+ # USA. #
22
+ # #
23
+ # http://www.gnu.org/copyleft/gpl.html #
24
+ # #
25
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
26
+ # #
27
+ # This software is part of BioDSL (www.github.com/maasha/BioDSL). #
28
+ # #
29
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
30
+
31
+ require 'test/helper'
32
+
33
+ # Test class for AssemblePairs.
34
+ # rubocop:disable ClassLength
35
+ class TestAssemblePairs < Test::Unit::TestCase
36
+ # rubocop:disable MethodLength
37
+ def setup
38
+ @input, @output = BioDSL::Stream.pipe
39
+ @input2, @output2 = BioDSL::Stream.pipe
40
+
41
+ @output.write(SEQ_NAME: 'test1/1', SEQ: 'aaaaaaaagagtcat',
42
+ SCORES: 'IIIIIIIIIIIIIII', SEQ_LEN: 15)
43
+ @output.write(SEQ_NAME: 'test1/2', SEQ: 'gagtcataaaaaaaa',
44
+ SCORES: '!!!!!!!!!!!!!!!', SEQ_LEN: 15)
45
+ @output.write(SEQ_NAME: 'test2/1', SEQ: 'aaaaaaaagagGcaG',
46
+ SCORES: 'IIIIIIIIIIIIIII', SEQ_LEN: 15)
47
+ @output.write(SEQ_NAME: 'test2/2', SEQ: 'gagtcataaaaaaaa',
48
+ SCORES: '!!!!!!!!!!!!!!!', SEQ_LEN: 15)
49
+ @output.write(SEQ_NAME: 'test3/1', SEQ: 'aaaaaaaagagtcat',
50
+ SCORES: 'IIIIIIIIIIIIIII', SEQ_LEN: 15)
51
+ @output.write(SEQ_NAME: 'test3/2', SEQ: 'ttttttttatgactc',
52
+ SCORES: '!!!!!!!!!!!!!!!', SEQ_LEN: 15)
53
+ @output.write(SEQ_NAME: 'test4/1', SEQ: 'aaaaaaaaaaaaaaa',
54
+ SCORES: 'IIIIIIIIIIIIIII', SEQ_LEN: 15)
55
+ @output.write(SEQ_NAME: 'test4/2', SEQ: 'ggggggggggggggg',
56
+ SCORES: '!!!!!!!!!!!!!!!', SEQ_LEN: 15)
57
+ @output.write(FOO: 'SEQ')
58
+
59
+ @output.close
60
+
61
+ @p = BioDSL::Pipeline.new
62
+ end
63
+
64
+ test 'BioDSL::Pipeline::AssemblePairs with invalid options raises' do
65
+ assert_raise(BioDSL::OptionError) { @p.assemble_pairs(foo: 'bar') }
66
+ end
67
+
68
+ test 'BioDSL::Pipeline::AssemblePairs with allow_unassembled and ' \
69
+ 'merge_unassembled raises' do
70
+ assert_raise(BioDSL::OptionError) do
71
+ @p.assemble_pairs(allow_unassembled: true, merge_unassembled: true)
72
+ end
73
+ end
74
+
75
+ test 'BioDSL::Pipeline::AssemblePairs with valid options don\'t raise' do
76
+ assert_nothing_raised { @p.assemble_pairs(reverse_complement: true) }
77
+ end
78
+
79
+ test 'BioDSL::Pipeline::AssemblePairs returns correctly' do
80
+ @p.assemble_pairs.run(input: @input, output: @output2)
81
+ expected = <<-EXP.gsub(/\s+\|/, '')
82
+ |{:SEQ_NAME=>"test1/1:overlap=7:hamming=0",
83
+ | :SEQ=>"aaaaaaaaGAGTCATaaaaaaaa",
84
+ | :SEQ_LEN=>23,
85
+ | :SCORES=>"IIIIIIII5555555!!!!!!!!",
86
+ | :OVERLAP_LEN=>7,
87
+ | :HAMMING_DIST=>0}
88
+ |{:SEQ_NAME=>"test2/1:overlap=3:hamming=1",
89
+ | :SEQ=>"aaaaaaaagaggCAGtcataaaaaaaa",
90
+ | :SEQ_LEN=>27,
91
+ | :SCORES=>"IIIIIIIIIIII555!!!!!!!!!!!!",
92
+ | :OVERLAP_LEN=>3,
93
+ | :HAMMING_DIST=>1}
94
+ |{:SEQ_NAME=>"test3/1:overlap=1:hamming=0",
95
+ | :SEQ=>"aaaaaaaagagtcaTtttttttatgactc",
96
+ | :SEQ_LEN=>29,
97
+ | :SCORES=>"IIIIIIIIIIIIII5!!!!!!!!!!!!!!",
98
+ | :OVERLAP_LEN=>1,
99
+ | :HAMMING_DIST=>0}
100
+ |{:FOO=>"SEQ"}
101
+ EXP
102
+
103
+ assert_equal(expected.delete("\n"), collect_result.delete("\n"))
104
+ end
105
+
106
+ test 'BioDSL::Pipeline::AssemblePairs status returns correctly' do
107
+ @p.assemble_pairs.run(input: @input, output: @output2)
108
+
109
+ assert_equal(10, @p.status.first[:records_in])
110
+ assert_equal(4, @p.status.first[:records_out])
111
+ assert_equal(8, @p.status.first[:sequences_in])
112
+ assert_equal(8, @p.status.first[:sequences_in])
113
+ assert_equal(120, @p.status.first[:residues_in])
114
+ assert_equal(120, @p.status.first[:residues_in])
115
+ end
116
+
117
+ test 'BioDSL::Pipeline::AssemblePairs with merge_unassembled: true ' \
118
+ 'returns correctly' do
119
+ @p.assemble_pairs(merge_unassembled: true).
120
+ run(input: @input, output: @output2)
121
+ expected = <<-EXP.gsub(/\s+\|/, '')
122
+ |{:SEQ_NAME=>"test1/1:overlap=7:hamming=0",
123
+ | :SEQ=>"aaaaaaaaGAGTCATaaaaaaaa",
124
+ | :SEQ_LEN=>23,
125
+ | :SCORES=>"IIIIIIII5555555!!!!!!!!",
126
+ | :OVERLAP_LEN=>7,
127
+ | :HAMMING_DIST=>0}
128
+ |{:SEQ_NAME=>"test2/1:overlap=3:hamming=1",
129
+ | :SEQ=>"aaaaaaaagaggCAGtcataaaaaaaa",
130
+ | :SEQ_LEN=>27,
131
+ | :SCORES=>"IIIIIIIIIIII555!!!!!!!!!!!!",
132
+ | :OVERLAP_LEN=>3, :HAMMING_DIST=>1}
133
+ |{:SEQ_NAME=>"test3/1:overlap=1:hamming=0",
134
+ | :SEQ=>"aaaaaaaagagtcaTtttttttatgactc",
135
+ | :SEQ_LEN=>29,
136
+ | :SCORES=>"IIIIIIIIIIIIII5!!!!!!!!!!!!!!",
137
+ | :OVERLAP_LEN=>1,
138
+ | :HAMMING_DIST=>0}
139
+ |{:SEQ_NAME=>"test4/1",
140
+ | :SEQ=>"aaaaaaaaaaaaaaaggggggggggggggg",
141
+ | :SEQ_LEN=>30,
142
+ | :SCORES=>"IIIIIIIIIIIIIII!!!!!!!!!!!!!!!",
143
+ | :OVERLAP_LEN=>0,
144
+ | :HAMMING_DIST=>30}
145
+ |{:FOO=>"SEQ"}
146
+ EXP
147
+
148
+ assert_equal(expected.delete("\n"), collect_result.delete("\n"))
149
+ end
150
+
151
+ test 'BioDSL::Pipeline::AssemblePairs with :mismatch_percent returns OK' do
152
+ @p.assemble_pairs(mismatch_percent: 0).run(input: @input, output: @output2)
153
+ expected = <<-EXP.gsub(/\s+\|/, '')
154
+ |{:SEQ_NAME=>"test1/1:overlap=7:hamming=0",
155
+ | :SEQ=>"aaaaaaaaGAGTCATaaaaaaaa",
156
+ | :SEQ_LEN=>23,
157
+ | :SCORES=>"IIIIIIII5555555!!!!!!!!",
158
+ | :OVERLAP_LEN=>7,
159
+ | :HAMMING_DIST=>0}
160
+ |{:SEQ_NAME=>"test2/1:overlap=1:hamming=0",
161
+ | :SEQ=>"aaaaaaaagaggcaGagtcataaaaaaaa",
162
+ | :SEQ_LEN=>29,
163
+ | :SCORES=>"IIIIIIIIIIIIII5!!!!!!!!!!!!!!",
164
+ | :OVERLAP_LEN=>1,
165
+ | :HAMMING_DIST=>0}
166
+ |{:SEQ_NAME=>"test3/1:overlap=1:hamming=0",
167
+ | :SEQ=>"aaaaaaaagagtcaTtttttttatgactc",
168
+ | :SEQ_LEN=>29,
169
+ | :SCORES=>"IIIIIIIIIIIIII5!!!!!!!!!!!!!!",
170
+ | :OVERLAP_LEN=>1,
171
+ | :HAMMING_DIST=>0}
172
+ |{:FOO=>"SEQ"}
173
+ EXP
174
+
175
+ assert_equal(expected.delete("\n"), collect_result.delete("\n"))
176
+ end
177
+
178
+ test 'BioDSL::Pipeline::AssemblePairs with :overlap_min returns OK' do
179
+ @p.assemble_pairs(overlap_min: 5).run(input: @input, output: @output2)
180
+ expected = <<-EXP.gsub(/\s+\|/, '')
181
+ |{:SEQ_NAME=>"test1/1:overlap=7:hamming=0",
182
+ | :SEQ=>"aaaaaaaaGAGTCATaaaaaaaa",
183
+ | :SEQ_LEN=>23,
184
+ | :SCORES=>"IIIIIIII5555555!!!!!!!!",
185
+ | :OVERLAP_LEN=>7,
186
+ | :HAMMING_DIST=>0}
187
+ |{:FOO=>"SEQ"}
188
+ EXP
189
+
190
+ assert_equal(expected.delete("\n"), collect_result.delete("\n"))
191
+ end
192
+
193
+ test 'BioDSL::Pipeline::AssemblePairs with :overlap_min and ' \
194
+ 'merge_unassembled: true returns correctly' do
195
+ @p.assemble_pairs(overlap_min: 5, merge_unassembled: true).
196
+ run(input: @input, output: @output2)
197
+ expected = <<-EXP.gsub(/\s+\|/, '')
198
+ |{:SEQ_NAME=>"test1/1:overlap=7:hamming=0",
199
+ | :SEQ=>"aaaaaaaaGAGTCATaaaaaaaa",
200
+ | :SEQ_LEN=>23, :SCORES=>"IIIIIIII5555555!!!!!!!!",
201
+ | :OVERLAP_LEN=>7,
202
+ | :HAMMING_DIST=>0}
203
+ |{:SEQ_NAME=>"test2/1",
204
+ | :SEQ=>"aaaaaaaagagGcaGgagtcataaaaaaaa",
205
+ | :SEQ_LEN=>30,
206
+ | :SCORES=>"IIIIIIIIIIIIIII!!!!!!!!!!!!!!!",
207
+ | :OVERLAP_LEN=>0,
208
+ | :HAMMING_DIST=>30}
209
+ |{:SEQ_NAME=>"test3/1",
210
+ | :SEQ=>"aaaaaaaagagtcatttttttttatgactc",
211
+ | :SEQ_LEN=>30,
212
+ | :SCORES=>"IIIIIIIIIIIIIII!!!!!!!!!!!!!!!",
213
+ | :OVERLAP_LEN=>0,
214
+ | :HAMMING_DIST=>30}
215
+ |{:SEQ_NAME=>"test4/1",
216
+ | :SEQ=>"aaaaaaaaaaaaaaaggggggggggggggg",
217
+ | :SEQ_LEN=>30,
218
+ | :SCORES=>"IIIIIIIIIIIIIII!!!!!!!!!!!!!!!",
219
+ | :OVERLAP_LEN=>0,
220
+ | :HAMMING_DIST=>30}
221
+ |{:FOO=>"SEQ"}
222
+ EXP
223
+
224
+ assert_equal(expected.delete("\n"), collect_result.delete("\n"))
225
+ end
226
+
227
+ test 'BioDSL::Pipeline::AssemblePairs with :overlap_max returns OK' do
228
+ @p.assemble_pairs(overlap_max: 5).run(input: @input, output: @output2)
229
+ expected = <<-EXP.gsub(/\s+\|/, '')
230
+ |{:SEQ_NAME=>"test2/1:overlap=3:hamming=1",
231
+ | :SEQ=>"aaaaaaaagaggCAGtcataaaaaaaa",
232
+ | :SEQ_LEN=>27,
233
+ | :SCORES=>"IIIIIIIIIIII555!!!!!!!!!!!!",
234
+ | :OVERLAP_LEN=>3,
235
+ | :HAMMING_DIST=>1}
236
+ |{:SEQ_NAME=>"test3/1:overlap=1:hamming=0",
237
+ | :SEQ=>"aaaaaaaagagtcaTtttttttatgactc",
238
+ | :SEQ_LEN=>29,
239
+ | :SCORES=>"IIIIIIIIIIIIII5!!!!!!!!!!!!!!",
240
+ | :OVERLAP_LEN=>1,
241
+ | :HAMMING_DIST=>0}
242
+ |{:FOO=>"SEQ"}
243
+ EXP
244
+
245
+ assert_equal(expected.delete("\n"), collect_result.delete("\n"))
246
+ end
247
+
248
+ test 'BioDSL::Pipeline::AssemblePairs with :reverse_complement ' \
249
+ 'returns correctly' do
250
+ @p.assemble_pairs(reverse_complement: true).
251
+ run(input: @input, output: @output2)
252
+ expected = <<-EXP.gsub(/\s+\|/, '')
253
+ |{:SEQ_NAME=>"test1/1:overlap=1:hamming=0",
254
+ | :SEQ=>"aaaaaaaagagtcaTtttttttatgactc",
255
+ | :SEQ_LEN=>29,
256
+ | :SCORES=>"IIIIIIIIIIIIII5!!!!!!!!!!!!!!",
257
+ | :OVERLAP_LEN=>1,
258
+ | :HAMMING_DIST=>0}
259
+ |{:SEQ_NAME=>"test3/1:overlap=7:hamming=0",
260
+ | :SEQ=>"aaaaaaaaGAGTCATaaaaaaaa",
261
+ | :SEQ_LEN=>23,
262
+ | :SCORES=>"IIIIIIII5555555!!!!!!!!",
263
+ | :OVERLAP_LEN=>7,
264
+ | :HAMMING_DIST=>0}
265
+ |{:FOO=>"SEQ"}
266
+ EXP
267
+
268
+ assert_equal(expected.delete("\n"), collect_result.delete("\n"))
269
+ end
270
+
271
+ test 'BioDSL::Pipeline::AssemblePairs with :reverse_complement and ' \
272
+ ':overlap_min returns correctly' do
273
+ @p.assemble_pairs(reverse_complement: true, overlap_min: 5).
274
+ run(input: @input, output: @output2)
275
+ expected = <<-EXP.gsub(/\s+\|/, '')
276
+ |{:SEQ_NAME=>"test3/1:overlap=7:hamming=0",
277
+ | :SEQ=>"aaaaaaaaGAGTCATaaaaaaaa",
278
+ | :SEQ_LEN=>23,
279
+ | :SCORES=>"IIIIIIII5555555!!!!!!!!",
280
+ | :OVERLAP_LEN=>7,
281
+ | :HAMMING_DIST=>0}
282
+ |{:FOO=>"SEQ"}
283
+ EXP
284
+
285
+ assert_equal(expected.delete("\n"), collect_result.delete("\n"))
286
+ end
287
+
288
+ test 'BioDSL::Pipeline::AssemblePairs with :reverse_complement and ' \
289
+ 'overlap_max returns correctly' do
290
+ @p.assemble_pairs(reverse_complement: true, overlap_max: 5).
291
+ run(input: @input, output: @output2)
292
+ expected = <<-EXP.gsub(/\s+\|/, '')
293
+ |{:SEQ_NAME=>"test1/1:overlap=1:hamming=0",
294
+ | :SEQ=>"aaaaaaaagagtcaTtttttttatgactc",
295
+ | :SEQ_LEN=>29,
296
+ | :SCORES=>"IIIIIIIIIIIIII5!!!!!!!!!!!!!!",
297
+ | :OVERLAP_LEN=>1,
298
+ | :HAMMING_DIST=>0}
299
+ |{:FOO=>"SEQ"}
300
+ EXP
301
+
302
+ assert_equal(expected.delete("\n"), collect_result.delete("\n"))
303
+ end
304
+
305
+ test 'BioDSL::Pipeline::AssemblePairs with :reverse_complement and ' \
306
+ ':overlap_min and :merge_unassembled returns correctly' do
307
+ @p.assemble_pairs(reverse_complement: true,
308
+ overlap_min: 5, merge_unassembled: true)
309
+ @p.run(input: @input, output: @output2)
310
+ expected = <<-EXP.gsub(/\s+\|/, '')
311
+ |{:SEQ_NAME=>"test1/1",
312
+ | :SEQ=>"aaaaaaaagagtcatttttttttatgactc",
313
+ | :SEQ_LEN=>30,
314
+ | :SCORES=>"IIIIIIIIIIIIIII!!!!!!!!!!!!!!!",
315
+ | :OVERLAP_LEN=>0,
316
+ | :HAMMING_DIST=>30}
317
+ |{:SEQ_NAME=>"test2/1",
318
+ | :SEQ=>"aaaaaaaagagGcaGttttttttatgactc",
319
+ | :SEQ_LEN=>30,
320
+ | :SCORES=>"IIIIIIIIIIIIIII!!!!!!!!!!!!!!!",
321
+ | :OVERLAP_LEN=>0,
322
+ | :HAMMING_DIST=>30}
323
+ |{:SEQ_NAME=>"test3/1:overlap=7:hamming=0",
324
+ | :SEQ=>"aaaaaaaaGAGTCATaaaaaaaa",
325
+ | :SEQ_LEN=>23,
326
+ | :SCORES=>"IIIIIIII5555555!!!!!!!!",
327
+ | :OVERLAP_LEN=>7,
328
+ | :HAMMING_DIST=>0}
329
+ |{:SEQ_NAME=>"test4/1",
330
+ | :SEQ=>"aaaaaaaaaaaaaaaccccccccccccccc",
331
+ | :SEQ_LEN=>30,
332
+ | :SCORES=>"IIIIIIIIIIIIIII!!!!!!!!!!!!!!!",
333
+ | :OVERLAP_LEN=>0,
334
+ | :HAMMING_DIST=>30}
335
+ |{:FOO=>"SEQ"}
336
+ EXP
337
+
338
+ assert_equal(expected.delete("\n"), collect_result.delete("\n"))
339
+ end
340
+
341
+ test 'BioDSL::Pipeline::AssemblePairs with allow_unassembled returns OK' do
342
+ @p.assemble_pairs(overlap_min: 100, allow_unassembled: true).
343
+ run(input: @input, output: @output2)
344
+ expected = <<-EXP.gsub(/\s+\|/, '')
345
+ |{:SEQ_NAME=>"test1/1",
346
+ | :SEQ=>"aaaaaaaagagtcat",
347
+ | :SEQ_LEN=>15,
348
+ | :SCORES=>"IIIIIIIIIIIIIII",
349
+ | :OVERLAP_LEN=>0,
350
+ | :HAMMING_DIST=>15}
351
+ |{:SEQ_NAME=>"test1/2",
352
+ | :SEQ=>"gagtcataaaaaaaa",
353
+ | :SEQ_LEN=>15,
354
+ | :SCORES=>"!!!!!!!!!!!!!!!",
355
+ | :OVERLAP_LEN=>0,
356
+ | :HAMMING_DIST=>15}
357
+ |{:SEQ_NAME=>"test2/1",
358
+ | :SEQ=>"aaaaaaaagagGcaG",
359
+ | :SEQ_LEN=>15,
360
+ | :SCORES=>"IIIIIIIIIIIIIII",
361
+ | :OVERLAP_LEN=>0,
362
+ | :HAMMING_DIST=>15}
363
+ |{:SEQ_NAME=>"test2/2",
364
+ | :SEQ=>"gagtcataaaaaaaa",
365
+ | :SEQ_LEN=>15,
366
+ | :SCORES=>"!!!!!!!!!!!!!!!",
367
+ | :OVERLAP_LEN=>0,
368
+ | :HAMMING_DIST=>15}
369
+ |{:SEQ_NAME=>"test3/1",
370
+ | :SEQ=>"aaaaaaaagagtcat",
371
+ | :SEQ_LEN=>15,
372
+ | :SCORES=>"IIIIIIIIIIIIIII",
373
+ | :OVERLAP_LEN=>0,
374
+ | :HAMMING_DIST=>15}
375
+ |{:SEQ_NAME=>"test3/2",
376
+ | :SEQ=>"ttttttttatgactc",
377
+ | :SEQ_LEN=>15,
378
+ | :SCORES=>"!!!!!!!!!!!!!!!",
379
+ | :OVERLAP_LEN=>0,
380
+ | :HAMMING_DIST=>15}
381
+ |{:SEQ_NAME=>"test4/1",
382
+ | :SEQ=>"aaaaaaaaaaaaaaa",
383
+ | :SEQ_LEN=>15,
384
+ | :SCORES=>"IIIIIIIIIIIIIII",
385
+ | :OVERLAP_LEN=>0,
386
+ | :HAMMING_DIST=>15}
387
+ |{:SEQ_NAME=>"test4/2",
388
+ | :SEQ=>"ggggggggggggggg",
389
+ | :SEQ_LEN=>15,
390
+ | :SCORES=>"!!!!!!!!!!!!!!!",
391
+ | :OVERLAP_LEN=>0,
392
+ | :HAMMING_DIST=>15}
393
+ |{:FOO=>"SEQ"}
394
+ EXP
395
+
396
+ assert_equal(expected.delete("\n"), collect_result.delete("\n"))
397
+ end
398
+
399
+ test 'BioDSL::Pipeline::AssemblePairs with allow_unassembled and ' \
400
+ 'reverse_complement returns OK' do
401
+ @p.assemble_pairs(overlap_min: 100, allow_unassembled: true,
402
+ reverse_complement: true)
403
+ @p.run(input: @input, output: @output2)
404
+
405
+ expected = <<-EXP.gsub(/\s+\|/, '')
406
+ |{:SEQ_NAME=>"test1/1",
407
+ | :SEQ=>"aaaaaaaagagtcat",
408
+ | :SEQ_LEN=>15,
409
+ | :SCORES=>"IIIIIIIIIIIIIII",
410
+ | :OVERLAP_LEN=>0,
411
+ | :HAMMING_DIST=>15}
412
+ |{:SEQ_NAME=>"test1/2",
413
+ | :SEQ=>"ttttttttatgactc",
414
+ | :SEQ_LEN=>15,
415
+ | :SCORES=>"!!!!!!!!!!!!!!!",
416
+ | :OVERLAP_LEN=>0,
417
+ | :HAMMING_DIST=>15}
418
+ |{:SEQ_NAME=>"test2/1",
419
+ | :SEQ=>"aaaaaaaagagGcaG",
420
+ | :SEQ_LEN=>15,
421
+ | :SCORES=>"IIIIIIIIIIIIIII",
422
+ | :OVERLAP_LEN=>0,
423
+ | :HAMMING_DIST=>15}
424
+ |{:SEQ_NAME=>"test2/2",
425
+ | :SEQ=>"ttttttttatgactc",
426
+ | :SEQ_LEN=>15,
427
+ | :SCORES=>"!!!!!!!!!!!!!!!",
428
+ | :OVERLAP_LEN=>0,
429
+ | :HAMMING_DIST=>15}
430
+ |{:SEQ_NAME=>"test3/1",
431
+ | :SEQ=>"aaaaaaaagagtcat",
432
+ | :SEQ_LEN=>15,
433
+ | :SCORES=>"IIIIIIIIIIIIIII",
434
+ | :OVERLAP_LEN=>0,
435
+ | :HAMMING_DIST=>15}
436
+ |{:SEQ_NAME=>"test3/2",
437
+ | :SEQ=>"gagtcataaaaaaaa",
438
+ | :SEQ_LEN=>15,
439
+ | :SCORES=>"!!!!!!!!!!!!!!!",
440
+ | :OVERLAP_LEN=>0,
441
+ | :HAMMING_DIST=>15}
442
+ |{:SEQ_NAME=>"test4/1",
443
+ | :SEQ=>"aaaaaaaaaaaaaaa",
444
+ | :SEQ_LEN=>15,
445
+ | :SCORES=>"IIIIIIIIIIIIIII",
446
+ | :OVERLAP_LEN=>0,
447
+ | :HAMMING_DIST=>15}
448
+ |{:SEQ_NAME=>"test4/2",
449
+ | :SEQ=>"ccccccccccccccc",
450
+ | :SEQ_LEN=>15,
451
+ | :SCORES=>"!!!!!!!!!!!!!!!",
452
+ | :OVERLAP_LEN=>0,
453
+ | :HAMMING_DIST=>15}
454
+ |{:FOO=>"SEQ"}
455
+ EXP
456
+
457
+ assert_equal(expected.delete("\n"), collect_result.delete("\n"))
458
+ end
459
+ end
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
3
+
4
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
5
+ # #
6
+ # Copyright (C) 2007-2015 Martin Asser Hansen (mail@maasha.dk). #
7
+ # #
8
+ # This program is free software; you can redistribute it and/or #
9
+ # modify it under the terms of the GNU General Public License #
10
+ # as published by the Free Software Foundation; either version 2 #
11
+ # of the License, or (at your option) any later version. #
12
+ # #
13
+ # This program is distributed in the hope that it will be useful, #
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16
+ # GNU General Public License for more details. #
17
+ # #
18
+ # You should have received a copy of the GNU General Public License #
19
+ # along with this program; if not, write to the Free Software #
20
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, #
21
+ # USA. #
22
+ # #
23
+ # http://www.gnu.org/copyleft/gpl.html #
24
+ # #
25
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
26
+ # #
27
+ # This software is part of BioDSL (www.github.com/maasha/BioDSL). #
28
+ # #
29
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
30
+
31
+ require 'test/helper'
32
+
33
+ # Test class for AssembleSeqIdba.
34
+ class TestAssembleSeqIdba < Test::Unit::TestCase
35
+ def setup
36
+ omit('idba_ud not found') unless BioDSL::Filesys.which('idba_ud')
37
+
38
+ @p = BioDSL::Pipeline.new
39
+ end
40
+
41
+ test 'BioDSL::Pipeline::AssembleSeqIdba with invalid options raises' do
42
+ assert_raise(BioDSL::OptionError) { @p.assemble_seq_idba(foo: 'bar') }
43
+ end
44
+
45
+ test 'BioDSL::Pipeline::AssembleSeqIdba with valid options don\'t raise' do
46
+ assert_nothing_raised { @p.assemble_seq_idba(cpus: 1) }
47
+ end
48
+
49
+ # FIXME: tests missing!
50
+ end
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
3
+
4
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
5
+ # #
6
+ # Copyright (C) 2007-2015 Martin Asser Hansen (mail@maasha.dk). #
7
+ # #
8
+ # This program is free software; you can redistribute it and/or #
9
+ # modify it under the terms of the GNU General Public License #
10
+ # as published by the Free Software Foundation; either version 2 #
11
+ # of the License, or (at your option) any later version. #
12
+ # #
13
+ # This program is distributed in the hope that it will be useful, #
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16
+ # GNU General Public License for more details. #
17
+ # #
18
+ # You should have received a copy of the GNU General Public License #
19
+ # along with this program; if not, write to the Free Software #
20
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, #
21
+ # USA. #
22
+ # #
23
+ # http://www.gnu.org/copyleft/gpl.html #
24
+ # #
25
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
26
+ # #
27
+ # This software is part of BioDSL (www.github.com/maasha/BioDSL). #
28
+ # #
29
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
30
+
31
+ require 'test/helper'
32
+
33
+ # Test class for AssembleSeqRay.
34
+ class TestAssembleSeqRay < Test::Unit::TestCase
35
+ def setup
36
+ omit('ray not found') unless BioDSL::Filesys.which('ray')
37
+ omit('mpiexec not found') unless BioDSL::Filesys.which('mpiexec')
38
+
39
+ @p = BioDSL::Pipeline.new
40
+ end
41
+
42
+ test 'BioDSL::Pipeline::AssembleSeqRay with invalid options raises' do
43
+ assert_raise(BioDSL::OptionError) { @p.assemble_seq_ray(foo: 'bar') }
44
+ end
45
+
46
+ test 'BioDSL::Pipeline::AssembleSeqRay with valid options don\'t raise' do
47
+ assert_nothing_raised { @p.assemble_seq_ray(cpus: 1) }
48
+ end
49
+
50
+ # FIXME: tests missing!
51
+ end
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
3
+
4
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
5
+ # #
6
+ # Copyright (C) 2007-2015 Martin Asser Hansen (mail@maasha.dk). #
7
+ # #
8
+ # This program is free software; you can redistribute it and/or #
9
+ # modify it under the terms of the GNU General Public License #
10
+ # as published by the Free Software Foundation; either version 2 #
11
+ # of the License, or (at your option) any later version. #
12
+ # #
13
+ # This program is distributed in the hope that it will be useful, #
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16
+ # GNU General Public License for more details. #
17
+ # #
18
+ # You should have received a copy of the GNU General Public License #
19
+ # along with this program; if not, write to the Free Software #
20
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, #
21
+ # USA. #
22
+ # #
23
+ # http://www.gnu.org/copyleft/gpl.html #
24
+ # #
25
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
26
+ # #
27
+ # This software is part of BioDSL (www.github.com/maasha/BioDSL). #
28
+ # #
29
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
30
+
31
+ require 'test/helper'
32
+
33
+ # Test class for AssembleSeqSpandes.
34
+ class TestAssembleSeqSpades < Test::Unit::TestCase
35
+ def setup
36
+ omit('spades.py not found') unless BioDSL::Filesys.which('spades.py')
37
+
38
+ @p = BioDSL::Pipeline.new
39
+ end
40
+
41
+ test 'BioDSL::Pipeline::AssembleSeqSpades with invalid options raises' do
42
+ assert_raise(BioDSL::OptionError) { @p.assemble_seq_spades(foo: 'bar') }
43
+ end
44
+
45
+ test 'BioDSL::Pipeline::AssembleSeqSpades with OK options dont raise' do
46
+ assert_nothing_raised { @p.assemble_seq_spades(cpus: 1) }
47
+ end
48
+
49
+ # TODO: Fix missing testing here!
50
+ end
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
3
+
4
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
5
+ # #
6
+ # Copyright (C) 2007-2015 Martin Asser Hansen (mail@maasha.dk). #
7
+ # #
8
+ # This program is free software; you can redistribute it and/or #
9
+ # modify it under the terms of the GNU General Public License #
10
+ # as published by the Free Software Foundation; either version 2 #
11
+ # of the License, or (at your option) any later version. #
12
+ # #
13
+ # This program is distributed in the hope that it will be useful, #
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16
+ # GNU General Public License for more details. #
17
+ # #
18
+ # You should have received a copy of the GNU General Public License #
19
+ # along with this program; if not, write to the Free Software #
20
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, #
21
+ # USA. #
22
+ # #
23
+ # http://www.gnu.org/copyleft/gpl.html #
24
+ # #
25
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
26
+ # #
27
+ # This software is part of BioDSL (www.github.com/maasha/BioDSL). #
28
+ # #
29
+ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
30
+
31
+ require 'test/helper'
32
+
33
+ # Test class for ClassifySeq.
34
+ class TestClassifySeq < Test::Unit::TestCase
35
+ def setup
36
+ @p = BP.new
37
+ end
38
+
39
+ test 'BioDSL::Pipeline#classify_seq with disallowed option raises' do
40
+ assert_raise(BioDSL::OptionError) do
41
+ @p.classify_seq(dir: Dir.pwd, foo: 'bar')
42
+ end
43
+ end
44
+
45
+ test 'BioDSL::Pipeline#classify_seq with allowed option dont raise' do
46
+ assert_nothing_raised { @p.classify_seq(dir: Dir.pwd) }
47
+ end
48
+
49
+ # TODO: write tests!
50
+ end