quorum 0.3.0 → 0.3.1

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 (56) hide show
  1. data/Gemfile.lock +58 -58
  2. data/HISTORY.md +4 -0
  3. data/README.rdoc +31 -31
  4. data/app/assets/javascripts/quorum/jobs.js +2 -2
  5. data/app/assets/javascripts/quorum/quorum.js +55 -55
  6. data/app/assets/stylesheets/quorum/application.css +23 -23
  7. data/app/assets/stylesheets/quorum/jquery-ui-1.8.16.custom.css +5 -5
  8. data/app/controllers/quorum/jobs_controller.rb +7 -7
  9. data/app/models/quorum/blastn_job.rb +1 -1
  10. data/app/models/quorum/blastp_job.rb +1 -1
  11. data/app/models/quorum/blastx_job.rb +1 -1
  12. data/app/models/quorum/job.rb +19 -19
  13. data/app/models/quorum/tblastn_job.rb +1 -1
  14. data/app/views/quorum/jobs/form/_blastn_form.html.erb +7 -7
  15. data/app/views/quorum/jobs/form/_blastp_form.html.erb +7 -7
  16. data/app/views/quorum/jobs/form/_blastx_form.html.erb +7 -7
  17. data/app/views/quorum/jobs/form/_tblastn_form.html.erb +7 -7
  18. data/app/views/quorum/jobs/new.html.erb +9 -9
  19. data/app/views/quorum/jobs/show.html.erb +7 -7
  20. data/app/views/quorum/jobs/templates/_blast_detailed_report_template.html.erb +3 -3
  21. data/app/views/quorum/jobs/templates/_blast_template.html.erb +4 -4
  22. data/lib/generators/quorum/install_generator.rb +3 -3
  23. data/lib/generators/quorum/views_generator.rb +7 -6
  24. data/lib/generators/templates/README +3 -3
  25. data/lib/generators/templates/blast.rb +7 -7
  26. data/lib/generators/templates/blast_db.rb +6 -6
  27. data/lib/generators/templates/fetch +3 -3
  28. data/lib/generators/templates/quorum_initializer.rb +1 -1
  29. data/lib/generators/templates/quorum_settings.yml +1 -1
  30. data/lib/generators/templates/search +8 -8
  31. data/lib/generators/templates/trollop.rb +4 -4
  32. data/lib/quorum/sequence.rb +6 -6
  33. data/lib/quorum/version.rb +1 -1
  34. data/lib/quorum.rb +1 -1
  35. data/lib/tasks/blastdb/build_blast_db.rb +7 -7
  36. data/lib/tasks/quorum_tasks.rake +6 -6
  37. data/lib/workers/quorum.rb +2 -2
  38. data/quorum.gemspec +1 -1
  39. data/spec/dummy/quorum/blastdb/test.nin +0 -0
  40. data/spec/dummy/quorum/blastdb/test.pin +0 -0
  41. data/spec/javascripts/fixtures/quorum_search_form.html +8 -8
  42. data/spec/javascripts/quorum_spec.js +12 -12
  43. data/spec/javascripts/string_spec.js +2 -2
  44. data/spec/models/blastn_job_report_spec.rb +3 -3
  45. data/spec/models/blastp_job_report_spec.rb +3 -3
  46. data/spec/models/blastx_job_report_spec.rb +3 -3
  47. data/spec/models/job_spec.rb +1 -1
  48. data/spec/models/tblastn_job_report_spec.rb +3 -3
  49. data/spec/quorum/quorum_sequence_spec.rb +1 -1
  50. data/spec/requests/jobs_spec.rb +12 -11
  51. data/spec/spec_helper.rb +1 -1
  52. data/spec/tasks/blastdb_rake_spec.rb +5 -5
  53. data/spec/templates/blast_spec.rb +5 -5
  54. data/vendor/assets/javascripts/jquery.autohint.js +16 -16
  55. data/vendor/assets/javascripts/jquery.tipsy.js +33 -33
  56. metadata +96 -31
@@ -1,6 +1,6 @@
1
1
  <%= f.fields_for :blastn_job do |n| %>
2
2
  <p>
3
- <strong>blastn</strong>
3
+ <strong>blastn</strong>
4
4
  <%= n.check_box :queue %>
5
5
  </p>
6
6
  <div id="blastn" class="toggle">
@@ -10,7 +10,7 @@
10
10
  <label>Database(s)</label>
11
11
  </td>
12
12
  <td>
13
- <%= n.select :blast_dbs, @blast_dbs[:blastn], {}, { :multiple => true } %>
13
+ <%= n.select :blast_dbs, @blast_dbs[:blastn], {}, { :multiple => true } %>
14
14
  </td>
15
15
  <td>
16
16
  <%= n.label :filter, "DUST" %>
@@ -24,14 +24,14 @@
24
24
  <%= n.label :expectation %>
25
25
  </td>
26
26
  <td>
27
- <%= n.text_field :expectation, :size => 15, :title => "5e-20",
27
+ <%= n.text_field :expectation, :size => 15, :title => "5e-20",
28
28
  :class => "auto-hint" %>
29
29
  </td>
30
30
  <td>
31
31
  <%= n.label :min_bit_score %>
32
32
  </td>
33
33
  <td>
34
- <%= n.text_field :min_bit_score, :size => 15, :title => "0",
34
+ <%= n.text_field :min_bit_score, :size => 15, :title => "0",
35
35
  :class => "auto-hint" %>
36
36
  </td>
37
37
  </tr>
@@ -40,7 +40,7 @@
40
40
  <%= n.label :max_score %>
41
41
  </td>
42
42
  <td>
43
- <%= n.text_field :max_score, :size => 15, :title => "25",
43
+ <%= n.text_field :max_score, :size => 15, :title => "25",
44
44
  :class => "auto-hint" %>
45
45
  </td>
46
46
  <td>
@@ -55,8 +55,8 @@
55
55
  <%= n.label :gap_opening_extension %>
56
56
  </td>
57
57
  <td>
58
- <%=
59
- n.select :gap_opening_extension,
58
+ <%=
59
+ n.select :gap_opening_extension,
60
60
  options_for_select(
61
61
  @job.blastn_job.gap_opening_extension_values,
62
62
  @job.blastn_job.gap_opening_extension
@@ -1,6 +1,6 @@
1
1
  <%= f.fields_for :blastp_job do |n| %>
2
2
  <p>
3
- <strong>blastp</strong>
3
+ <strong>blastp</strong>
4
4
  <%= n.check_box :queue %>
5
5
  </p>
6
6
  <div id="blastp" class="toggle">
@@ -10,7 +10,7 @@
10
10
  <label>Database(s)</label>
11
11
  </td>
12
12
  <td>
13
- <%= n.select :blast_dbs, @blast_dbs[:blastp], {}, { :multiple => true } %>
13
+ <%= n.select :blast_dbs, @blast_dbs[:blastp], {}, { :multiple => true } %>
14
14
  </td>
15
15
  <td>
16
16
  <%= n.label :filter, "SEG" %>
@@ -24,14 +24,14 @@
24
24
  <%= n.label :expectation %>
25
25
  </td>
26
26
  <td>
27
- <%= n.text_field :expectation, :size => 15, :title => "5e-20",
27
+ <%= n.text_field :expectation, :size => 15, :title => "5e-20",
28
28
  :class => "auto-hint" %>
29
29
  </td>
30
30
  <td>
31
31
  <%= n.label :min_bit_score %>
32
32
  </td>
33
33
  <td>
34
- <%= n.text_field :min_bit_score, :size => 15, :title => "0",
34
+ <%= n.text_field :min_bit_score, :size => 15, :title => "0",
35
35
  :class => "auto-hint" %>
36
36
  </td>
37
37
  </tr>
@@ -40,7 +40,7 @@
40
40
  <%= n.label :max_score %>
41
41
  </td>
42
42
  <td>
43
- <%= n.text_field :max_score, :size => 15, :title => "25",
43
+ <%= n.text_field :max_score, :size => 15, :title => "25",
44
44
  :class => "auto-hint" %>
45
45
  </td>
46
46
  <td>
@@ -55,8 +55,8 @@
55
55
  <%= n.label :gap_opening_extension %>
56
56
  </td>
57
57
  <td>
58
- <%=
59
- n.select :gap_opening_extension,
58
+ <%=
59
+ n.select :gap_opening_extension,
60
60
  options_for_select(
61
61
  @job.blastn_job.gap_opening_extension_values,
62
62
  @job.blastn_job.gap_opening_extension
@@ -1,6 +1,6 @@
1
1
  <%= f.fields_for :blastx_job do |n| %>
2
2
  <p>
3
- <strong>blastx</strong>
3
+ <strong>blastx</strong>
4
4
  <%= n.check_box :queue %>
5
5
  </p>
6
6
  <div id="blastx" class="toggle">
@@ -10,7 +10,7 @@
10
10
  <label>Database(s)</label>
11
11
  </td>
12
12
  <td>
13
- <%= n.select :blast_dbs, @blast_dbs[:blastx], {}, { :multiple => true } %>
13
+ <%= n.select :blast_dbs, @blast_dbs[:blastx], {}, { :multiple => true } %>
14
14
  </td>
15
15
  <td>
16
16
  <%= n.label :filter, "SEG" %>
@@ -24,14 +24,14 @@
24
24
  <%= n.label :expectation %>
25
25
  </td>
26
26
  <td>
27
- <%= n.text_field :expectation, :size => 15, :title => "5e-20",
27
+ <%= n.text_field :expectation, :size => 15, :title => "5e-20",
28
28
  :class => "auto-hint" %>
29
29
  </td>
30
30
  <td>
31
31
  <%= n.label :min_bit_score %>
32
32
  </td>
33
33
  <td>
34
- <%= n.text_field :min_bit_score, :size => 15, :title => "0",
34
+ <%= n.text_field :min_bit_score, :size => 15, :title => "0",
35
35
  :class => "auto-hint" %>
36
36
  </td>
37
37
  </tr>
@@ -40,7 +40,7 @@
40
40
  <%= n.label :max_score %>
41
41
  </td>
42
42
  <td>
43
- <%= n.text_field :max_score, :size => 15, :title => "25",
43
+ <%= n.text_field :max_score, :size => 15, :title => "25",
44
44
  :class => "auto-hint" %>
45
45
  </td>
46
46
  <td>
@@ -55,8 +55,8 @@
55
55
  <%= n.label :gap_opening_extension %>
56
56
  </td>
57
57
  <td>
58
- <%=
59
- n.select :gap_opening_extension,
58
+ <%=
59
+ n.select :gap_opening_extension,
60
60
  options_for_select(
61
61
  @job.blastn_job.gap_opening_extension_values,
62
62
  @job.blastn_job.gap_opening_extension
@@ -1,6 +1,6 @@
1
1
  <%= f.fields_for :tblastn_job do |n| %>
2
2
  <p>
3
- <strong>tblastn</strong>
3
+ <strong>tblastn</strong>
4
4
  <%= n.check_box :queue %>
5
5
  </p>
6
6
  <div id="tblastn" class="toggle">
@@ -10,7 +10,7 @@
10
10
  <label>Database(s)</label>
11
11
  </td>
12
12
  <td>
13
- <%= n.select :blast_dbs, @blast_dbs[:tblastn], {}, { :multiple => true } %>
13
+ <%= n.select :blast_dbs, @blast_dbs[:tblastn], {}, { :multiple => true } %>
14
14
  </td>
15
15
  <td>
16
16
  <%= n.label :filter, "SEG" %>
@@ -24,14 +24,14 @@
24
24
  <%= n.label :expectation %>
25
25
  </td>
26
26
  <td>
27
- <%= n.text_field :expectation, :size => 15, :title => "5e-20",
27
+ <%= n.text_field :expectation, :size => 15, :title => "5e-20",
28
28
  :class => "auto-hint" %>
29
29
  </td>
30
30
  <td>
31
31
  <%= n.label :min_bit_score %>
32
32
  </td>
33
33
  <td>
34
- <%= n.text_field :min_bit_score, :size => 15, :title => "0",
34
+ <%= n.text_field :min_bit_score, :size => 15, :title => "0",
35
35
  :class => "auto-hint" %>
36
36
  </td>
37
37
  </tr>
@@ -40,7 +40,7 @@
40
40
  <%= n.label :max_score %>
41
41
  </td>
42
42
  <td>
43
- <%= n.text_field :max_score, :size => 15, :title => "25",
43
+ <%= n.text_field :max_score, :size => 15, :title => "25",
44
44
  :class => "auto-hint" %>
45
45
  </td>
46
46
  <td>
@@ -55,8 +55,8 @@
55
55
  <%= n.label :gap_opening_extension %>
56
56
  </td>
57
57
  <td>
58
- <%=
59
- n.select :gap_opening_extension,
58
+ <%=
59
+ n.select :gap_opening_extension,
60
60
  options_for_select(
61
61
  @job.blastn_job.gap_opening_extension_values,
62
62
  @job.blastn_job.gap_opening_extension
@@ -3,8 +3,8 @@
3
3
  <%= form_for @job, :html => {:id => "quorum_job"} do |f| %>
4
4
  <%= render "shared/error_messages", :target => @job %>
5
5
  <div>
6
- <%= f.text_area :sequence,
7
- :title => "Paste nucleic and amino acid FASTA sequence(s) here " <<
6
+ <%= f.text_area :sequence,
7
+ :title => "Paste nucleic and amino acid FASTA sequence(s) here " <<
8
8
  "or upload a file below.",
9
9
  :class => "auto-hint" %>
10
10
  </div>
@@ -15,32 +15,32 @@
15
15
  <!-- Comment out an algorithm below to remove it from the form. -->
16
16
 
17
17
  <!-- blastn -->
18
- <%= render :partial => "quorum/jobs/form/blastn_form", :locals => {
18
+ <%= render :partial => "quorum/jobs/form/blastn_form", :locals => {
19
19
  :f => f, :blast_dbs => @blast_dbs } %>
20
20
 
21
21
  <!-- blastx -->
22
- <%= render :partial => "quorum/jobs/form/blastx_form", :locals => {
22
+ <%= render :partial => "quorum/jobs/form/blastx_form", :locals => {
23
23
  :f => f, :blast_dbs => @blast_dbs } %>
24
24
 
25
25
  <!-- tblastn -->
26
- <%= render :partial => "quorum/jobs/form/tblastn_form", :locals => {
26
+ <%= render :partial => "quorum/jobs/form/tblastn_form", :locals => {
27
27
  :f => f, :blast_dbs => @blast_dbs } %>
28
28
 
29
29
  <!-- blastp -->
30
- <%= render :partial => "quorum/jobs/form/blastp_form", :locals => {
30
+ <%= render :partial => "quorum/jobs/form/blastp_form", :locals => {
31
31
  :f => f, :blast_dbs => @blast_dbs } %>
32
32
 
33
33
  <!-- End Search Algorithms -->
34
34
  <div>
35
35
  <%= f.submit "Submit" %>&nbsp;&nbsp;
36
- <%= submit_tag "Reset", :name => "reset",
36
+ <%= submit_tag "Reset", :name => "reset",
37
37
  :type => "button", :id => "quorum_job_reset" %>
38
38
  </div>
39
39
  <% end %>
40
40
  </div>
41
- <div id="quorum">
41
+ <div id="quorum">
42
42
  <hr class="big" />
43
- <p>
43
+ <p>
44
44
  Powered by <%= link_to "Quorum", "https://github.com/ncgr/quorum" %>
45
45
  </p>
46
46
  </div>
@@ -16,28 +16,28 @@
16
16
  <div id="tabs-1">
17
17
  <h2>Blastn</h2>
18
18
  <div id="blastn-results">
19
- Searching... <%= image_tag "quorum/loading.gif" %>
19
+ Searching... <%= image_tag "quorum/loading.gif" %>
20
20
  </div>
21
21
  </div>
22
22
 
23
23
  <div id="tabs-2">
24
24
  <h2>Blastx</h2>
25
25
  <div id="blastx-results">
26
- Searching... <%= image_tag "quorum/loading.gif" %>
26
+ Searching... <%= image_tag "quorum/loading.gif" %>
27
27
  </div>
28
28
  </div>
29
29
 
30
30
  <div id="tabs-3">
31
31
  <h2>Tblastn</h2>
32
32
  <div id="tblastn-results">
33
- Searching... <%= image_tag "quorum/loading.gif" %>
33
+ Searching... <%= image_tag "quorum/loading.gif" %>
34
34
  </div>
35
35
  </div>
36
36
 
37
37
  <div id="tabs-4">
38
38
  <h2>Blastp</h2>
39
39
  <div id="blastp-results">
40
- Searching... <%= image_tag "quorum/loading.gif" %>
40
+ Searching... <%= image_tag "quorum/loading.gif" %>
41
41
  </div>
42
42
  </div>
43
43
  </div>
@@ -47,9 +47,9 @@
47
47
  <!-- Detailed report element -->
48
48
  <div id="detailed_report_dialog" title="Quorum Report Details"></div>
49
49
  </div>
50
- <div id="quorum">
50
+ <div id="quorum">
51
51
  <hr class="big" />
52
- <p>
52
+ <p>
53
53
  Powered by <%= link_to "Quorum", "https://github.com/ncgr/quorum" %>
54
54
  </p>
55
55
  </div>
@@ -63,7 +63,7 @@
63
63
  //
64
64
  // Asynchronously poll Quorum for search results.
65
65
  //
66
- // pollResults(id, interval)
66
+ // pollResults(id, interval)
67
67
  // id: Job.id
68
68
  // interval: poll interval in milliseconds. 5000 default.
69
69
  //
@@ -8,8 +8,8 @@
8
8
  {{ var hseq = v.hseq }}
9
9
  {{ var q_from = v.query_from }}
10
10
  {{ var q_to = v.query_to }}
11
- {{ var h_from = v.hit_from }}
12
- {{ var h_to = v.hit_to }}
11
+ {{ var h_from = v.hit_from }}
12
+ {{ var h_to = v.hit_to }}
13
13
  {{ var qstrand = v.query_frame }}
14
14
  {{ var hstrand = v.hit_frame }}
15
15
  {{ var hsp_group = v.hsp_group }}
@@ -40,7 +40,7 @@
40
40
  </tr>
41
41
  </table>
42
42
  <p class="small">
43
- <a id="download_sequence_{{= id }}"
43
+ <a id="download_sequence_{{= id }}"
44
44
  onclick="QUORUM.downloadSequence(<%= @jobs.id %>, {{= id }}, '{{= algo }}', this)">
45
45
  Download Sequence
46
46
  </a>
@@ -50,11 +50,11 @@
50
50
  <td class="right">{{= v.align_len }}</td>
51
51
  <td class="right">{{= v.bit_score }}</td>
52
52
  <td class="right">
53
- <a class="detailed_report"
53
+ <a class="detailed_report"
54
54
  onclick="QUORUM.viewDetailedReport(
55
- <%= @jobs.id %>,
56
- {{= v.id }},
57
- '{{= v.query }}',
55
+ <%= @jobs.id %>,
56
+ {{= v.id }},
57
+ '{{= v.query }}',
58
58
  '{{= algo }}')">
59
59
  {{= v.evalue }}
60
60
  </a>
@@ -12,7 +12,7 @@ module Quorum
12
12
  DEPENDENCIES = ["makeblastdb", "seqret"]
13
13
 
14
14
  def copy_quorum
15
- template "quorum_initializer.rb",
15
+ template "quorum_initializer.rb",
16
16
  "config/initializers/quorum_initializer.rb"
17
17
  template "quorum_settings.yml", "config/quorum_settings.yml"
18
18
  template "search", "quorum/bin/search"
@@ -45,7 +45,7 @@ module Quorum
45
45
  @quorum = %Q(mount Quorum::Engine => "/quorum")
46
46
  @resque = %Q(mount Resque::Server.new, :at => "/quorum/resque")
47
47
  end
48
-
48
+
49
49
  def read_routes_file
50
50
  @routes = File.open(File.join("config", "routes.rb"), "r")
51
51
  @routes = @routes.read
@@ -56,7 +56,7 @@ module Quorum
56
56
  end
57
57
 
58
58
  def add_mount_engine
59
- route @quorum unless mount_engine_exists?
59
+ route @quorum unless mount_engine_exists?
60
60
  end
61
61
 
62
62
  def resque_mount_engine_exists?
@@ -1,16 +1,17 @@
1
1
  module Quorum
2
2
  module Generators
3
3
  class ViewsGenerator < Rails::Generators::Base
4
- source_root File.expand_path("../../../../app/views/quorum", __FILE__)
4
+ source_root File.expand_path("../../../../app/views", __FILE__)
5
5
  desc "Copy quorum views to your application."
6
6
 
7
- VIEW_DIRECTORIES = [
8
- "jobs"
7
+ DIRECTORIES = [
8
+ "quorum/jobs",
9
+ "layouts/quorum"
9
10
  ]
10
11
 
11
- def copy_views
12
- VIEW_DIRECTORIES.each do |d|
13
- directory d.to_s, "app/views/quorum/#{d.to_s}"
12
+ def copy_directories
13
+ DIRECTORIES.each do |d|
14
+ directory d.to_s, "app/views/#{d.to_s}"
14
15
  end
15
16
  end
16
17
  end
@@ -6,8 +6,8 @@ Thanks for installing Quorum!!
6
6
  Quorum Manual Setup:
7
7
 
8
8
  1. Ensure you have defined root_url in your config/routes.rb.
9
- If you are deploying Quorum as a standalone application,
10
- add the below after the engine is mounted.
9
+ If you are deploying Quorum as a standalone application,
10
+ add the below after the engine is mounted.
11
11
 
12
12
  mount Quorum::Engine => "/quorum"
13
13
 
@@ -19,7 +19,7 @@ Quorum Manual Setup:
19
19
 
20
20
  For all available quorum:blastdb:build options
21
21
 
22
- rake -D
22
+ rake -D
23
23
 
24
24
  ==============================================================================
25
25
 
@@ -13,9 +13,9 @@ module Quorum
13
13
  class QuorumJob < ActiveRecord::Base
14
14
  self.table_name = "quorum_jobs"
15
15
 
16
- has_one :quorum_blastn_job,
16
+ has_one :quorum_blastn_job,
17
17
  :foreign_key => "job_id"
18
- has_many :quorum_blastn_job_reports,
18
+ has_many :quorum_blastn_job_reports,
19
19
  :foreign_key => "blastn_job_id"
20
20
 
21
21
  has_one :quorum_blastx_job,
@@ -217,7 +217,7 @@ module Quorum
217
217
  File.open(@na_fasta, "w") { |f| f << @na_sequence }
218
218
  File.open(@aa_fasta, "w") { |f| f << @aa_sequence }
219
219
 
220
- @out = File.join(@tmp, @hash + ".out.xml")
220
+ @out = File.join(@tmp, @hash + ".out.xml")
221
221
  File.new(@out, "w")
222
222
 
223
223
  case @algorithm
@@ -241,7 +241,7 @@ module Quorum
241
241
  unless e.nil?
242
242
  e = " x 10<sup>" << e.sub(/e/, '') << "</sup>"
243
243
  end
244
- evalue.to_f.round(1).to_s << e.to_s
244
+ evalue.to_f.round(1).to_s << e.to_s
245
245
  end
246
246
 
247
247
  #
@@ -269,7 +269,7 @@ module Quorum
269
269
 
270
270
  #
271
271
  # Parse and save Blast results using bio-blastxmlparser.
272
- # Only save Blast results if results.bit_score > @min_score.
272
+ # Only save Blast results if results.bit_score > @min_score.
273
273
  #
274
274
  def parse_and_save_results
275
275
  # Helper to avoid having to perform a query.
@@ -311,7 +311,7 @@ module Quorum
311
311
 
312
312
  # Hsps are only reported if a query hit against the Blast db.
313
313
  # Only save the @data if bit_score exists.
314
- if @data[:bit_score] &&
314
+ if @data[:bit_score] &&
315
315
  (@data[:bit_score].to_i > @min_score.to_i)
316
316
  @data[:results] = true
317
317
  @data["#{@algorithm}_job_id".to_sym] = @job.method(@job_association).call.job_id
@@ -410,7 +410,7 @@ module Quorum
410
410
  # Execute Blast on a given dataset.
411
411
  #
412
412
  def execute_blast
413
- generate_blast_cmd
413
+ generate_blast_cmd
414
414
  @logger.log("NCBI Blast", @cmd)
415
415
  system(@cmd)
416
416
  parse_and_save_results
@@ -77,10 +77,10 @@ module Quorum
77
77
  #
78
78
  # Execute the blastdbcmd(s) and return the matching sequence.
79
79
  #
80
- # To make Blast execute as quickly as possible, each selected
81
- # algorithm blasts against all supplied databases at once.
82
- #
83
- # See quorum/lib/search_tools/blast.rb for more information.
80
+ # To make Blast execute as quickly as possible, each selected
81
+ # algorithm blasts against all supplied databases at once.
82
+ #
83
+ # See quorum/lib/search_tools/blast.rb for more information.
84
84
  #
85
85
  # One consequence of this is not knowing which Blast database to use
86
86
  # when retrieving a hit sequence via blastdbcmd.
@@ -93,10 +93,10 @@ module Quorum
93
93
  def execute_blast_db_cmd
94
94
  generate_blast_db_cmds
95
95
  @logger.log("NCBI Blast", @cmds.join('; '))
96
-
96
+
97
97
  @seqs = ""
98
98
  @cmds.each { |c| @seqs << `#{c} 2> /dev/null` }
99
-
99
+
100
100
  seq = parse_and_send_results
101
101
  $stdout.print seq
102
102
  end
@@ -37,7 +37,7 @@ Options:
37
37
  :required => true, :short => "-l"
38
38
  opt :tmp_directory, "Path to tmp directory", :type => :string,
39
39
  :required => true, :short => "-m"
40
-
40
+
41
41
  # Global settings
42
42
  opt :fetch_database, "Path to fetch tool database", :type => :string,
43
43
  :short => "-d"
@@ -46,7 +46,7 @@ Options:
46
46
 
47
47
  # Algorithm specific opts
48
48
  opt :blast_hit_id, "Blast hit id", :type => :string, :short => "-b"
49
- opt :blast_hit_display_id, "Blast hit display id", :type => :string,
49
+ opt :blast_hit_display_id, "Blast hit display id", :type => :string,
50
50
  :short => "-s"
51
51
  opt :blast_algo, "Blast algorithm", :type => :string, :short => "-a"
52
52
  end
@@ -110,6 +110,6 @@ Options:
110
110
  end
111
111
 
112
112
  if __FILE__ == $0
113
- Quorum::Fetch.new
113
+ Quorum::Fetch.new
114
114
  end
115
115
 
@@ -10,7 +10,7 @@ settings = YAML.load_file(
10
10
 
11
11
  ## Sub %{RAILS_ROOT} ##
12
12
  settings.keys.each do |k|
13
- settings[k.to_s].each_value do |v|
13
+ settings[k.to_s].each_value do |v|
14
14
  if v.kind_of?(String)
15
15
  v.to_s.gsub!('%{RAILS_ROOT}', ::Rails.root.to_s)
16
16
  end
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ==> General
4
4
  # Quorum initializer safely substitutes %{RAILS_ROOT} with ::Rails.root.to_s.
5
- #
5
+ #
6
6
  # ==> NCBI BLAST+ Settings
7
7
  # blast:
8
8
  # remote: true to execute script on remote machine via
@@ -33,8 +33,8 @@ Options:
33
33
  HEAD
34
34
 
35
35
  # Search tool
36
- opt :search_tool, "Search tool to execute. Available tools: " <<
37
- "#{SEARCH_TOOLS.keys.join(', ')}", :type => :string,
36
+ opt :search_tool, "Search tool to execute. Available tools: " <<
37
+ "#{SEARCH_TOOLS.keys.join(', ')}", :type => :string,
38
38
  :required => true, :short => "-s"
39
39
 
40
40
  # General settings
@@ -48,19 +48,19 @@ Options:
48
48
  :short => "-i"
49
49
  opt :database, "Database name", :type => :string, :required => true,
50
50
  :short => "-d"
51
- opt :database_adapter, "ActiveRecord database adapter",
51
+ opt :database_adapter, "ActiveRecord database adapter",
52
52
  :type => :string, :required => true, :short => "-a"
53
- opt :database_host, "Database host", :type => :string,
53
+ opt :database_host, "Database host", :type => :string,
54
54
  :required => true, :short => "-k"
55
- opt :database_user, "Database username", :type => :string,
55
+ opt :database_user, "Database username", :type => :string,
56
56
  :required => true, :short => "-u"
57
57
  opt :database_password, "Database password", :type => :string,
58
58
  :required => true, :short => "-p"
59
-
59
+
60
60
  # Global settings
61
61
  opt :search_database, "Path to search tool database", :type => :string,
62
62
  :short => "-b"
63
- opt :threads, "Number of threads to spawn for search tool",
63
+ opt :threads, "Number of threads to spawn for search tool",
64
64
  :type => :int, :short => "-t"
65
65
  end
66
66
 
@@ -136,6 +136,6 @@ Options:
136
136
  end
137
137
 
138
138
  if __FILE__ == $0
139
- Quorum::Search.new
139
+ Quorum::Search.new
140
140
  end
141
141
 
@@ -12,7 +12,7 @@ VERSION = "1.16.2"
12
12
  ## Thrown by Parser in the event of a commandline error. Not needed if
13
13
  ## you're using the Trollop::options entry.
14
14
  class CommandlineError < StandardError; end
15
-
15
+
16
16
  ## Thrown by Parser if the user passes in '-h' or '--help'. Handled
17
17
  ## automatically by Trollop#options.
18
18
  class HelpNeeded < StandardError; end
@@ -250,7 +250,7 @@ class Parser
250
250
  syms.each { |sym| raise ArgumentError, "unknown option '#{sym}'" unless @specs[sym] }
251
251
  @constraints << [:depends, syms]
252
252
  end
253
-
253
+
254
254
  ## Marks two (or more!) options as conflicting.
255
255
  def conflicts *syms
256
256
  syms.each { |sym| raise ArgumentError, "unknown option '#{sym}'" unless @specs[sym] }
@@ -426,7 +426,7 @@ class Parser
426
426
  # call this unless the cursor's at the beginning of a line.
427
427
 
428
428
  left = {}
429
- @specs.each do |name, spec|
429
+ @specs.each do |name, spec|
430
430
  left[name] = "--#{spec[:long]}" +
431
431
  (spec[:short] && spec[:short] != :none ? ", -#{spec[:short]}" : "") +
432
432
  case spec[:type]
@@ -647,7 +647,7 @@ private
647
647
  start = 0
648
648
  ret = []
649
649
  until start > str.length
650
- nextt =
650
+ nextt =
651
651
  if start + width >= str.length
652
652
  str.length
653
653
  else