sequenceserver 2.0.0.rc1 → 2.0.0.rc2

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.

Potentially problematic release.


This version of sequenceserver might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a05949fcff69da464c286499cb974ea9c2cbe2c2
4
- data.tar.gz: 5b697c08198c4424561fa226136719d2fb49c3cd
2
+ SHA256:
3
+ metadata.gz: 164573dfee9002d6a1e164899e5d6f8a22696d7a13e3f6d48dd96a134673d8b3
4
+ data.tar.gz: 06fd8269f49b72a04d41d05903e7d7273e647d4e451047722d285840fecd207f
5
5
  SHA512:
6
- metadata.gz: 9bdb8c9a31a2323d587c1f1e3a79357c22b0c4f6b0612e5872b1c0f6a6e1f7c720718ae7ef9e0f168dc0d420957cfa98d72ae6335c888c2360c609a8d98c21b8
7
- data.tar.gz: d58521faa39150d36ac2df81b21ad68e80d8c465e792049ff10ca46e7ca8a60fb84a9f43404eb01c4efa8c799796e645108e0a46cb53b8494c30a9657a50a8b1
6
+ metadata.gz: a3d66c251f7f5e3a96a45878001245a49c811e02bebeac271a350ec9b8e944e8066cabf55c8851bf4e4ce1d6e9cd86e3b76cce53bde7f6230afd3db4592a9175
7
+ data.tar.gz: 14cdb61bbfbf1fb316df829aaf2c602c0753db51174b5166bb8c4de646ac43a2f5a0023593e063cd12c05e3dcf4163df1f48551e190df12607206afa0593ae5a
data/bin/sequenceserver CHANGED
@@ -20,6 +20,30 @@ def download_from_url(url)
20
20
  system(cmd)
21
21
  end
22
22
 
23
+ def ask_to_join
24
+ asked_to_join = File.join(SequenceServer::DOTDIR, 'asked_to_join')
25
+ unless File.exist?(asked_to_join)
26
+ puts
27
+ puts <<~MSG
28
+ Do you want to be notified of SequenceServer releases and any
29
+ other important announcements (3-12 messages a year)? If yes,
30
+ please provide your email address below or press enter to
31
+ continue (you won't be prompted again).
32
+ MSG
33
+ print '>> '
34
+ response = STDIN.gets.to_s.strip
35
+ puts
36
+
37
+ if response =~ /@/
38
+ post_email_cmd = "curl -m 5 https://docs.google.com/forms/u/0/d/e/" \
39
+ "1FAIpQLSe7sOCiKzYbI7LwErid-g3wfIU5Zpi6VTm0ILJyR036RqC8zg/formResponse " \
40
+ "-d ifq -d emailAddress=#{response} -d submit=Submit > /dev/null 2> /dev/null"
41
+ system post_email_cmd
42
+ end
43
+ system "touch #{asked_to_join}"
44
+ end
45
+ end
46
+
23
47
  begin
24
48
  Slop.parse!(strict: true, help: true) do
25
49
  banner <<~BANNER
@@ -379,6 +403,8 @@ begin
379
403
 
380
404
  SequenceServer.config.write_config_file if fetch_option(:set).value
381
405
 
406
+ ask_to_join
407
+
382
408
  SequenceServer.run
383
409
  end
384
410
  end
@@ -386,4 +412,4 @@ rescue Slop::Error => e
386
412
  puts e
387
413
  puts "Run '#{$PROGRAM_NAME} -h' for help with command line options."
388
414
  exit
389
- end
415
+ end
@@ -41,7 +41,8 @@ module SequenceServer
41
41
  h
42
42
  }.update(search_id: job.id,
43
43
  submitted_at: job.submitted_at.utc,
44
- imported_xml: !!job.imported_xml_file).to_json
44
+ imported_xml: !!job.imported_xml_file,
45
+ seqserv_version: SequenceServer::VERSION).to_json
45
46
  end
46
47
 
47
48
  private
@@ -81,7 +81,7 @@ module SequenceServer
81
81
  # otherwise.
82
82
  def parse_config_file
83
83
  unless file? config_file
84
- logger.info "Configuration file not found: #{config_file}"
84
+ logger.debug "Configuration file not found: #{config_file}"
85
85
  return {}
86
86
  end
87
87
  logger.info "Reading configuration file: #{config_file}."
@@ -328,11 +328,8 @@ module SequenceServer
328
328
  db_name
329
329
  end
330
330
 
331
- # Guess whether FASTA file contains protein or nucleotide sequences based
332
- # on first 32768 characters.
333
- #
334
- # NOTE: 2^15 == 32786. Approximately 546 lines, assuming 60 characters on
335
- # each line.
331
+ # Guess whether FASTA file contains protein or nucleotide sequences by
332
+ # sampling a few few characters of the file.
336
333
  def guess_sequence_type_in_fasta(file)
337
334
  sequences = sample_sequences(file)
338
335
  sequence_types = sequences.map { |seq| Sequence.guess_type(seq) }
@@ -340,14 +337,14 @@ module SequenceServer
340
337
  (sequence_types.length == 1) && sequence_types.first
341
338
  end
342
339
 
343
- # Read first 32768 characters of the file. Split on fasta def line
344
- # pattern and return.
340
+ # Read first 1,048,576 characters of the file, split the read text on
341
+ # fasta def line pattern and return.
345
342
  #
346
343
  # If the given file is FASTA, returns Array of as many different
347
344
  # sequences in the portion of the file read. Returns the portion
348
345
  # of the file read wrapped in an Array otherwise.
349
346
  def sample_sequences(file)
350
- File.read(file, 32_768).split(/^>.+$/).delete_if(&:empty?)
347
+ File.read(file, 1_048_576).split(/^>.+$/).delete_if(&:empty?)
351
348
  end
352
349
  end
353
350
  end
@@ -1,4 +1,4 @@
1
1
  # Define version number.
2
2
  module SequenceServer
3
- VERSION = '2.0.0.rc1'.freeze
3
+ VERSION = '2.0.0.rc2'.freeze
4
4
  end
@@ -33,6 +33,10 @@ label:hover {
33
33
  color: #c74f14;
34
34
  }
35
35
 
36
+ .yellow-background {
37
+ background-color: #E2D382;
38
+ }
39
+
36
40
  /**
37
41
  * Disable resize grabber on textarea.
38
42
  */