sequenceserver 0.6.9 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

data/bin/sequenceserver CHANGED
@@ -2,9 +2,31 @@
2
2
 
3
3
  require 'rubygems'
4
4
  require 'bundler/setup'
5
+ require 'optparse'
5
6
  require 'sequenceserver'
6
7
 
7
8
  # display name for tools like `ps`
8
9
  $PROGRAM_NAME = 'sequenceserver'
9
10
 
11
+ # e.g:
12
+ # sequenceserver --config .sequenceserver.conf format_database
13
+ begin
14
+ # parse command line till first non-option, removing parsed options from ARGV
15
+ OptionParser.new do |opts|
16
+ opts.on('-c', '--config CONFIG_FILE', 'Use the given configuration file') do |config_file|
17
+ SequenceServer::App.config_file = File.expand_path(config_file)
18
+ end
19
+ end.order!
20
+
21
+ # of the remaining items in ARGV, the first one must be a subcommand
22
+ case ARGV.shift
23
+ when 'format_database'
24
+ require 'sequenceserver/database_formatter'
25
+ exit
26
+ end
27
+ rescue OptionParser::InvalidOption =>e
28
+ puts e
29
+ exit
30
+ end
31
+
10
32
  SequenceServer::App.run!
@@ -1,9 +1,10 @@
1
- #!/usr/bin/env ruby
2
1
  # copyright yannick . wurm at unil . ch
3
2
  # Finds files, reads first char. if its '>', read 500 lines. Guess sequence type, ask user for title to format as blast database.
4
3
 
5
- require 'rubygems'
6
- require 'bundler/setup'
4
+ # TODO: bring it under SequenceServer namespace
5
+ # TODO: move the file to a 'command/' sub-directory (probably makes more sense if we have several subcommands)
6
+ # TODO: needs more love (read refactoring) overall
7
+
7
8
  require 'ptools' # for File.binary?(file)
8
9
  require 'find'
9
10
  require 'logger'
@@ -144,36 +145,32 @@ end
144
145
 
145
146
  OptionParser.new do |opts|
146
147
  opts.banner =<<BANNER
147
- NAME
148
148
 
149
- database_formatter.rb - prepare BLAST databases for SequenceServer
149
+ SUMMARY
150
+
151
+ prepare BLAST databases for SequenceServer
150
152
 
151
- SYNOPSIS
153
+ USAGE
152
154
 
153
- ./database_formatter.rb [--verbose] [blast_database_directory]
155
+ sequenceserver format_database [--verbose] [blast_database_directory]
154
156
 
155
157
  Example:
156
158
 
157
- $ ./database_formatter.rb ~/db # explicitly specify a database directory
158
- $ ./database_formatter # use the database directory in config.yml
159
+ $ sequenceserver format_database ~/db # explicitly specify a database directory
160
+ $ sequenceserver format_database # use the database directory in config.yml
159
161
 
160
162
  DESCRIPTION
161
163
 
162
- database_formatter recursively scans the given 'blast_database_directory' for
163
- BLAST databases and formats them for use with SequenceServer.
164
+ Recursively scan the given 'blast_database_directory' for BLAST databases and
165
+ formats them for use with SequenceServer.
164
166
 
165
167
  It automagically detects the database type, and ignores non-db files and
166
168
  pre-formatted databases. The 'parse_seqids' makeblastdb options is used.
167
169
 
168
170
  'blast_database_directory' can be passed as a command line parameter or
169
- through config.yml by setting the 'database' key (the same option used by
170
- SequenceServer). See example.config.yml. database_formatter will check
171
- config.yml only if the command line parameter is missing.
172
-
173
- Failing both, database_formatter will look for 'database' directory relative
174
- to the current working directory i.e ./database.
175
-
176
- database_formatter can be used standalone too.
171
+ through a configuration file by setting the 'database' key (the same option
172
+ used by SequenceServer). Configuration file will be checked only if the
173
+ command line parameter is missing.
177
174
 
178
175
  OPTIONS
179
176
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  # meta
3
3
  s.name = 'sequenceserver'
4
- s.version = '0.6.9'
4
+ s.version = '0.7.1'
5
5
  s.authors = ['Anurag Priyam', 'Ben J Woodcroft', 'Yannick Wurm']
6
6
  s.email = 'anurag08priyam@gmail.com'
7
7
  s.homepage = 'http://sequenceserver.com'
@@ -22,7 +22,7 @@ DESC
22
22
  s.files = s.files + ['config.ru', 'example.config.yml']
23
23
  s.files = s.files + ['LICENSE.txt', 'README.txt']
24
24
  s.files = s.files + ['Gemfile', 'sequenceserver.gemspec']
25
- s.executables = ['sequenceserver', 'database_formatter']
25
+ s.executables = ['sequenceserver']
26
26
  s.require_paths = ['lib']
27
27
 
28
28
  # post install information
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequenceserver
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 6
9
- - 9
10
- version: 0.6.9
8
+ - 7
9
+ - 1
10
+ version: 0.7.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Anurag Priyam
@@ -69,13 +69,13 @@ description: |
69
69
  email: anurag08priyam@gmail.com
70
70
  executables:
71
71
  - sequenceserver
72
- - database_formatter
73
72
  extensions: []
74
73
 
75
74
  extra_rdoc_files: []
76
75
 
77
76
  files:
78
77
  - lib/sequenceserver.rb
78
+ - lib/sequenceserver/database_formatter.rb
79
79
  - lib/sequenceserver/sequencehelpers.rb
80
80
  - lib/sequenceserver/customisation.rb
81
81
  - lib/sequenceserver/helpers.rb
@@ -107,7 +107,6 @@ files:
107
107
  - Gemfile
108
108
  - sequenceserver.gemspec
109
109
  - bin/sequenceserver
110
- - bin/database_formatter
111
110
  homepage: http://sequenceserver.com
112
111
  licenses:
113
112
  - SequenceServer (custom)