genevalidator 1.6.12 → 2.1.3
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.
- checksums.yaml +5 -5
- data/.gitignore +30 -1
- data/.ruby-version +1 -0
- data/.travis.yml +13 -12
- data/Gemfile +4 -1
- data/Gemfile.lock +135 -0
- data/README.md +104 -122
- data/Rakefile +377 -5
- data/aux/gv_results.slim +155 -0
- data/aux/html_files/css/gv.compiled.min.css +8 -0
- data/aux/{files → html_files}/css/src/bootstrap.min.css +0 -0
- data/aux/{files → html_files}/css/src/font-awesome.min.css +0 -0
- data/aux/{files → html_files}/css/src/style.css +0 -0
- data/aux/{files → html_files}/fonts/FontAwesome.otf +0 -0
- data/aux/{files → html_files}/fonts/fontawesome-webfont.eot +0 -0
- data/aux/{files → html_files}/fonts/fontawesome-webfont.svg +0 -0
- data/aux/{files → html_files}/fonts/fontawesome-webfont.ttf +0 -0
- data/aux/{files → html_files}/fonts/fontawesome-webfont.woff +0 -0
- data/aux/{files → html_files}/img/gene.png +0 -0
- data/aux/html_files/js/gv.compiled.min.js +1 -0
- data/aux/{files → html_files}/js/src/bootstrap.min.js +0 -0
- data/aux/{files → html_files}/js/src/d3.v3.min.js +0 -0
- data/aux/{files → html_files}/js/src/jquery-2.1.1.min.js +0 -0
- data/aux/{files → html_files}/js/src/jquery.tablesorter.min.js +0 -0
- data/aux/{files → html_files}/js/src/plots.js +1 -1
- data/aux/{files → html_files}/js/src/script.js +0 -0
- data/aux/{files → html_files}/json/.gitkeep +0 -0
- data/bin/genevalidator +393 -56
- data/exemplar_data/README.md +60 -0
- data/{data/mrna_data.fasta → exemplar_data/mrna_data.fa} +1 -1
- data/{data/protein_data.fasta → exemplar_data/protein_data.fa} +0 -0
- data/genevalidator.gemspec +35 -20
- data/install.sh +92 -0
- data/lib/genevalidator.rb +171 -56
- data/lib/genevalidator/arg_validation.rb +26 -55
- data/lib/genevalidator/blast.rb +44 -99
- data/lib/genevalidator/clusterization.rb +18 -22
- data/lib/genevalidator/exceptions.rb +17 -17
- data/lib/genevalidator/ext/array.rb +21 -4
- data/lib/genevalidator/get_raw_sequences.rb +32 -31
- data/lib/genevalidator/hsp.rb +31 -2
- data/lib/genevalidator/json_to_gv_results.rb +38 -122
- data/lib/genevalidator/output.rb +158 -172
- data/lib/genevalidator/output_files.rb +134 -0
- data/lib/genevalidator/pool.rb +2 -5
- data/lib/genevalidator/query.rb +1 -1
- data/lib/genevalidator/tabular_parser.rb +8 -29
- data/lib/genevalidator/validation.rb +48 -90
- data/lib/genevalidator/validation_alignment.rb +64 -75
- data/lib/genevalidator/validation_blast_reading_frame.rb +13 -9
- data/lib/genevalidator/validation_duplication.rb +85 -84
- data/lib/genevalidator/validation_gene_merge.rb +46 -35
- data/lib/genevalidator/validation_length_cluster.rb +18 -15
- data/lib/genevalidator/validation_length_rank.rb +19 -15
- data/lib/genevalidator/validation_maker_qi.rb +13 -12
- data/lib/genevalidator/validation_open_reading_frame.rb +16 -13
- data/lib/genevalidator/validation_report.rb +1 -1
- data/lib/genevalidator/validation_test.rb +1 -1
- data/lib/genevalidator/version.rb +1 -1
- data/test/overall.rb +1 -1
- data/test/test_all_validations.rb +36 -24
- data/test/test_blast.rb +39 -24
- data/test/test_clusterization_2d.rb +4 -4
- data/test/test_helper.rb +2 -2
- data/test/test_query.rb +16 -20
- data/test/test_validation_open_reading_frame.rb +122 -122
- data/test/test_validations.rb +12 -10
- metadata +94 -79
- data/aux/files/css/genevalidator.compiled.min.css +0 -16
- data/aux/files/js/genevalidator.compiled.min.js +0 -28
- data/aux/json_footer.erb +0 -8
- data/aux/json_header.erb +0 -19
- data/aux/json_query.erb +0 -15
- data/aux/template_footer.erb +0 -8
- data/aux/template_header.erb +0 -19
- data/aux/template_query.erb +0 -14
- data/data/README.md +0 -57
- data/data/mrna_data.fasta.blast_tabular +0 -3567
- data/data/mrna_data.fasta.blast_tabular.raw_seq +0 -53998
- data/data/mrna_data.fasta.blast_tabular.raw_seq.idx +0 -5440
- data/data/mrna_data.fasta.blast_xml +0 -39800
- data/data/mrna_data.fasta.blast_xml.raw_seq +0 -2554
- data/data/mrna_data.fasta.blast_xml.raw_seq.idx +0 -3127
- data/data/mrna_data.fasta.json +0 -1
- data/data/protein_data.fasta.blast_tabular +0 -3278
- data/data/protein_data.fasta.blast_tabular.raw_seq +0 -61295
- data/data/protein_data.fasta.blast_tabular.raw_seq.idx +0 -4438
- data/data/protein_data.fasta.blast_xml +0 -26228
- data/data/protein_data.fasta.blast_xml.raw_seq +0 -9803
- data/data/protein_data.fasta.blast_xml.raw_seq.idx +0 -1777
- 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
|
|
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 =
|
|
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
|
|
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
|
-
|
|
100
|
-
|
|
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
|
-
|
|
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
|
-
|
|
166
|
-
|
|
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
|
|
185
|
-
cluster.lengths.collect
|
|
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
|
|
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 =
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
|
|
73
|
+
@msg.empty? ? "#{@percentage}%" : "#{@percentage}% (#{@msg})"
|
|
72
74
|
end
|
|
73
75
|
|
|
74
76
|
def validation
|
|
75
|
-
|
|
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
|
-
|
|
108
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
31
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
105
|
-
|
|
106
|
-
|
|
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
|
|
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 #{
|
|
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
|
-
"#{
|
|
56
|
+
"#{@coverage.round}% (frame #{@mainORFFrame})"
|
|
54
57
|
end
|
|
55
58
|
|
|
56
59
|
def validation
|
|
57
|
-
|
|
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.
|
|
79
|
-
'
|
|
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
|
-
|
|
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.
|
|
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 =
|
|
141
|
-
orf_end =
|
|
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
|
-
|
|
167
|
+
raise QueryError unless orfs.is_a? Hash
|
|
165
168
|
|
|
166
169
|
data = []
|
|
167
170
|
|
data/test/overall.rb
CHANGED
|
@@ -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
|
|
42
|
+
validations: %w[lenc lenr frame merge dup orf align],
|
|
44
43
|
db: database,
|
|
45
44
|
num_threads: threads,
|
|
46
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
63
|
+
validations: %w[lenc lenr frame merge dup orf align],
|
|
62
64
|
db: database,
|
|
63
65
|
num_threads: threads,
|
|
64
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
98
|
+
validations: %w[lenc lenr frame merge dup orf align],
|
|
95
99
|
db: database,
|
|
96
100
|
num_threads: threads,
|
|
97
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
119
|
+
validations: %w[lenc lenr frame merge dup orf align],
|
|
113
120
|
db: database,
|
|
114
121
|
num_threads: threads,
|
|
115
|
-
|
|
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
|
-
|
|
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
|
|
135
|
+
GeneValidator.init(opts1, 1)
|
|
124
136
|
GeneValidator.run
|
|
125
137
|
$stdout.reopen original_stdout
|
|
126
138
|
|