quorum 0.7.1 → 0.8.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.
- data/.rspec +1 -0
- data/.travis.yml +5 -1
- data/Gemfile +4 -2
- data/Gemfile.lock +68 -47
- data/HISTORY.md +9 -0
- data/README.rdoc +1 -1
- data/app/assets/javascripts/quorum/quorum.js +4 -4
- data/app/controllers/quorum/application_controller.rb +1 -0
- data/app/controllers/quorum/jobs_controller.rb +65 -80
- data/app/models/quorum/blastn_job.rb +1 -1
- data/app/models/quorum/blastn_job_report.rb +4 -1
- data/app/models/quorum/blastp_job.rb +1 -1
- data/app/models/quorum/blastp_job_report.rb +4 -1
- data/app/models/quorum/blastx_job.rb +1 -1
- data/app/models/quorum/blastx_job_report.rb +4 -1
- data/app/models/quorum/job.rb +64 -56
- data/app/models/quorum/job_data.rb +22 -0
- data/app/models/quorum/job_fetch_data.rb +11 -0
- data/app/models/quorum/job_queue_observer.rb +11 -0
- data/app/models/quorum/job_queue_service.rb +66 -0
- data/app/models/quorum/job_report_searcher.rb +36 -0
- data/app/models/quorum/job_serializer.rb +96 -0
- data/app/models/quorum/tblastn_job.rb +1 -1
- data/app/models/quorum/tblastn_job_report.rb +4 -1
- data/app/views/quorum/jobs/show.html.erb +3 -0
- data/app/views/quorum/jobs/templates/_blast_detailed_report_template.html.erb +1 -1
- data/app/views/quorum/jobs/templates/_blast_template.html.erb +3 -1
- data/config/initializers/mime_types.rb +2 -0
- data/config/routes.rb +3 -3
- data/db/migrate/20120809155712_add_percent_identity_to_blast_reports.rb +8 -0
- data/db/migrate/20120921182416_add_mismatch_to_blast_reports.rb +8 -0
- data/lib/generators/templates/blast.rb +8 -1
- data/lib/quorum/engine.rb +2 -0
- data/lib/quorum/sequence.rb +35 -0
- data/lib/quorum/version.rb +1 -1
- data/lib/quorum.rb +3 -10
- data/lib/tasks/quorum_blastdb_build.rake +3 -1
- data/lib/workers/system.rb +3 -1
- data/quorum.gemspec +1 -0
- data/spec/dummy/config/environment.rb +18 -5
- data/spec/javascripts/helpers/jasmine-jquery.js +2 -2
- data/spec/javascripts/{jobs_spec.js → suites/jobs_spec.js} +0 -0
- data/spec/javascripts/{quorum_spec.js → suites/quorum_spec.js} +0 -0
- data/spec/javascripts/{string_spec.js → suites/string_spec.js} +0 -0
- data/spec/lib/tasks/travis.rake +9 -4
- data/spec/models/blastn_job_report_spec.rb +7 -3
- data/spec/models/blastp_job_report_spec.rb +8 -3
- data/spec/models/blastx_job_report_spec.rb +8 -3
- data/spec/models/job_data_spec.rb +21 -0
- data/spec/models/job_fetch_data_spec.rb +25 -0
- data/spec/models/job_queue_observer_spec.rb +18 -0
- data/spec/models/job_queue_service_spec.rb +49 -0
- data/spec/models/job_report_searcher_spec.rb +47 -0
- data/spec/models/job_serializer_spec.rb +60 -0
- data/spec/models/job_spec.rb +1 -16
- data/spec/models/tblastn_job_report_spec.rb +8 -3
- data/spec/quorum/quorum_sequence_spec.rb +2 -0
- data/spec/requests/jobs_spec.rb +16 -7
- data/spec/spec_helper.rb +2 -0
- metadata +38 -8
- data/spec/dummy/app/models/blast.rb +0 -2
data/.rspec
CHANGED
data/.travis.yml
CHANGED
@@ -5,6 +5,9 @@ rvm:
|
|
5
5
|
gemfile:
|
6
6
|
- gemfiles/Gemfile.rails-3.1.x
|
7
7
|
- gemfiles/Gemfile.rails-3.2.x
|
8
|
+
env:
|
9
|
+
- DB=mysql
|
10
|
+
- DB=postgresql
|
8
11
|
before_install:
|
9
12
|
- sudo apt-get update
|
10
13
|
- sudo apt-get install ncbi-blast+ emboss
|
@@ -12,7 +15,8 @@ before_script:
|
|
12
15
|
- "export DISPLAY=:99.0"
|
13
16
|
- "sh -e /etc/init.d/xvfb start"
|
14
17
|
- bundle install
|
15
|
-
- mysql -e
|
18
|
+
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database quorum_test;'; fi"
|
19
|
+
- sh -c "if [ '$DB' = 'postgresql' ]; then psql -c 'create database quorum_test;' -U postgres; fi"
|
16
20
|
script: "rake travis:spec"
|
17
21
|
notifications:
|
18
22
|
email:
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
quorum (0.
|
4
|
+
quorum (0.8.0)
|
5
5
|
bio-blastxmlparser (~> 1.1.0)
|
6
6
|
jquery-rails
|
7
7
|
net-ssh (~> 2.3.0)
|
@@ -12,34 +12,33 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: http://rubygems.org/
|
14
14
|
specs:
|
15
|
-
actionmailer (3.2.
|
16
|
-
actionpack (= 3.2.
|
15
|
+
actionmailer (3.2.9)
|
16
|
+
actionpack (= 3.2.9)
|
17
17
|
mail (~> 2.4.4)
|
18
|
-
actionpack (3.2.
|
19
|
-
activemodel (= 3.2.
|
20
|
-
activesupport (= 3.2.
|
18
|
+
actionpack (3.2.9)
|
19
|
+
activemodel (= 3.2.9)
|
20
|
+
activesupport (= 3.2.9)
|
21
21
|
builder (~> 3.0.0)
|
22
22
|
erubis (~> 2.7.0)
|
23
23
|
journey (~> 1.0.4)
|
24
24
|
rack (~> 1.4.0)
|
25
25
|
rack-cache (~> 1.2)
|
26
26
|
rack-test (~> 0.6.1)
|
27
|
-
sprockets (~> 2.1
|
28
|
-
activemodel (3.2.
|
29
|
-
activesupport (= 3.2.
|
27
|
+
sprockets (~> 2.2.1)
|
28
|
+
activemodel (3.2.9)
|
29
|
+
activesupport (= 3.2.9)
|
30
30
|
builder (~> 3.0.0)
|
31
|
-
activerecord (3.2.
|
32
|
-
activemodel (= 3.2.
|
33
|
-
activesupport (= 3.2.
|
31
|
+
activerecord (3.2.9)
|
32
|
+
activemodel (= 3.2.9)
|
33
|
+
activesupport (= 3.2.9)
|
34
34
|
arel (~> 3.0.2)
|
35
35
|
tzinfo (~> 0.3.29)
|
36
|
-
activeresource (3.2.
|
37
|
-
activemodel (= 3.2.
|
38
|
-
activesupport (= 3.2.
|
39
|
-
activesupport (3.2.
|
36
|
+
activeresource (3.2.9)
|
37
|
+
activemodel (= 3.2.9)
|
38
|
+
activesupport (= 3.2.9)
|
39
|
+
activesupport (3.2.9)
|
40
40
|
i18n (~> 0.6)
|
41
41
|
multi_json (~> 1.0)
|
42
|
-
addressable (2.3.2)
|
43
42
|
arel (3.0.2)
|
44
43
|
bio-blastxmlparser (1.1.0)
|
45
44
|
bio-logger (>= 1.0.0)
|
@@ -56,10 +55,20 @@ GEM
|
|
56
55
|
xpath (~> 0.1.4)
|
57
56
|
childprocess (0.3.6)
|
58
57
|
ffi (~> 1.0, >= 1.0.6)
|
58
|
+
columnize (0.3.6)
|
59
|
+
daemons (1.1.9)
|
59
60
|
database_cleaner (0.9.1)
|
61
|
+
debugger (1.2.2)
|
62
|
+
columnize (>= 0.3.1)
|
63
|
+
debugger-linecache (~> 1.1.1)
|
64
|
+
debugger-ruby_core_source (~> 1.1.5)
|
65
|
+
debugger-linecache (1.1.2)
|
66
|
+
debugger-ruby_core_source (>= 1.1.1)
|
67
|
+
debugger-ruby_core_source (1.1.5)
|
60
68
|
diff-lcs (1.1.3)
|
61
69
|
erubis (2.7.0)
|
62
|
-
|
70
|
+
eventmachine (1.0.0)
|
71
|
+
ffi (1.2.0)
|
63
72
|
hike (1.2.1)
|
64
73
|
i18n (0.6.1)
|
65
74
|
jasmine (1.2.1)
|
@@ -67,14 +76,14 @@ GEM
|
|
67
76
|
rack (~> 1.0)
|
68
77
|
rspec (>= 1.3.1)
|
69
78
|
selenium-webdriver (>= 0.1.3)
|
70
|
-
jasmine-core (1.
|
79
|
+
jasmine-core (1.3.0)
|
71
80
|
journey (1.0.4)
|
72
|
-
jquery-rails (2.1.
|
73
|
-
railties (>= 3.
|
74
|
-
thor (
|
81
|
+
jquery-rails (2.1.4)
|
82
|
+
railties (>= 3.0, < 5.0)
|
83
|
+
thor (>= 0.14, < 2.0)
|
75
84
|
json (1.7.5)
|
76
|
-
libwebsocket (0.1.
|
77
|
-
|
85
|
+
libwebsocket (0.1.6.1)
|
86
|
+
websocket
|
78
87
|
log4r (1.1.10)
|
79
88
|
mail (2.4.4)
|
80
89
|
i18n (>= 0.4.0)
|
@@ -85,6 +94,7 @@ GEM
|
|
85
94
|
mysql2 (0.3.11)
|
86
95
|
net-ssh (2.3.0)
|
87
96
|
nokogiri (1.5.5)
|
97
|
+
pg (0.14.1)
|
88
98
|
polyglot (0.3.3)
|
89
99
|
rack (1.4.1)
|
90
100
|
rack-cache (1.2)
|
@@ -95,22 +105,22 @@ GEM
|
|
95
105
|
rack
|
96
106
|
rack-test (0.6.2)
|
97
107
|
rack (>= 1.0)
|
98
|
-
rails (3.2.
|
99
|
-
actionmailer (= 3.2.
|
100
|
-
actionpack (= 3.2.
|
101
|
-
activerecord (= 3.2.
|
102
|
-
activeresource (= 3.2.
|
103
|
-
activesupport (= 3.2.
|
108
|
+
rails (3.2.9)
|
109
|
+
actionmailer (= 3.2.9)
|
110
|
+
actionpack (= 3.2.9)
|
111
|
+
activerecord (= 3.2.9)
|
112
|
+
activeresource (= 3.2.9)
|
113
|
+
activesupport (= 3.2.9)
|
104
114
|
bundler (~> 1.0)
|
105
|
-
railties (= 3.2.
|
106
|
-
railties (3.2.
|
107
|
-
actionpack (= 3.2.
|
108
|
-
activesupport (= 3.2.
|
115
|
+
railties (= 3.2.9)
|
116
|
+
railties (3.2.9)
|
117
|
+
actionpack (= 3.2.9)
|
118
|
+
activesupport (= 3.2.9)
|
109
119
|
rack-ssl (~> 1.3.2)
|
110
120
|
rake (>= 0.8.7)
|
111
121
|
rdoc (~> 3.4)
|
112
122
|
thor (>= 0.14.6, < 2.0)
|
113
|
-
rake (0.
|
123
|
+
rake (10.0.2)
|
114
124
|
rdoc (3.12)
|
115
125
|
json (~> 1.4)
|
116
126
|
redis (2.2.2)
|
@@ -126,22 +136,24 @@ GEM
|
|
126
136
|
resque-result (1.0.1)
|
127
137
|
resque (~> 1.9)
|
128
138
|
resque-meta (~> 1.0)
|
129
|
-
resque_spec (0.12.
|
139
|
+
resque_spec (0.12.6)
|
130
140
|
resque (>= 1.19.0)
|
131
141
|
rspec (>= 2.5.0)
|
132
|
-
rspec (2.
|
133
|
-
rspec-core (~> 2.
|
134
|
-
rspec-expectations (~> 2.
|
135
|
-
rspec-mocks (~> 2.
|
136
|
-
rspec-core (2.
|
137
|
-
rspec-expectations (2.
|
142
|
+
rspec (2.12.0)
|
143
|
+
rspec-core (~> 2.12.0)
|
144
|
+
rspec-expectations (~> 2.12.0)
|
145
|
+
rspec-mocks (~> 2.12.0)
|
146
|
+
rspec-core (2.12.0)
|
147
|
+
rspec-expectations (2.12.0)
|
138
148
|
diff-lcs (~> 1.1.3)
|
139
|
-
rspec-mocks (2.
|
140
|
-
rspec-rails (2.
|
149
|
+
rspec-mocks (2.12.0)
|
150
|
+
rspec-rails (2.12.0)
|
141
151
|
actionpack (>= 3.0)
|
142
152
|
activesupport (>= 3.0)
|
143
153
|
railties (>= 3.0)
|
144
|
-
rspec (~> 2.
|
154
|
+
rspec-core (~> 2.12.0)
|
155
|
+
rspec-expectations (~> 2.12.0)
|
156
|
+
rspec-mocks (~> 2.12.0)
|
145
157
|
rubyzip (0.9.9)
|
146
158
|
selenium-webdriver (2.26.0)
|
147
159
|
childprocess (>= 0.2.5)
|
@@ -152,10 +164,15 @@ GEM
|
|
152
164
|
rack (~> 1.3, >= 1.3.6)
|
153
165
|
rack-protection (~> 1.2)
|
154
166
|
tilt (~> 1.3, >= 1.3.3)
|
155
|
-
sprockets (2.
|
167
|
+
sprockets (2.2.2)
|
156
168
|
hike (~> 1.2)
|
169
|
+
multi_json (~> 1.0)
|
157
170
|
rack (~> 1.0)
|
158
171
|
tilt (~> 1.1, != 1.3.0)
|
172
|
+
thin (1.5.0)
|
173
|
+
daemons (>= 1.0.9)
|
174
|
+
eventmachine (>= 0.12.6)
|
175
|
+
rack (>= 1.0.0)
|
159
176
|
thor (0.16.0)
|
160
177
|
tilt (1.3.3)
|
161
178
|
treetop (1.4.12)
|
@@ -164,6 +181,7 @@ GEM
|
|
164
181
|
tzinfo (0.3.35)
|
165
182
|
vegas (0.1.11)
|
166
183
|
rack (>= 1.0.0)
|
184
|
+
websocket (1.0.4)
|
167
185
|
xpath (0.1.4)
|
168
186
|
nokogiri (~> 1.3)
|
169
187
|
|
@@ -173,9 +191,12 @@ PLATFORMS
|
|
173
191
|
DEPENDENCIES
|
174
192
|
capybara (~> 1.1)
|
175
193
|
database_cleaner (~> 0.8)
|
194
|
+
debugger
|
176
195
|
jasmine (~> 1.2)
|
177
196
|
mysql2 (~> 0.3.11)
|
197
|
+
pg (~> 0.14.1)
|
178
198
|
quorum!
|
179
|
-
rake (~> 0.
|
199
|
+
rake (~> 10.0.0)
|
180
200
|
resque_spec (~> 0.12)
|
181
201
|
rspec-rails (~> 2.11)
|
202
|
+
thin
|
data/HISTORY.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## 0.8.0 (2012-11-30)
|
2
|
+
|
3
|
+
* Major refactoring and bug fixes.
|
4
|
+
* Merged feature branch data_export. Search results are available as .txt (tab
|
5
|
+
delimited), .gff (GFF3) and JSONi (default).
|
6
|
+
* Shortened search url to /quorum/jobs/:id/search?algo=[ie: blastn]
|
7
|
+
* Search returns [{ enqueued: false }] if algorithm was not enqueued.
|
8
|
+
* Upgrading? Install migrations and run generators.
|
9
|
+
|
1
10
|
## 0.7.1 (2012-11-07)
|
2
11
|
|
3
12
|
* Added quorum:delete_jobs rake task.
|
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= Quorum {<img src="https://secure.travis-ci.org/ncgr/quorum.png?branch=master"alt="Build Status" />}[http://travis-ci.org/ncgr/quorum]
|
1
|
+
= Quorum {<img src="https://secure.travis-ci.org/ncgr/quorum.png?branch=master" alt="Build Status" />}[http://travis-ci.org/ncgr/quorum]
|
2
2
|
|
3
3
|
A flexible bioinformatics search tool.
|
4
4
|
|
@@ -18,7 +18,7 @@ QUORUM.algorithms = ["blastn", "blastx", "tblastn", "blastp"];
|
|
18
18
|
QUORUM.pollResults = function(callback, callback_obj, interval, algos) {
|
19
19
|
|
20
20
|
var self = this,
|
21
|
-
url = document.URL + '/
|
21
|
+
url = document.URL + '/search',
|
22
22
|
interval = interval || 5000,
|
23
23
|
algos = algos || self.algorithms,
|
24
24
|
error = false,
|
@@ -97,7 +97,7 @@ QUORUM.pollResults = function(callback, callback_obj, interval, algos) {
|
|
97
97
|
QUORUM.viewDetailedReport = function(focus_id, query, algo) {
|
98
98
|
|
99
99
|
var self = this,
|
100
|
-
url = document.URL + '/
|
100
|
+
url = document.URL + '/search';
|
101
101
|
|
102
102
|
// Create the modal box.
|
103
103
|
$('#detailed_report_dialog').html(
|
@@ -327,7 +327,7 @@ QUORUM.displayHspLinks = function(focus, group, data) {
|
|
327
327
|
QUORUM.downloadSequence = function(algo_id, algo, el) {
|
328
328
|
|
329
329
|
var self = this,
|
330
|
-
url = document.URL + '/
|
330
|
+
url = document.URL + '/get_blast_hit_sequence';
|
331
331
|
|
332
332
|
$(el).html('Fetching sequence...');
|
333
333
|
|
@@ -357,7 +357,7 @@ QUORUM.downloadSequence = function(algo_id, algo, el) {
|
|
357
357
|
QUORUM.getSequenceFile = function(meta_id, el) {
|
358
358
|
|
359
359
|
var self = this,
|
360
|
-
url = document.URL + '/
|
360
|
+
url = document.URL + '/send_blast_hit_sequence?meta_id=' + meta_id,
|
361
361
|
timeoutId = 0;
|
362
362
|
|
363
363
|
function downloadFile(data) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Quorum
|
2
2
|
class JobsController < ApplicationController
|
3
3
|
|
4
|
-
respond_to :html, :json
|
4
|
+
respond_to :html, :json, :gff, :txt
|
5
5
|
before_filter :set_blast_dbs, :only => [:new, :create]
|
6
6
|
|
7
7
|
def index
|
@@ -9,31 +9,16 @@ module Quorum
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def new
|
12
|
-
|
13
|
-
@job.build_blastn_job
|
14
|
-
@job.build_blastx_job
|
15
|
-
@job.build_tblastn_job
|
16
|
-
@job.build_blastp_job
|
12
|
+
build_blast_jobs
|
17
13
|
end
|
18
14
|
|
19
15
|
def create
|
20
|
-
|
21
|
-
file = params[:job][:sequence_file].read
|
22
|
-
params[:job].delete(:sequence_file)
|
23
|
-
end
|
24
|
-
|
16
|
+
read_sequence_file
|
25
17
|
@job = Job.new(params[:job])
|
26
|
-
|
27
|
-
if file
|
28
|
-
@job.sequence = ""
|
29
|
-
@job.sequence << file
|
30
|
-
end
|
18
|
+
set_sequence
|
31
19
|
|
32
20
|
unless @job.save
|
33
|
-
|
34
|
-
@job.build_blastx_job if @job.blastx_job.nil?
|
35
|
-
@job.build_tblastn_job if @job.tblastn_job.nil?
|
36
|
-
@job.build_blastp_job if @job.blastp_job.nil?
|
21
|
+
build_blast_jobs
|
37
22
|
render :action => "new"
|
38
23
|
return
|
39
24
|
end
|
@@ -50,56 +35,36 @@ module Quorum
|
|
50
35
|
end
|
51
36
|
|
52
37
|
#
|
53
|
-
# Returns
|
54
|
-
#
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
json = job.method(report).call.default_order
|
73
|
-
end
|
74
|
-
else
|
75
|
-
json = []
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
38
|
+
# Returns Quorum's search results.
|
39
|
+
#
|
40
|
+
# This method should be used to gather Resque worker results, or user
|
41
|
+
# supplied query params.
|
42
|
+
#
|
43
|
+
def search
|
44
|
+
data = Job.search(params)
|
45
|
+
|
46
|
+
# Respond with :json, :txt (tab delimited Blast results), or GFF3.
|
47
|
+
respond_with data.flatten!(1) do |format|
|
48
|
+
format.json {
|
49
|
+
render :json => Quorum::JobSerializer.as_json(data)
|
50
|
+
}
|
51
|
+
format.gff {
|
52
|
+
render :text => Quorum::JobSerializer.as_gff(data)
|
53
|
+
}
|
54
|
+
format.txt {
|
55
|
+
render :text => Quorum::JobSerializer.as_txt(data)
|
56
|
+
}
|
79
57
|
end
|
80
|
-
|
81
|
-
respond_with json
|
82
58
|
end
|
83
59
|
|
84
60
|
#
|
85
|
-
# Find hit sequence
|
86
|
-
#
|
87
|
-
#
|
88
|
-
def
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
rescue ActiveRecord::RecordNotFound => e
|
93
|
-
logger.error e.message
|
94
|
-
else
|
95
|
-
data = job.fetch_quorum_blast_sequence(
|
96
|
-
params[:algo], params[:algo_id]
|
97
|
-
)
|
98
|
-
json = [{ :meta_id => data.meta_id }]
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
respond_with json || []
|
61
|
+
# Find hit sequence and return worker meta_id for lookup. If the method
|
62
|
+
# returns [], try again.
|
63
|
+
#
|
64
|
+
def get_blast_hit_sequence
|
65
|
+
fetch_data = Job.set_blast_hit_sequence_lookup_values(params)
|
66
|
+
data = Quorum::JobQueueService.queue_fetch_worker(fetch_data)
|
67
|
+
respond_with data || []
|
103
68
|
end
|
104
69
|
|
105
70
|
#
|
@@ -108,25 +73,24 @@ module Quorum
|
|
108
73
|
#
|
109
74
|
# See lib/generators/templates/blast_db.rb for more info.
|
110
75
|
#
|
111
|
-
def
|
76
|
+
def send_blast_hit_sequence
|
112
77
|
data = Workers::System.get_meta(params[:meta_id])
|
113
|
-
|
114
|
-
if data.result.downcase.include?("error")
|
115
|
-
render :text => data.result
|
116
|
-
return
|
117
|
-
else
|
118
|
-
send_data data.result,
|
119
|
-
:filename => "#{params[:meta_id]}.fa",
|
120
|
-
:type => "text/plain",
|
121
|
-
:disposition => "attachment"
|
122
|
-
return
|
123
|
-
end
|
124
|
-
end
|
125
|
-
render :text => ""
|
78
|
+
sequence(data)
|
126
79
|
end
|
127
80
|
|
128
81
|
private
|
129
82
|
|
83
|
+
#
|
84
|
+
# Create new Job and build associations.
|
85
|
+
#
|
86
|
+
def build_blast_jobs
|
87
|
+
@job ||= Job.new
|
88
|
+
@job.build_blastn_job if @job.blastn_job.nil?
|
89
|
+
@job.build_blastx_job if @job.blastx_job.nil?
|
90
|
+
@job.build_tblastn_job if @job.tblastn_job.nil?
|
91
|
+
@job.build_blastp_job if @job.blastp_job.nil?
|
92
|
+
end
|
93
|
+
|
130
94
|
#
|
131
95
|
# Blast Database options for select.
|
132
96
|
#
|
@@ -139,5 +103,26 @@ module Quorum
|
|
139
103
|
}
|
140
104
|
end
|
141
105
|
|
106
|
+
#
|
107
|
+
# Read and remove uploaded sequence file from params.
|
108
|
+
#
|
109
|
+
def read_sequence_file
|
110
|
+
if params[:job][:sequence_file]
|
111
|
+
@file = params[:job][:sequence_file].read
|
112
|
+
params[:job].delete(:sequence_file)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
#
|
117
|
+
# Set uploaded sequence file.
|
118
|
+
#
|
119
|
+
def set_sequence
|
120
|
+
if @file
|
121
|
+
@job.sequence = ""
|
122
|
+
@job.sequence << @file
|
123
|
+
end
|
124
|
+
@file = nil
|
125
|
+
end
|
126
|
+
|
142
127
|
end
|
143
128
|
end
|
@@ -17,7 +17,7 @@ module Quorum
|
|
17
17
|
:blast_dbs
|
18
18
|
|
19
19
|
validates_format_of :expectation,
|
20
|
-
:with =>
|
20
|
+
:with => /\A[+-]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\z/,
|
21
21
|
:message => " - Valid formats (12, 32.05, 43e-123)",
|
22
22
|
:allow_blank => true
|
23
23
|
validates_numericality_of :max_target_seqs,
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module Quorum
|
2
2
|
class BlastnJobReport < ActiveRecord::Base
|
3
|
+
|
4
|
+
extend Quorum::JobReportSearcher
|
5
|
+
|
3
6
|
belongs_to :blastn_job
|
4
7
|
scope :default_order, order("query ASC, bit_score DESC")
|
5
|
-
|
8
|
+
|
6
9
|
end
|
7
10
|
end
|
@@ -17,7 +17,7 @@ module Quorum
|
|
17
17
|
:blast_dbs
|
18
18
|
|
19
19
|
validates_format_of :expectation,
|
20
|
-
:with =>
|
20
|
+
:with => /\A[+-]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\z/,
|
21
21
|
:message => " - Valid formats (12, 32.05, 43e-123)",
|
22
22
|
:allow_blank => true
|
23
23
|
validates_numericality_of :max_target_seqs,
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module Quorum
|
2
2
|
class BlastpJobReport < ActiveRecord::Base
|
3
|
+
|
4
|
+
extend Quorum::JobReportSearcher
|
5
|
+
|
3
6
|
belongs_to :blastp_job
|
4
7
|
scope :default_order, order("query ASC, bit_score DESC")
|
5
|
-
|
8
|
+
|
6
9
|
end
|
7
10
|
end
|
@@ -17,7 +17,7 @@ module Quorum
|
|
17
17
|
:blast_dbs
|
18
18
|
|
19
19
|
validates_format_of :expectation,
|
20
|
-
:with =>
|
20
|
+
:with => /\A[+-]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\z/,
|
21
21
|
:message => " - Valid formats (12, 32.05, 43e-123)",
|
22
22
|
:allow_blank => true
|
23
23
|
validates_numericality_of :max_target_seqs,
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module Quorum
|
2
2
|
class BlastxJobReport < ActiveRecord::Base
|
3
|
+
|
4
|
+
extend Quorum::JobReportSearcher
|
5
|
+
|
3
6
|
belongs_to :blastx_job
|
4
7
|
scope :default_order, order("query ASC, bit_score DESC")
|
5
|
-
|
8
|
+
|
6
9
|
end
|
7
10
|
end
|