quorum 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -13,7 +13,7 @@ module Quorum
13
13
  # to ensure FASTA format.
14
14
  #
15
15
  def write_input_sequence_to_file(tmp_dir, hash, sequence)
16
- seq = File.join(tmp_dir, hash + ".seq")
16
+ seq = File.join(tmp_dir, hash + ".seq")
17
17
  File.open(seq, "w") do |f|
18
18
  f << sequence
19
19
  end
@@ -35,19 +35,19 @@ module Quorum
35
35
  #
36
36
  # Subtracting all AA single letter chars from NA single letter chars
37
37
  # (including ALL ambiguity codes for each!) leaves us with
38
- # EQILFP. If a sequence contains EQILFP, it's safe to call it an AA.
38
+ # EQILFP. If a sequence contains EQILFP, it's safe to call it an AA.
39
39
  #
40
40
  # See single letter char tables for more information:
41
41
  # http://en.wikipedia.org/wiki/Proteinogenic_amino_acid
42
42
  # http://www.chick.manchester.ac.uk/SiteSeer/IUPAC_codes.html
43
43
  #
44
- # If a sequence doesn't contain EQILFP, it could be either an AA
44
+ # If a sequence doesn't contain EQILFP, it could be either an AA
45
45
  # or NA. To distinguish the two, count the number of As Ts Gs Cs
46
46
  # and Ns, divide by the the length of the sequence and * 100.
47
47
  #
48
48
  # If the percentage of A, T, U, G, C or N is >= 15.0, call it a NA.
49
- # 15% was choosen based on the data in the table
50
- # "Relative proportions (%) of bases in DNA"
49
+ # 15% was choosen based on the data in the table
50
+ # "Relative proportions (%) of bases in DNA"
51
51
  # (http://en.wikipedia.org/wiki/Chargaff's_rules) and the
52
52
  # precentage of AAs found in peptides
53
53
  # (http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2590925/).
@@ -75,7 +75,7 @@ module Quorum
75
75
 
76
76
  n = (seq.count("N").to_f / len) * 100
77
77
 
78
- if (a >= na_percent) || (t >= na_percent) || (u >= na_percent) ||
78
+ if (a >= na_percent) || (t >= na_percent) || (u >= na_percent) ||
79
79
  (g >= na_percent) || (c >= na_percent) || (n >= na_percent)
80
80
  type = "nucleic_acid"
81
81
  else
@@ -1,3 +1,3 @@
1
1
  module Quorum
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/lib/quorum.rb CHANGED
@@ -12,7 +12,7 @@ module Quorum
12
12
  ## Supported Algorithms ##
13
13
  BLAST_ALGORITHMS = ["blastn", "blastx", "blastp", "tblastn"]
14
14
 
15
- mattr_accessor :blast_remote, :blast_ssh_host, :blast_ssh_user,
15
+ mattr_accessor :blast_remote, :blast_ssh_host, :blast_ssh_user,
16
16
  :blast_ssh_options, :blast_bin, :blast_log_dir, :blast_tmp_dir,
17
17
  :blast_db, :tblastn, :blastp, :blastn, :blastx, :blast_threads
18
18
 
@@ -56,14 +56,14 @@ module Quorum
56
56
  Dir.mkdir(@log_dir) unless File.directory?(@log_dir)
57
57
  rescue SystemCallError => e
58
58
  @output.puts e.message
59
- raise "Unable to make directory. " <<
59
+ raise "Unable to make directory. " <<
60
60
  "Perhaps you forgot to execute the quorum initializer. \n\n" <<
61
61
  "rails generate quorum:install"
62
62
  end
63
63
  end
64
64
 
65
65
  #
66
- # Create directories per tarball and return tarball file name
66
+ # Create directories per tarball and return tarball file name
67
67
  # minus the file extension.
68
68
  #
69
69
  def create_file_name(file, base_dir)
@@ -120,7 +120,7 @@ module Quorum
120
120
  contigs = File.join(d, "contigs.fa")
121
121
  peptides = File.join(d, "peptides.fa")
122
122
 
123
- found = false
123
+ found = false
124
124
 
125
125
  if File.exists?(contigs) && File.readable?(contigs)
126
126
  execute_makeblastdb("nucl", d, contigs)
@@ -164,7 +164,7 @@ module Quorum
164
164
  end
165
165
 
166
166
  unless VALID_TYPES.include?(@type)
167
- raise "Unknown type: #{@type}. " <<
167
+ raise "Unknown type: #{@type}. " <<
168
168
  "Please provide one: both, nucl or prot."
169
169
  end
170
170
 
@@ -174,7 +174,7 @@ module Quorum
174
174
 
175
175
  begin
176
176
  @dir.split(':').each do |d|
177
- unless File.directory?(d)
177
+ unless File.directory?(d)
178
178
  raise "Directory not found: #{d}"
179
179
  end
180
180
 
@@ -187,11 +187,11 @@ module Quorum
187
187
 
188
188
  @data.each do |s|
189
189
  if s =~ GZIP
190
- files = `tar -tzf #{s}`
190
+ files = `tar -tzf #{s}`
191
191
  flag = "z"
192
192
  elsif s =~ BZIP
193
193
  files = `tar -tjf #{s}`
194
- flag = "j"
194
+ flag = "j"
195
195
  end
196
196
  files = files.split(/\n/)
197
197
  files.each do |f|
@@ -8,10 +8,10 @@ require 'build_blast_db'
8
8
 
9
9
  namespace :quorum do
10
10
  namespace :blastdb do
11
- desc "Build Blast Database (options: DIR=/path/to/data " <<
12
- "{valid extensions: .tar.gz .tgz .tar.bz2 .tbz} " <<
13
- "-- separate multiple directories with a colon. " <<
14
- "TYPE={both}{prot}{nucl} -- defaults to both. " <<
11
+ desc "Build Blast Database (options: DIR=/path/to/data " <<
12
+ "{valid extensions: .tar.gz .tgz .tar.bz2 .tbz} " <<
13
+ "-- separate multiple directories with a colon. " <<
14
+ "TYPE={both}{prot}{nucl} -- defaults to both. " <<
15
15
  "PROT_FILE_NAME= -- defaults to peptides.fa. " <<
16
16
  "NUCL_FILE_NAME= -- defaults to contigs.fa. " <<
17
17
  "REBUILD_DB= {true or false} -- remove existing blast database(s). " <<
@@ -39,9 +39,9 @@ namespace :quorum do
39
39
  args[:nucl_file] = args[:nucl_file].downcase.strip
40
40
  args[:nucl_file] = "NULL" if args[:type] == "prot"
41
41
  args[:prot_file] = "NULL" if args[:type] == "nucl"
42
-
42
+
43
43
  puts "Building your Blast database(s). This may take a while..."
44
-
44
+
45
45
  build = Quorum::BuildBlastDB.new(args)
46
46
  build.build_blast_db_data
47
47
  end
@@ -1,4 +1,4 @@
1
- module Workers
1
+ module Workers
2
2
  class System
3
3
  extend Resque::Plugins::Result
4
4
 
@@ -24,7 +24,7 @@ module Workers
24
24
  Net::SSH.start(ssh_host, ssh_user, ssh_options) do |ssh|
25
25
  ssh.open_channel do |ch|
26
26
  ch.exec(cmd) do |ch, success|
27
- unless success
27
+ unless success
28
28
  Rails.logger.warn "Channel Net::SSH exec() failed. :'("
29
29
  else
30
30
  # Capture STDOUT from ch.exec()
data/quorum.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.summary = "Flexible bioinformatics search tool."
14
14
  s.description = "Flexible bioinformatics search tool."
15
15
 
16
- s.files = `git ls-files`.split(/\n/)
16
+ s.files = `git ls-files`.split(/\n/)
17
17
 
18
18
  s.add_dependency "rails", "~> 3.1"
19
19
  s.add_dependency "jquery-rails"
Binary file
Binary file
@@ -12,7 +12,7 @@
12
12
  <!-- blastn -->
13
13
 
14
14
  <p>
15
- <strong>blastn</strong>
15
+ <strong>blastn</strong>
16
16
  <input name="job[blastn_job_attributes][queue]" type="hidden" value="0" /><input id="job_blastn_job_attributes_queue" name="job[blastn_job_attributes][queue]" type="checkbox" value="1" />
17
17
  </p>
18
18
  <div id="blastn" class="toggle">
@@ -57,7 +57,7 @@
57
57
  <option value="taxus_x_media-20100126">Taxus x media transcripts, build 20100126</option>
58
58
  <option value="taxus_x_media-20100406">Taxus x media transcripts, build 20100406</option>
59
59
  <option value="taxus_x_media-20101112">Taxus x media transcripts, build 20101112</option>
60
- <option value="medp_trire-20110120">Tripterygium regelii transcripts, build 20110120</option></select>
60
+ <option value="medp_trire-20110120">Tripterygium regelii transcripts, build 20110120</option></select>
61
61
  </td>
62
62
  <td>
63
63
  <label for="job_blastn_job_attributes_filter">DUST</label>
@@ -124,7 +124,7 @@
124
124
  <!-- blastx -->
125
125
 
126
126
  <p>
127
- <strong>blastx</strong>
127
+ <strong>blastx</strong>
128
128
  <input name="job[blastx_job_attributes][queue]" type="hidden" value="0" /><input id="job_blastx_job_attributes_queue" name="job[blastx_job_attributes][queue]" type="checkbox" value="1" />
129
129
  </p>
130
130
  <div id="blastx" class="toggle">
@@ -167,7 +167,7 @@
167
167
  <option value="podophyllum_peltatum-20101112">Podophyllum peltatum peptides, build 20101112</option>
168
168
  <option value="taxus_x_media-20100406">Taxus x media peptides, build 20100406</option>
169
169
  <option value="taxus_x_media-20101112">Taxus x media peptides, build 20101112</option>
170
- <option value="medp_trire-20110120">Tripterygium regelii peptides, build 20110120</option></select>
170
+ <option value="medp_trire-20110120">Tripterygium regelii peptides, build 20110120</option></select>
171
171
  </td>
172
172
  <td>
173
173
  <label for="job_blastx_job_attributes_filter">SEG</label>
@@ -234,7 +234,7 @@
234
234
  <!-- tblastn -->
235
235
 
236
236
  <p>
237
- <strong>tblastn</strong>
237
+ <strong>tblastn</strong>
238
238
  <input name="job[tblastn_job_attributes][queue]" type="hidden" value="0" /><input id="job_tblastn_job_attributes_queue" name="job[tblastn_job_attributes][queue]" type="checkbox" value="1" />
239
239
  </p>
240
240
  <div id="tblastn" class="toggle">
@@ -279,7 +279,7 @@
279
279
  <option value="taxus_x_media-20100126">Taxus x media transcripts, build 20100126</option>
280
280
  <option value="taxus_x_media-20100406">Taxus x media transcripts, build 20100406</option>
281
281
  <option value="taxus_x_media-20101112">Taxus x media transcripts, build 20101112</option>
282
- <option value="medp_trire-20110120">Tripterygium regelii transcripts, build 20110120</option></select>
282
+ <option value="medp_trire-20110120">Tripterygium regelii transcripts, build 20110120</option></select>
283
283
  </td>
284
284
  <td>
285
285
  <label for="job_tblastn_job_attributes_filter">SEG</label>
@@ -346,7 +346,7 @@
346
346
  <!-- blastp -->
347
347
 
348
348
  <p>
349
- <strong>blastp</strong>
349
+ <strong>blastp</strong>
350
350
  <input name="job[blastp_job_attributes][queue]" type="hidden" value="0" /><input id="job_blastp_job_attributes_queue" name="job[blastp_job_attributes][queue]" type="checkbox" value="1" />
351
351
  </p>
352
352
  <div id="blastp" class="toggle">
@@ -389,7 +389,7 @@
389
389
  <option value="podophyllum_peltatum-20101112">Podophyllum peltatum peptides, build 20101112</option>
390
390
  <option value="taxus_x_media-20100406">Taxus x media peptides, build 20100406</option>
391
391
  <option value="taxus_x_media-20101112">Taxus x media peptides, build 20101112</option>
392
- <option value="medp_trire-20110120">Tripterygium regelii peptides, build 20110120</option></select>
392
+ <option value="medp_trire-20110120">Tripterygium regelii peptides, build 20110120</option></select>
393
393
  </td>
394
394
  <td>
395
395
  <label for="job_blastp_job_attributes_filter">SEG</label>
@@ -4,50 +4,50 @@
4
4
 
5
5
  describe("QUORUM", function() {
6
6
 
7
- //
7
+ //
8
8
  // Spec covers QUORUM.formatSequenceReport & QUORUM.addBaseTitleIndex.
9
9
  //
10
10
  // Blastn should increment qseq's title by 1 and hseq's title by 1.
11
11
  //
12
12
  it("formats blastn sequence report for Blast detailed report", function() {
13
13
  var report = QUORUM.formatSequenceReport(
14
- "ACGT", "|| |", "ACCT", 6, 9, 2, 8, "blastn"
14
+ "ACGT", "|| |", "ACCT", 6, 9, 2, 8, "blastn"
15
15
  );
16
16
  expect(report).toEqual("<p class='small'>Alignment (Mouse over for positions):</p><span class='small'><pre>\nqseq <a rel='quorum-tipsy' title=6>A</a><a rel='quorum-tipsy' title=7>C</a><a rel='quorum-tipsy' title=8>G</a><a rel='quorum-tipsy' title=9>T</a>\n || |\nhseq <a rel='quorum-tipsy' title=2>A</a><a rel='quorum-tipsy' title=3>C</a><a rel='quorum-tipsy' title=4>C</a><a rel='quorum-tipsy' title=5>T</a>\n\n</pre></span>");
17
17
  });
18
18
 
19
- //
19
+ //
20
20
  // Spec covers QUORUM.formatSequenceReport & QUORUM.addBaseTitleIndex.
21
21
  //
22
22
  // Blastx should increment qseq's title by 3 and hseq's title by 1.
23
23
  //
24
24
  it("formats blastx sequence report for Blast detailed report", function() {
25
25
  var report = QUORUM.formatSequenceReport(
26
- "ACGT", "|| |", "ACCT", 6, 9, 2, 8, "blastx"
26
+ "ACGT", "|| |", "ACCT", 6, 9, 2, 8, "blastx"
27
27
  );
28
28
  expect(report).toEqual("<p class='small'>Alignment (Mouse over for positions):</p><span class='small'><pre>\nqseq <a rel='quorum-tipsy' title=6>A</a><a rel='quorum-tipsy' title=9>C</a><a rel='quorum-tipsy' title=12>G</a><a rel='quorum-tipsy' title=15>T</a>\n || |\nhseq <a rel='quorum-tipsy' title=2>A</a><a rel='quorum-tipsy' title=3>C</a><a rel='quorum-tipsy' title=4>C</a><a rel='quorum-tipsy' title=5>T</a>\n\n</pre></span>");
29
29
  });
30
30
 
31
- //
31
+ //
32
32
  // Spec covers QUORUM.formatSequenceReport & QUORUM.addBaseTitleIndex.
33
33
  //
34
34
  // Tblastn should increment qseq's title by 1 and hseq's title by 3.
35
35
  //
36
36
  it("formats tblastn sequence report for Blast detailed report", function() {
37
37
  var report = QUORUM.formatSequenceReport(
38
- "ELVIS", "ELVIS", "ELVIS", 10, 14, 121, 136, "tblastn"
38
+ "ELVIS", "ELVIS", "ELVIS", 10, 14, 121, 136, "tblastn"
39
39
  );
40
40
  expect(report).toEqual("<p class='small'>Alignment (Mouse over for positions):</p><span class='small'><pre>\nqseq <a rel='quorum-tipsy' title=10>E</a><a rel='quorum-tipsy' title=11>L</a><a rel='quorum-tipsy' title=12>V</a><a rel='quorum-tipsy' title=13>I</a><a rel='quorum-tipsy' title=14>S</a>\n ELVIS\nhseq <a rel='quorum-tipsy' title=121>E</a><a rel='quorum-tipsy' title=124>L</a><a rel='quorum-tipsy' title=127>V</a><a rel='quorum-tipsy' title=130>I</a><a rel='quorum-tipsy' title=133>S</a>\n\n</pre></span>");
41
41
  });
42
42
 
43
- //
43
+ //
44
44
  // Spec covers QUORUM.formatSequenceReport & QUORUM.addBaseTitleIndex.
45
45
  //
46
46
  // Blastp should increment qseq's title by 1 and hseq's title by 1.
47
47
  //
48
48
  it("formats blastx sequence report for Blast detailed report", function() {
49
49
  var report = QUORUM.formatSequenceReport(
50
- "ELVIS", "ELVIS", "ELVIS", 10, 14, 121, 125, "blastp"
50
+ "ELVIS", "ELVIS", "ELVIS", 10, 14, 121, 125, "blastp"
51
51
  );
52
52
  expect(report).toEqual("<p class='small'>Alignment (Mouse over for positions):</p><span class='small'><pre>\nqseq <a rel='quorum-tipsy' title=10>E</a><a rel='quorum-tipsy' title=11>L</a><a rel='quorum-tipsy' title=12>V</a><a rel='quorum-tipsy' title=13>I</a><a rel='quorum-tipsy' title=14>S</a>\n ELVIS\nhseq <a rel='quorum-tipsy' title=121>E</a><a rel='quorum-tipsy' title=122>L</a><a rel='quorum-tipsy' title=123>V</a><a rel='quorum-tipsy' title=124>I</a><a rel='quorum-tipsy' title=125>S</a>\n\n</pre></span>");
53
53
  });
@@ -65,19 +65,19 @@ describe("QUORUM", function() {
65
65
 
66
66
  it("prints hit strand as forward / forward for + / + intergers", function() {
67
67
  expect(QUORUM.formatStrand(1, 1)).toEqual("forward / forward");
68
- });
68
+ });
69
69
 
70
70
  it("prints hit strand as forward / reverse for + / - integers", function() {
71
71
  expect(QUORUM.formatStrand(1, -1)).toEqual("forward / reverse");
72
- });
72
+ });
73
73
 
74
74
  it("prints hit strand as reverse / forward for - / + integers", function() {
75
75
  expect(QUORUM.formatStrand(-1, 1)).toEqual("reverse / forward");
76
- });
76
+ });
77
77
 
78
78
  it("prints hit strand as reverse / reverse for - / - integers", function() {
79
79
  expect(QUORUM.formatStrand(-1, -1)).toEqual("reverse / reverse");
80
- });
80
+ });
81
81
 
82
82
  //
83
83
  // Only print links to HSPs whers data id != focus.
@@ -2,12 +2,12 @@ describe("String", function() {
2
2
 
3
3
  it("truncates a string to length n", function() {
4
4
  var str = "this is a long string.";
5
- expect(str.trunc(5)).toEqual("this...");
5
+ expect(str.trunc(5)).toEqual("this...");
6
6
  });
7
7
 
8
8
  it("truncates a string to length n", function() {
9
9
  var str = "this is a long string.";
10
- expect(str.trunc(15)).toEqual("this is a long...");
10
+ expect(str.trunc(15)).toEqual("this is a long...");
11
11
  });
12
12
 
13
13
  it("doesn't truncate string when length is less than n", function() {
@@ -1,13 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Quorum::BlastnJobReport do
4
-
4
+
5
5
  it "should respond to default_order" do
6
- Quorum::BlastnJobReport.methods.should include(:default_order)
6
+ Quorum::BlastnJobReport.methods.should include(:default_order)
7
7
  end
8
8
 
9
9
  it "should respond to by_query" do
10
- Quorum::BlastnJobReport.methods.should include(:by_query)
10
+ Quorum::BlastnJobReport.methods.should include(:by_query)
11
11
  end
12
12
 
13
13
  end
@@ -1,13 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Quorum::BlastpJobReport do
4
-
4
+
5
5
  it "should respond to default_order" do
6
- Quorum::BlastpJobReport.methods.should include(:default_order)
6
+ Quorum::BlastpJobReport.methods.should include(:default_order)
7
7
  end
8
8
 
9
9
  it "should respond to by_query" do
10
- Quorum::BlastpJobReport.methods.should include(:by_query)
10
+ Quorum::BlastpJobReport.methods.should include(:by_query)
11
11
  end
12
12
 
13
13
  end
@@ -1,13 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Quorum::BlastxJobReport do
4
-
4
+
5
5
  it "should respond to default_order" do
6
- Quorum::BlastxJobReport.methods.should include(:default_order)
6
+ Quorum::BlastxJobReport.methods.should include(:default_order)
7
7
  end
8
8
 
9
9
  it "should respond to default_order" do
10
- Quorum::BlastxJobReport.methods.should include(:by_query)
10
+ Quorum::BlastxJobReport.methods.should include(:by_query)
11
11
  end
12
12
 
13
13
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Quorum::Job do
4
-
4
+
5
5
  before(:each) do
6
6
  @job = Quorum::Job.new()
7
7
  ResqueSpec.reset!
@@ -1,13 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Quorum::TblastnJobReport do
4
-
4
+
5
5
  it "should respond to default_order" do
6
- Quorum::TblastnJobReport.methods.should include(:default_order)
6
+ Quorum::TblastnJobReport.methods.should include(:default_order)
7
7
  end
8
8
 
9
9
  it "should respond to default_order" do
10
- Quorum::TblastnJobReport.methods.should include(:by_query)
10
+ Quorum::TblastnJobReport.methods.should include(:by_query)
11
11
  end
12
12
 
13
13
  end
@@ -9,7 +9,7 @@ describe "Quorum::Sequence" do
9
9
  sequence = File.open(
10
10
  File.expand_path("../../data/nucl_prot_seqs.txt", __FILE__)
11
11
  ).read
12
- create_hash(sequence).should_not be_nil
12
+ create_hash(sequence).should_not be_nil
13
13
  end
14
14
  end
15
15
 
@@ -16,7 +16,7 @@ describe "Jobs" do
16
16
  fill_in "job_sequence", :with => ""
17
17
  click_button "Submit"
18
18
 
19
- page.should have_content("Please enter your sequence(s) in Plain Text " <<
19
+ page.should have_content("Please enter your sequence(s) in Plain Text " <<
20
20
  "as FASTA.")
21
21
  end
22
22
  end
@@ -29,7 +29,7 @@ describe "Jobs" do
29
29
  word_file = File.expand_path("../../data/seqs.docx", __FILE__)
30
30
  attach_file "job_sequence_file", word_file
31
31
  click_button "Submit"
32
- page.should have_content("Please enter your sequence(s) in Plain Text " <<
32
+ page.should have_content("Please enter your sequence(s) in Plain Text " <<
33
33
  "as FASTA.")
34
34
  end
35
35
  end
@@ -42,14 +42,15 @@ describe "Jobs" do
42
42
  file = File.expand_path("../../data/seqs_not_fa.txt", __FILE__)
43
43
  attach_file "job_sequence_file", file
44
44
  click_button "Submit"
45
- page.should have_content("Please enter your sequence(s) in Plain Text " <<
45
+ page.should have_content("Please enter your sequence(s) in Plain Text " <<
46
46
  "as FASTA.")
47
47
  end
48
48
  end
49
49
 
50
50
  context "javascript", @javascript do
51
51
  before(:all) do
52
- Capybara.current_driver = :selenium
52
+ Capybara.current_driver = :selenium
53
+ Capybara.default_wait_time = 5
53
54
  end
54
55
  before(:each) do
55
56
  ResqueSpec.reset!
@@ -65,7 +66,7 @@ describe "Jobs" do
65
66
 
66
67
  # Blastn
67
68
  check "job_blastn_job_attributes_queue"
68
- select "tmp", :from => "job_blastn_job_attributes_blast_dbs"
69
+ select "tmp", :from => "job_blastn_job_attributes_blast_dbs"
69
70
  check "job_blastn_job_attributes_filter"
70
71
  fill_in "job_blastn_job_attributes_expectation", :with => "5e-20"
71
72
  fill_in "job_blastn_job_attributes_min_bit_score", :with => "0"
@@ -75,7 +76,7 @@ describe "Jobs" do
75
76
 
76
77
  # Blastx
77
78
  check "job_blastx_job_attributes_queue"
78
- select "tmp", :from => "job_blastx_job_attributes_blast_dbs"
79
+ select "tmp", :from => "job_blastx_job_attributes_blast_dbs"
79
80
  check "job_blastx_job_attributes_filter"
80
81
  fill_in "job_blastx_job_attributes_expectation", :with => "5e-20"
81
82
  fill_in "job_blastx_job_attributes_min_bit_score", :with => "0"
@@ -85,7 +86,7 @@ describe "Jobs" do
85
86
 
86
87
  # Tblastn
87
88
  check "job_tblastn_job_attributes_queue"
88
- select "tmp", :from => "job_tblastn_job_attributes_blast_dbs"
89
+ select "tmp", :from => "job_tblastn_job_attributes_blast_dbs"
89
90
  check "job_tblastn_job_attributes_filter"
90
91
  fill_in "job_tblastn_job_attributes_expectation", :with => "5e-20"
91
92
  fill_in "job_tblastn_job_attributes_min_bit_score", :with => "0"
@@ -95,7 +96,7 @@ describe "Jobs" do
95
96
 
96
97
  # Blastp
97
98
  check "job_blastp_job_attributes_queue"
98
- select "tmp", :from => "job_blastp_job_attributes_blast_dbs"
99
+ select "tmp", :from => "job_blastp_job_attributes_blast_dbs"
99
100
  check "job_blastp_job_attributes_filter"
100
101
  fill_in "job_blastp_job_attributes_expectation", :with => "5e-20"
101
102
  fill_in "job_blastp_job_attributes_min_bit_score", :with => "0"
@@ -105,13 +106,13 @@ describe "Jobs" do
105
106
 
106
107
  click_button "Submit"
107
108
 
108
- page.should have_content("Search Results")
109
+ page.should have_content("Search Results")
109
110
 
110
111
  click_link "Blastx"
111
- page.should have_content("Your search returned 0 hits.")
112
+ page.should have_content("Your search returned 0 hits.")
112
113
 
113
114
  click_link "Tblastn"
114
- page.should have_content("Your search returned 0 hits.")
115
+ page.should have_content("Your search returned 0 hits.")
115
116
 
116
117
  ## Interact with the Blast results. ##
117
118
  click_link "Blastn"
data/spec/spec_helper.rb CHANGED
@@ -72,5 +72,5 @@ RSpec.configure do |config|
72
72
  cat #{REDIS_PID} | xargs kill -QUIT
73
73
  rm -f #{REDIS_CACHE_PATH}dump.rdb
74
74
  }
75
- end
75
+ end
76
76
  end
@@ -23,12 +23,12 @@ describe "blastdb rake tasks" do
23
23
  )
24
24
  }
25
25
  end
26
-
26
+
27
27
  it "raises exception without DIR argument" do
28
28
  expect {
29
29
  Quorum::BuildBlastDB.new({}).build_blast_db_data
30
30
  }.to raise_error(
31
- RuntimeError,
31
+ RuntimeError,
32
32
  'DIR must be set to continue. Execute `rake -D` for more information.'
33
33
  )
34
34
  end
@@ -38,7 +38,7 @@ describe "blastdb rake tasks" do
38
38
  expect {
39
39
  Quorum::BuildBlastDB.new(@args).build_blast_db_data
40
40
  }.to raise_error(
41
- RuntimeError,
41
+ RuntimeError,
42
42
  "Unknown type: #{@args[:type]}. Please provide one: both, nucl or prot."
43
43
  )
44
44
  end
@@ -80,7 +80,7 @@ describe "blastdb rake tasks" do
80
80
  @build = Quorum::BuildBlastDB.new(@args, output)
81
81
 
82
82
  expect {
83
- @build.build_blast_db_data
83
+ @build.build_blast_db_data
84
84
  }.to_not raise_error
85
85
 
86
86
  File.directory?(@args[:blastdb_dir]).should be_true
@@ -95,7 +95,7 @@ describe "blastdb rake tasks" do
95
95
 
96
96
  @args[:empty] = false
97
97
  @build = Quorum::BuildBlastDB.new(@args, output)
98
-
98
+
99
99
  expect {
100
100
  @build.build_blast_db_data
101
101
  }.to_not raise_error
@@ -42,7 +42,7 @@ describe "Quorum::SearchTools::Blast" do
42
42
  @job.blastp_job.queue = true
43
43
  @job.blastp_job.blast_dbs = ["test"]
44
44
  end
45
-
45
+
46
46
  it "executes blastn on a given dataset" do
47
47
  @job.stub(:queue_workers)
48
48
  @job.save!
@@ -57,7 +57,7 @@ describe "Quorum::SearchTools::Blast" do
57
57
  Dir.glob(
58
58
  File.join(@args[:tmp_directory], "*")
59
59
  ).length.should be == 0
60
- end
60
+ end
61
61
 
62
62
  it "executes blastx on a given dataset" do
63
63
  @job.stub(:queue_workers)
@@ -74,7 +74,7 @@ describe "Quorum::SearchTools::Blast" do
74
74
  Dir.glob(
75
75
  File.join(@args[:tmp_directory], "*")
76
76
  ).length.should be == 0
77
- end
77
+ end
78
78
 
79
79
  it "executes tblastn on a given dataset" do
80
80
  @job.stub(:queue_workers)
@@ -91,7 +91,7 @@ describe "Quorum::SearchTools::Blast" do
91
91
  Dir.glob(
92
92
  File.join(@args[:tmp_directory], "*")
93
93
  ).length.should be == 0
94
- end
94
+ end
95
95
 
96
96
  it "executes blastp on a given dataset" do
97
97
  @job.stub(:queue_workers)
@@ -108,7 +108,7 @@ describe "Quorum::SearchTools::Blast" do
108
108
  Dir.glob(
109
109
  File.join(@args[:tmp_directory], "*")
110
110
  ).length.should be == 0
111
- end
111
+ end
112
112
 
113
113
  end
114
114
  end