quorum 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/.rspec +1 -0
  2. data/.travis.yml +5 -1
  3. data/Gemfile +4 -2
  4. data/Gemfile.lock +68 -47
  5. data/HISTORY.md +9 -0
  6. data/README.rdoc +1 -1
  7. data/app/assets/javascripts/quorum/quorum.js +4 -4
  8. data/app/controllers/quorum/application_controller.rb +1 -0
  9. data/app/controllers/quorum/jobs_controller.rb +65 -80
  10. data/app/models/quorum/blastn_job.rb +1 -1
  11. data/app/models/quorum/blastn_job_report.rb +4 -1
  12. data/app/models/quorum/blastp_job.rb +1 -1
  13. data/app/models/quorum/blastp_job_report.rb +4 -1
  14. data/app/models/quorum/blastx_job.rb +1 -1
  15. data/app/models/quorum/blastx_job_report.rb +4 -1
  16. data/app/models/quorum/job.rb +64 -56
  17. data/app/models/quorum/job_data.rb +22 -0
  18. data/app/models/quorum/job_fetch_data.rb +11 -0
  19. data/app/models/quorum/job_queue_observer.rb +11 -0
  20. data/app/models/quorum/job_queue_service.rb +66 -0
  21. data/app/models/quorum/job_report_searcher.rb +36 -0
  22. data/app/models/quorum/job_serializer.rb +96 -0
  23. data/app/models/quorum/tblastn_job.rb +1 -1
  24. data/app/models/quorum/tblastn_job_report.rb +4 -1
  25. data/app/views/quorum/jobs/show.html.erb +3 -0
  26. data/app/views/quorum/jobs/templates/_blast_detailed_report_template.html.erb +1 -1
  27. data/app/views/quorum/jobs/templates/_blast_template.html.erb +3 -1
  28. data/config/initializers/mime_types.rb +2 -0
  29. data/config/routes.rb +3 -3
  30. data/db/migrate/20120809155712_add_percent_identity_to_blast_reports.rb +8 -0
  31. data/db/migrate/20120921182416_add_mismatch_to_blast_reports.rb +8 -0
  32. data/lib/generators/templates/blast.rb +8 -1
  33. data/lib/quorum/engine.rb +2 -0
  34. data/lib/quorum/sequence.rb +35 -0
  35. data/lib/quorum/version.rb +1 -1
  36. data/lib/quorum.rb +3 -10
  37. data/lib/tasks/quorum_blastdb_build.rake +3 -1
  38. data/lib/workers/system.rb +3 -1
  39. data/quorum.gemspec +1 -0
  40. data/spec/dummy/config/environment.rb +18 -5
  41. data/spec/javascripts/helpers/jasmine-jquery.js +2 -2
  42. data/spec/javascripts/{jobs_spec.js → suites/jobs_spec.js} +0 -0
  43. data/spec/javascripts/{quorum_spec.js → suites/quorum_spec.js} +0 -0
  44. data/spec/javascripts/{string_spec.js → suites/string_spec.js} +0 -0
  45. data/spec/lib/tasks/travis.rake +9 -4
  46. data/spec/models/blastn_job_report_spec.rb +7 -3
  47. data/spec/models/blastp_job_report_spec.rb +8 -3
  48. data/spec/models/blastx_job_report_spec.rb +8 -3
  49. data/spec/models/job_data_spec.rb +21 -0
  50. data/spec/models/job_fetch_data_spec.rb +25 -0
  51. data/spec/models/job_queue_observer_spec.rb +18 -0
  52. data/spec/models/job_queue_service_spec.rb +49 -0
  53. data/spec/models/job_report_searcher_spec.rb +47 -0
  54. data/spec/models/job_serializer_spec.rb +60 -0
  55. data/spec/models/job_spec.rb +1 -16
  56. data/spec/models/tblastn_job_report_spec.rb +8 -3
  57. data/spec/quorum/quorum_sequence_spec.rb +2 -0
  58. data/spec/requests/jobs_spec.rb +16 -7
  59. data/spec/spec_helper.rb +2 -0
  60. metadata +38 -8
  61. data/spec/dummy/app/models/blast.rb +0 -2
data/.rspec CHANGED
@@ -1 +1,2 @@
1
1
  --colour
2
+ --profile
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 "create database quorum_test;"
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
@@ -2,6 +2,8 @@ source "http://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- group :test do
6
- gem 'rake', '~> 0.9.2'
5
+ group :development, :test do
6
+ gem 'rake', '~> 10.0.0'
7
+ gem 'thin'
8
+ gem 'debugger'
7
9
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quorum (0.7.1)
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.8)
16
- actionpack (= 3.2.8)
15
+ actionmailer (3.2.9)
16
+ actionpack (= 3.2.9)
17
17
  mail (~> 2.4.4)
18
- actionpack (3.2.8)
19
- activemodel (= 3.2.8)
20
- activesupport (= 3.2.8)
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.3)
28
- activemodel (3.2.8)
29
- activesupport (= 3.2.8)
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.8)
32
- activemodel (= 3.2.8)
33
- activesupport (= 3.2.8)
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.8)
37
- activemodel (= 3.2.8)
38
- activesupport (= 3.2.8)
39
- activesupport (3.2.8)
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
- ffi (1.1.5)
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.2.0)
79
+ jasmine-core (1.3.0)
71
80
  journey (1.0.4)
72
- jquery-rails (2.1.3)
73
- railties (>= 3.1.0, < 5.0)
74
- thor (~> 0.14)
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.5)
77
- addressable
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.8)
99
- actionmailer (= 3.2.8)
100
- actionpack (= 3.2.8)
101
- activerecord (= 3.2.8)
102
- activeresource (= 3.2.8)
103
- activesupport (= 3.2.8)
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.8)
106
- railties (3.2.8)
107
- actionpack (= 3.2.8)
108
- activesupport (= 3.2.8)
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.9.2.2)
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.5)
139
+ resque_spec (0.12.6)
130
140
  resque (>= 1.19.0)
131
141
  rspec (>= 2.5.0)
132
- rspec (2.11.0)
133
- rspec-core (~> 2.11.0)
134
- rspec-expectations (~> 2.11.0)
135
- rspec-mocks (~> 2.11.0)
136
- rspec-core (2.11.1)
137
- rspec-expectations (2.11.3)
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.11.3)
140
- rspec-rails (2.11.4)
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.11.0)
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.1.3)
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.9.2)
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 + '/get_quorum_search_results.json',
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 + '/get_quorum_search_results.json';
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 + '/get_quorum_blast_hit_sequence.json';
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 + '/send_quorum_blast_hit_sequence?meta_id=' + meta_id,
360
+ url = document.URL + '/send_blast_hit_sequence?meta_id=' + meta_id,
361
361
  timeoutId = 0;
362
362
 
363
363
  function downloadFile(data) {
@@ -1,5 +1,6 @@
1
1
  module Quorum
2
2
  class ApplicationController < ActionController::Base
3
3
  include Quorum::Helpers
4
+ include Quorum::Sequence::SendSequence
4
5
  end
5
6
  end
@@ -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
- @job = Job.new
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
- if params[:job][:sequence_file]
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
- @job.build_blastn_job if @job.blastn_job.nil?
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 Resque worker results.
54
- #
55
- def get_quorum_search_results
56
- json = [{ :results => false }].to_json
57
-
58
- if Quorum::BLAST_ALGORITHMS.include?(params[:algo])
59
- queued = "#{params[:algo]}_job".to_sym
60
- report = "#{params[:algo]}_job_reports".to_sym
61
-
62
- begin
63
- job = Job.find(params[:id])
64
- rescue ActiveRecord::RecordNotFound => e
65
- json
66
- else
67
- if job.method(queued).call.present?
68
- if job.method(report).call.present?
69
- if params[:query]
70
- json = job.method(report).call.by_query(params[:query]).default_order
71
- else
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, queue worker and return worker meta_id
86
- # for lookup.
87
- #
88
- def get_quorum_blast_hit_sequence
89
- if Quorum::BLAST_ALGORITHMS.include?(params[:algo])
90
- begin
91
- job = Job.find(params[:id])
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 send_quorum_blast_hit_sequence
76
+ def send_blast_hit_sequence
112
77
  data = Workers::System.get_meta(params[:meta_id])
113
- if data.succeeded?
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 => /^[+-]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/,
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
- scope :by_query, lambda { |query| where("query = ?", query) }
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 => /^[+-]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/,
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
- scope :by_query, lambda { |query| where("query = ?", query) }
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 => /^[+-]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/,
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
- scope :by_query, lambda { |query| where("query = ?", query) }
8
+
6
9
  end
7
10
  end