genevalidator 1.6.12 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +30 -1
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +13 -12
  5. data/Gemfile +4 -1
  6. data/Gemfile.lock +135 -0
  7. data/README.md +104 -122
  8. data/Rakefile +377 -5
  9. data/aux/gv_results.slim +155 -0
  10. data/aux/html_files/css/gv.compiled.min.css +8 -0
  11. data/aux/{files → html_files}/css/src/bootstrap.min.css +0 -0
  12. data/aux/{files → html_files}/css/src/font-awesome.min.css +0 -0
  13. data/aux/{files → html_files}/css/src/style.css +0 -0
  14. data/aux/{files → html_files}/fonts/FontAwesome.otf +0 -0
  15. data/aux/{files → html_files}/fonts/fontawesome-webfont.eot +0 -0
  16. data/aux/{files → html_files}/fonts/fontawesome-webfont.svg +0 -0
  17. data/aux/{files → html_files}/fonts/fontawesome-webfont.ttf +0 -0
  18. data/aux/{files → html_files}/fonts/fontawesome-webfont.woff +0 -0
  19. data/aux/{files → html_files}/img/gene.png +0 -0
  20. data/aux/html_files/js/gv.compiled.min.js +1 -0
  21. data/aux/{files → html_files}/js/src/bootstrap.min.js +0 -0
  22. data/aux/{files → html_files}/js/src/d3.v3.min.js +0 -0
  23. data/aux/{files → html_files}/js/src/jquery-2.1.1.min.js +0 -0
  24. data/aux/{files → html_files}/js/src/jquery.tablesorter.min.js +0 -0
  25. data/aux/{files → html_files}/js/src/plots.js +1 -1
  26. data/aux/{files → html_files}/js/src/script.js +0 -0
  27. data/aux/{files → html_files}/json/.gitkeep +0 -0
  28. data/bin/genevalidator +393 -56
  29. data/exemplar_data/README.md +60 -0
  30. data/{data/mrna_data.fasta → exemplar_data/mrna_data.fa} +1 -1
  31. data/{data/protein_data.fasta → exemplar_data/protein_data.fa} +0 -0
  32. data/genevalidator.gemspec +35 -20
  33. data/install.sh +92 -0
  34. data/lib/genevalidator.rb +171 -56
  35. data/lib/genevalidator/arg_validation.rb +26 -55
  36. data/lib/genevalidator/blast.rb +44 -99
  37. data/lib/genevalidator/clusterization.rb +18 -22
  38. data/lib/genevalidator/exceptions.rb +17 -17
  39. data/lib/genevalidator/ext/array.rb +21 -4
  40. data/lib/genevalidator/get_raw_sequences.rb +32 -31
  41. data/lib/genevalidator/hsp.rb +31 -2
  42. data/lib/genevalidator/json_to_gv_results.rb +38 -122
  43. data/lib/genevalidator/output.rb +158 -172
  44. data/lib/genevalidator/output_files.rb +134 -0
  45. data/lib/genevalidator/pool.rb +2 -5
  46. data/lib/genevalidator/query.rb +1 -1
  47. data/lib/genevalidator/tabular_parser.rb +8 -29
  48. data/lib/genevalidator/validation.rb +48 -90
  49. data/lib/genevalidator/validation_alignment.rb +64 -75
  50. data/lib/genevalidator/validation_blast_reading_frame.rb +13 -9
  51. data/lib/genevalidator/validation_duplication.rb +85 -84
  52. data/lib/genevalidator/validation_gene_merge.rb +46 -35
  53. data/lib/genevalidator/validation_length_cluster.rb +18 -15
  54. data/lib/genevalidator/validation_length_rank.rb +19 -15
  55. data/lib/genevalidator/validation_maker_qi.rb +13 -12
  56. data/lib/genevalidator/validation_open_reading_frame.rb +16 -13
  57. data/lib/genevalidator/validation_report.rb +1 -1
  58. data/lib/genevalidator/validation_test.rb +1 -1
  59. data/lib/genevalidator/version.rb +1 -1
  60. data/test/overall.rb +1 -1
  61. data/test/test_all_validations.rb +36 -24
  62. data/test/test_blast.rb +39 -24
  63. data/test/test_clusterization_2d.rb +4 -4
  64. data/test/test_helper.rb +2 -2
  65. data/test/test_query.rb +16 -20
  66. data/test/test_validation_open_reading_frame.rb +122 -122
  67. data/test/test_validations.rb +12 -10
  68. metadata +94 -79
  69. data/aux/files/css/genevalidator.compiled.min.css +0 -16
  70. data/aux/files/js/genevalidator.compiled.min.js +0 -28
  71. data/aux/json_footer.erb +0 -8
  72. data/aux/json_header.erb +0 -19
  73. data/aux/json_query.erb +0 -15
  74. data/aux/template_footer.erb +0 -8
  75. data/aux/template_header.erb +0 -19
  76. data/aux/template_query.erb +0 -14
  77. data/data/README.md +0 -57
  78. data/data/mrna_data.fasta.blast_tabular +0 -3567
  79. data/data/mrna_data.fasta.blast_tabular.raw_seq +0 -53998
  80. data/data/mrna_data.fasta.blast_tabular.raw_seq.idx +0 -5440
  81. data/data/mrna_data.fasta.blast_xml +0 -39800
  82. data/data/mrna_data.fasta.blast_xml.raw_seq +0 -2554
  83. data/data/mrna_data.fasta.blast_xml.raw_seq.idx +0 -3127
  84. data/data/mrna_data.fasta.json +0 -1
  85. data/data/protein_data.fasta.blast_tabular +0 -3278
  86. data/data/protein_data.fasta.blast_tabular.raw_seq +0 -61295
  87. data/data/protein_data.fasta.blast_tabular.raw_seq.idx +0 -4438
  88. data/data/protein_data.fasta.blast_xml +0 -26228
  89. data/data/protein_data.fasta.blast_xml.raw_seq +0 -9803
  90. data/data/protein_data.fasta.blast_xml.raw_seq.idx +0 -1777
  91. data/data/protein_data.fasta.json +0 -1
@@ -15,7 +15,9 @@ module GeneValidator
15
15
 
16
16
  def initialize(short_header, header, description, query_length, limits,
17
17
  expected = :yes)
18
- @short_header, @header, @description = short_header, header, description
18
+ @short_header = short_header
19
+ @header = header
20
+ @description = description
19
21
  @limits = limits
20
22
  @query_length = query_length
21
23
  @expected = expected
@@ -32,7 +34,7 @@ module GeneValidator
32
34
  end
33
35
 
34
36
  def explain
35
- diff = (@result == :yes) ? 'inside' : 'outside'
37
+ diff = @result == :yes ? 'inside' : 'outside'
36
38
  'The most dense length-cluster of BLAST hits includes' \
37
39
  " sequences that are from #{@limits[0]} to #{@limits[1]} amino-acids" \
38
40
  " long. The query sequence is #{@query_length} amino-acids long and" \
@@ -44,7 +46,7 @@ module GeneValidator
44
46
  'There is no reason to believe there is any problem with the length' \
45
47
  ' of the query sequence.'
46
48
  else
47
- size_diff = (@query_length > @limits[1]) ? 'long' : 'short'
49
+ size_diff = @query_length > @limits[1] ? 'long' : 'short'
48
50
  "This suggests that the query sequence may be too #{size_diff}."
49
51
  end
50
52
  end
@@ -67,6 +69,9 @@ module GeneValidator
67
69
  # This class contains the methods necessary for
68
70
  # length validation by hit length clusterization
69
71
  class LengthClusterValidation < ValidationTest
72
+ extend Forwardable
73
+ def_delegators GeneValidator, :opt
74
+
70
75
  attr_reader :clusters
71
76
  attr_reader :max_density_cluster
72
77
 
@@ -96,8 +101,8 @@ module GeneValidator
96
101
  # Output:
97
102
  # +LengthClusterValidationOutput+ object
98
103
  def run
99
- fail NotEnoughHitsError unless hits.length >= 5
100
- fail unless prediction.is_a?(Query) && hits[0].is_a?(Query)
104
+ raise NotEnoughHitsError if hits.length < opt[:min_blast_hits]
105
+ raise unless prediction.is_a?(Query) && hits[0].is_a?(Query)
101
106
 
102
107
  start = Time.now
103
108
  # get [clusters, max_density_cluster_idx]
@@ -119,12 +124,11 @@ module GeneValidator
119
124
  @validation_report.run_time = Time.now - start
120
125
 
121
126
  @validation_report
122
-
123
127
  rescue NotEnoughHitsError
124
128
  @validation_report = ValidationReport.new('Not enough evidence', :warning,
125
129
  @short_header, @header,
126
130
  @description)
127
- rescue
131
+ rescue StandardError
128
132
  @validation_report = ValidationReport.new('Unexpected error', :error,
129
133
  @short_header, @header,
130
134
  @description)
@@ -143,7 +147,7 @@ module GeneValidator
143
147
  def clusterization_by_length(_debug = false,
144
148
  lst = @hits,
145
149
  predicted_seq = @prediction)
146
- fail TypeError unless lst[0].is_a?(Query) && predicted_seq.is_a?(Query)
150
+ raise TypeError unless lst[0].is_a?(Query) && predicted_seq.is_a?(Query)
147
151
 
148
152
  contents = lst.map { |x| x.length_protein.to_i }.sort { |a, b| a <=> b }
149
153
 
@@ -159,11 +163,10 @@ module GeneValidator
159
163
  end
160
164
 
161
165
  [clusters, max_density_cluster_idx]
162
-
163
166
  rescue TypeError => error
164
167
  error_location = error.backtrace[0].scan(%r{([^/]+:\d+):.*})[0][0]
165
- $stderr.puts "Type error at #{error_location}."
166
- $stderr.puts ' Possible cause: one of the arguments of the' \
168
+ warn "Type error at #{error_location}."
169
+ warn ' Possible cause: one of the arguments of the' \
167
170
  ' "clusterization_by_length" method has not the proper type.'
168
171
  exit 1
169
172
  end
@@ -181,11 +184,11 @@ module GeneValidator
181
184
  max_density_cluster = @max_density_cluster,
182
185
  prediction = @prediction)
183
186
 
184
- data = clusters.each_with_index.map { |cluster, i|
185
- cluster.lengths.collect { |k, v|
187
+ data = clusters.each_with_index.map do |cluster, i|
188
+ cluster.lengths.collect do |k, v|
186
189
  { 'key' => k, 'value' => v, 'main' => (i == max_density_cluster) }
187
- }
188
- }
190
+ end
191
+ end
189
192
 
190
193
  Plot.new(data,
191
194
  :bars,
@@ -23,7 +23,9 @@ module GeneValidator
23
23
  def initialize(short_header, header, description, msg, query_length,
24
24
  no_of_hits, median, mean, smallest_hit, largest_hit,
25
25
  extreme_hits, percentage)
26
- @short_header, @header, @description = short_header, header, description
26
+ @short_header = short_header
27
+ @header = header
28
+ @description = description
27
29
  @msg = msg
28
30
  @query_length = query_length
29
31
  @no_of_hits = no_of_hits
@@ -44,17 +46,17 @@ module GeneValidator
44
46
  end
45
47
 
46
48
  def explain
47
- diff = (@query_length > @median) ? 'longer' : 'shorter'
49
+ diff = @query_length > @median ? 'longer' : 'shorter'
48
50
  exp1 = "The query sequence is #{@query_length} amino-acids long. BLAST" \
49
51
  " identified #{@no_of_hits} hit sequences with lengths from" \
50
52
  " #{@smallest_hit} to #{@largest_hit} amino-acids (median:" \
51
53
  " #{@median}; mean: #{@mean})."
52
- if @extreme_hits != 0
53
- exp2 = " #{@extreme_hits} of these hit sequences (i.e." \
54
- " #{@percentage}%) are #{diff} than the query sequence."
55
- else
56
- exp2 = " All hit sequences are #{diff} than the query sequence."
57
- end
54
+ exp2 = if @extreme_hits != 0
55
+ " #{@extreme_hits} of these hit sequences (i.e." \
56
+ " #{@percentage}%) are #{diff} than the query sequence."
57
+ else
58
+ " All hit sequences are #{diff} than the query sequence."
59
+ end
58
60
  exp1 + exp2
59
61
  end
60
62
 
@@ -68,11 +70,11 @@ module GeneValidator
68
70
  end
69
71
 
70
72
  def print
71
- (@msg.empty?) ? "#{@percentage}%" : "#{@percentage}%&nbsp;(#{@msg})"
73
+ @msg.empty? ? "#{@percentage}%" : "#{@percentage}%&nbsp;(#{@msg})"
72
74
  end
73
75
 
74
76
  def validation
75
- (@msg.empty?) ? :yes : :no
77
+ @msg.empty? ? :yes : :no
76
78
  end
77
79
  end
78
80
 
@@ -80,6 +82,9 @@ module GeneValidator
80
82
  # This class contains the methods necessary for
81
83
  # length validation by ranking the hit lengths
82
84
  class LengthRankValidation < ValidationTest
85
+ extend Forwardable
86
+ def_delegators GeneValidator, :opt
87
+
83
88
  THRESHOLD = 20
84
89
  ##
85
90
  # Initializes the object
@@ -104,13 +109,13 @@ module GeneValidator
104
109
  # Output:
105
110
  # +LengthRankValidationOutput+ object
106
111
  def run(hits = @hits, prediction = @prediction)
107
- fail NotEnoughHitsError unless hits.length >= 5
108
- fail unless prediction.is_a?(Query) && hits[0].is_a?(Query)
112
+ raise NotEnoughHitsError if hits.length < opt[:min_blast_hits]
113
+ raise unless prediction.is_a?(Query) && hits[0].is_a?(Query)
109
114
 
110
115
  start = Time.now
111
116
 
112
117
  hits_lengths = hits.map { |x| x.length_protein.to_i }
113
- .sort { |a, b| a <=> b }
118
+ .sort { |a, b| a <=> b }
114
119
 
115
120
  no_of_hits = hits_lengths.length
116
121
  median = hits_lengths.median.round
@@ -147,12 +152,11 @@ module GeneValidator
147
152
  percentage)
148
153
  @validation_report.run_time = Time.now - start
149
154
  @validation_report
150
-
151
155
  rescue NotEnoughHitsError
152
156
  @validation_report = ValidationReport.new('Not enough evidence', :warning,
153
157
  @short_header, @header,
154
158
  @description)
155
- rescue
159
+ rescue StandardError
156
160
  @validation_report = ValidationReport.new('Unexpected error', :error,
157
161
  @short_header, @header,
158
162
  @description)
@@ -10,7 +10,9 @@ module GeneValidator
10
10
  class MakerQIValidationOutput < ValidationReport
11
11
  def initialize(short_header, header, description, splice_sites, exons,
12
12
  expected = :yes)
13
- @short_header, @header, @description = short_header, header, description
13
+ @short_header = short_header
14
+ @header = header
15
+ @description = description
14
16
  @splice_sites = splice_sites
15
17
  @exons = exons
16
18
  @expected = expected
@@ -27,12 +29,12 @@ module GeneValidator
27
29
  def explain
28
30
  if @splice_sites == -100
29
31
  "#{@exons}% of exons match an EST/mRNA-seq alignment." \
30
- " No splice sites were identified and as such cannot be confirmed by" \
31
- " an EST/mRNA-seq alignment."
32
+ ' No splice sites were identified and as such cannot be confirmed by' \
33
+ ' an EST/mRNA-seq alignment.'
32
34
  else
33
35
  "#{@exons}% of exons match an EST/mRNA-seq alignment and" \
34
36
  " #{@splice_sites}% of splice sites are confirmed by EST/mRNA-seq" \
35
- " alignment."
37
+ ' alignment.'
36
38
  end
37
39
  end
38
40
 
@@ -54,7 +56,7 @@ module GeneValidator
54
56
  end
55
57
 
56
58
  def validation
57
- (@splice_sites > 80 && @exons > 80) ? :yes : :no
59
+ @splice_sites > 80 && @exons > 80 ? :yes : :no
58
60
  end
59
61
  end
60
62
 
@@ -77,7 +79,7 @@ module GeneValidator
77
79
  # Output:
78
80
  # +QIValidationOutput+ object
79
81
  def run
80
- fail unless prediction.is_a?(Query)
82
+ raise unless prediction.is_a?(Query)
81
83
 
82
84
  start = Time.now
83
85
 
@@ -87,7 +89,7 @@ module GeneValidator
87
89
  #{number}\|#{number}\|#{number}\|
88
90
  #{number}\|#{number}/x)
89
91
 
90
- fail NotEnoughEvidence if match.nil?
92
+ raise NotEnoughEvidence if match.nil?
91
93
 
92
94
  # % of splice sites confirmed by EST/mRNA-seq alignment
93
95
  splice_sites = (match[1].to_f * 100).round
@@ -99,12 +101,11 @@ module GeneValidator
99
101
  splice_sites, exons)
100
102
  @validation_report.run_time = Time.now - start
101
103
  @validation_report
102
-
103
104
  rescue NotEnoughEvidence
104
- @validation_report = ValidationReport.new('No MAKER Quality Index',
105
- :warning, @short_header,
106
- @header, @description)
107
- rescue
105
+ @validation_report = ValidationReport.new('No MAKER Quality Index',
106
+ :warning, @short_header,
107
+ @header, @description)
108
+ rescue StandardError
108
109
  @validation_report = ValidationReport.new('Unexpected error', :error,
109
110
  @short_header, @header,
110
111
  @description)
@@ -17,7 +17,9 @@ module GeneValidator
17
17
 
18
18
  def initialize(short_header, header, description, orfs, coverage,
19
19
  longest_orf_frame, threshold = 80, expected = :yes)
20
- @short_header, @header, @description = short_header, header, description
20
+ @short_header = short_header
21
+ @header = header
22
+ @description = description
21
23
 
22
24
  @orfs = orfs
23
25
  @coverage = coverage
@@ -28,9 +30,10 @@ module GeneValidator
28
30
  @mainORFFrame = longest_orf_frame
29
31
  @approach = 'We expect the query sequence to encode a single gene,' \
30
32
  ' thus it should contain one main Open Reading Frame' \
31
- ' (ORF) that occupies most of the query sequence.'
33
+ ' (ORF) that occupies most of the query sequence.' \
34
+ ' This validation does not require any BLAST hits.'
32
35
  @explanation = " The longest ORF is in frame #{@mainORFFrame}, where" \
33
- " it occupies #{(@coverage).round}% of the query" \
36
+ " it occupies #{@coverage.round}% of the query" \
34
37
  ' sequence.'
35
38
  @conclusion = conclude
36
39
  end
@@ -50,11 +53,11 @@ module GeneValidator
50
53
  orf_list = ''
51
54
  @orfs.map { |elem| orf_list << "#{elem[0]}:#{elem[1]}," }
52
55
 
53
- "#{(@coverage).round}%&nbsp;(frame&nbsp;#{@mainORFFrame})"
56
+ "#{@coverage.round}%&nbsp;(frame&nbsp;#{@mainORFFrame})"
54
57
  end
55
58
 
56
59
  def validation
57
- (@coverage > @threshold) ? :yes : :no
60
+ @coverage > @threshold ? :yes : :no
58
61
  end
59
62
  end
60
63
 
@@ -75,8 +78,8 @@ module GeneValidator
75
78
  @short_header = 'MainORF'
76
79
  @header = 'Main ORF'
77
80
  @description = 'Check whether there is a single main Open Reading' \
78
- ' Frame in the predicted gene. Applicable only for' \
79
- ' nucleotide queries.'
81
+ ' Frame in the predicted gene. This validation does not' \
82
+ ' require any BLAST hits.'
80
83
  @cli_name = 'orf'
81
84
  @type = config[:type]
82
85
  end
@@ -91,12 +94,12 @@ module GeneValidator
91
94
  return @validation_report
92
95
  end
93
96
 
94
- fail unless prediction.is_a?(Query)
97
+ raise unless prediction.is_a?(Query)
95
98
 
96
99
  start = Time.new
97
100
  orfs = get_orfs
98
101
 
99
- longest_orf = orfs.sort_by { |_key, hash| hash[:coverage] }.last
102
+ longest_orf = orfs.max_by { |_key, hash| hash[:coverage] }
100
103
  longest_orf_frame = longest_orf[1][:frame]
101
104
  coverage = longest_orf[1][:coverage]
102
105
  translated_length = longest_orf[1][:translated_length]
@@ -109,7 +112,7 @@ module GeneValidator
109
112
 
110
113
  @validation_report.plot_files.push(plot1)
111
114
  @validation_report
112
- rescue
115
+ rescue StandardError
113
116
  @validation_report = ValidationReport.new('Unexpected error', :error,
114
117
  @short_header, @header,
115
118
  @description)
@@ -137,8 +140,8 @@ module GeneValidator
137
140
  f = -2 if f == 5
138
141
  f = -3 if f == 6
139
142
  s.scan(/(\w{30,})/) do |_orf|
140
- orf_start = $~.offset(0)[0] + 1
141
- orf_end = $~.offset(0)[1] + 1
143
+ orf_start = $LAST_MATCH_INFO.offset(0)[0] + 1
144
+ orf_end = $LAST_MATCH_INFO.offset(0)[1] + 1
142
145
  coverage = (((orf_end - orf_start) / s.length.to_f) * 100).ceil
143
146
  # reduce the orf_end and the translated length by 2% to increase the
144
147
  # width between ORFs on the plot
@@ -161,7 +164,7 @@ module GeneValidator
161
164
  # +output+: location where the plot will be saved in jped file format
162
165
  # +prediction+: Sequence objects
163
166
  def plot_orfs(orfs, translated_length)
164
- fail QueryError unless orfs.is_a? Hash
167
+ raise QueryError unless orfs.is_a? Hash
165
168
 
166
169
  data = []
167
170
 
@@ -63,7 +63,7 @@ module GeneValidator
63
63
  elsif validation == :error || validation == :unapplicable
64
64
  'warning'
65
65
  else
66
- (validation == :warning) ? 'warning' : 'danger'
66
+ validation == :warning ? 'warning' : 'danger'
67
67
  end
68
68
  end
69
69
  end
@@ -36,7 +36,7 @@ module GeneValidator
36
36
  end
37
37
 
38
38
  def run
39
- fail 'run method should be implemented by all classes that extend' \
39
+ raise 'run method should be implemented by all classes that extend' \
40
40
  ' ValidationTest'
41
41
  end
42
42
  end
@@ -1,3 +1,3 @@
1
1
  module GeneValidator
2
- VERSION = '1.6.12'
2
+ VERSION = '2.1.3'.freeze
3
3
  end
@@ -53,4 +53,4 @@ def run(*cmds)
53
53
  end
54
54
 
55
55
  db = ENV['db'] || 'swissprot -remote'
56
- %w(data/protein_data.fasta data/mrna_data.fasta).each { |fa| test_with fa, db }
56
+ %w[data/protein_data.fasta data/mrna_data.fasta].each { |fa| test_with fa, db }
@@ -38,38 +38,45 @@ module GeneValidator
38
38
  original_stdout = $stdout.clone
39
39
  $stdout.reopen(prot_xml_out, 'w')
40
40
 
41
- FileUtils.rm_rf(prot_output_dir) rescue Errno::ENOENT
42
41
  opts = {
43
- validations: %w(lenc lenr frame merge dup orf align),
42
+ validations: %w[lenc lenr frame merge dup orf align],
44
43
  db: database,
45
44
  num_threads: threads,
46
- fast: false,
45
+ mafft_threads: 1,
47
46
  input_fasta_file: prot_input,
48
47
  blast_xml_file: prot_xml,
49
48
  raw_sequences: prot_raw,
50
- test: true
49
+ output_dir: prot_output_dir,
50
+ output_formats: %w[html csv json stdout],
51
+ min_blast_hits: 5,
52
+ test: true,
53
+ hide_summary: true,
54
+ force_rewrite: true
51
55
  }
52
56
 
53
- GeneValidator.init(opts, 1, false)
57
+ GeneValidator.init(opts)
54
58
  GeneValidator.run
55
59
  $stdout.reopen original_stdout
56
60
  $stdout.reopen(prot_tab_out, 'w')
57
61
 
58
- FileUtils.rm_rf(prot_output_dir) rescue Errno::ENOENT
59
-
60
62
  opts1 = {
61
- validations: %w(lenc lenr frame merge dup orf align),
63
+ validations: %w[lenc lenr frame merge dup orf align],
62
64
  db: database,
63
65
  num_threads: threads,
64
- fast: false,
66
+ mafft_threads: 1,
65
67
  input_fasta_file: prot_input,
66
68
  blast_tabular_file: prot_tab,
67
69
  blast_tabular_options: tab_options,
68
70
  raw_sequences: prot_raw,
69
- test: true
71
+ output_dir: prot_output_dir,
72
+ output_formats: %w[html csv json stdout],
73
+ min_blast_hits: 5,
74
+ test: true,
75
+ hide_summary: true,
76
+ force_rewrite: true
70
77
  }
71
78
 
72
- GeneValidator.init(opts1, 1, false)
79
+ GeneValidator.init(opts1, 1)
73
80
  GeneValidator.run
74
81
  $stdout.reopen original_stdout
75
82
 
@@ -77,7 +84,6 @@ module GeneValidator
77
84
 
78
85
  File.delete(prot_xml_out)
79
86
  File.delete(prot_tab_out)
80
- FileUtils.rm_rf(prot_output_dir)
81
87
 
82
88
  assert_equal(true, diff)
83
89
  end
@@ -88,39 +94,45 @@ module GeneValidator
88
94
  original_stdout = $stdout.clone
89
95
  $stdout.reopen(mrna_xml_out, 'w')
90
96
 
91
- FileUtils.rm_rf(mrna_output_dir) rescue Errno::ENOENT
92
-
93
97
  opts = {
94
- validations: %w(lenc lenr frame merge dup orf align),
98
+ validations: %w[lenc lenr frame merge dup orf align],
95
99
  db: database,
96
100
  num_threads: threads,
97
- fast: false,
101
+ mafft_threads: 1,
98
102
  input_fasta_file: mrna_input,
99
103
  blast_xml_file: mrna_xml,
100
104
  raw_sequences: mrna_raw,
101
- test: true
105
+ output_dir: mrna_output_dir,
106
+ output_formats: %w[html csv json stdout],
107
+ min_blast_hits: 5,
108
+ test: true,
109
+ hide_summary: true,
110
+ force_rewrite: true
102
111
  }
103
112
 
104
- GeneValidator.init(opts, 1, false)
113
+ GeneValidator.init(opts, 1)
105
114
  GeneValidator.run
106
115
  $stdout.reopen original_stdout
107
116
  $stdout.reopen(mrna_tab_out, 'w')
108
117
 
109
- FileUtils.rm_rf(mrna_output_dir) rescue Errno::ENOENT
110
-
111
118
  opts1 = {
112
- validations: %w(lenc lenr frame merge dup orf align),
119
+ validations: %w[lenc lenr frame merge dup orf align],
113
120
  db: database,
114
121
  num_threads: threads,
115
- fast: false,
122
+ mafft_threads: 1,
116
123
  input_fasta_file: mrna_input,
117
124
  blast_tabular_file: mrna_tab,
118
125
  blast_tabular_options: tab_options,
119
126
  raw_sequences: mrna_raw,
120
- test: true
127
+ output_dir: mrna_output_dir,
128
+ output_formats: %w[html csv json stdout],
129
+ min_blast_hits: 5,
130
+ test: true,
131
+ hide_summary: true,
132
+ force_rewrite: true
121
133
  }
122
134
 
123
- GeneValidator.init(opts1, 1, false)
135
+ GeneValidator.init(opts1, 1)
124
136
  GeneValidator.run
125
137
  $stdout.reopen original_stdout
126
138