bio-rocker 1.0.0 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8a10cdc85d8b7b54c21d26f12b90c0b3dff4f82
4
- data.tar.gz: c837b3c6687f6705dbfc7c959824dd530e7ee932
3
+ metadata.gz: ea753ac3675ae8b018f57e1d76fe1a1217a5d329
4
+ data.tar.gz: 00e681953dae2f6dc715e5594f2c2f45cb441e23
5
5
  SHA512:
6
- metadata.gz: 869cdadfed2dad125fc11c03133e2f56df53074a54b0f35d8ea5c6674029e7069332e4c35c486b1f39a417aeff01932a7eee30da44e15de036ce1a2d878d15d4
7
- data.tar.gz: 823b30e7923c243f8dc8bb122f50426898e2cdda634516cc53e0325b150946b0699e0a9257a55c06ed8868a0f843f0274ed1d23bdf8ef2de9629fafb66f33552
6
+ metadata.gz: 8fafa5d4adcdf71de47a5f778a94e181a2a1d0d43810a1e4e51b1e37c98e1bf3f2a3932bbf20c27e4ae32c00e6538fdd4ddfa70d695c43d9c731aed35f0aa778
7
+ data.tar.gz: 04e7ecc8213d0050eb4d80ada2badf39b79fe86cb961c1c0999c4c94542aff6e9e877e3a39e69957ad979c5cabe27a4a828f208ebbec9e39f82a9d04ca64c099
data/bin/ROCker CHANGED
@@ -3,7 +3,7 @@
3
3
  # @author Luis M. Rodriguez-R <lmrodriguezr at gmail dot com>
4
4
  # @author Luis (Coto) Orellana
5
5
  # @license artistic license 2.0
6
- # @update May-07-2015
6
+ # @update Sep-07-2015
7
7
  #
8
8
 
9
9
  lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
@@ -14,14 +14,20 @@ require 'optparse'
14
14
 
15
15
  #================================[ Options parsing ]
16
16
  $t = {
17
- 'build' => 'Creates in silico metagenomes and training sets from reference genomes.',
18
- 'compile' => 'Identifies the most discriminant bit-score per alignment position in a set of sequence.',
19
- 'search' => 'Uses a ROCker compilation to identify reads putatively derived from a set of sequences.',
20
- 'filter' => 'Uses a pre-compiled set of bit-score thresholds to filter a search result.',
21
- 'plot' => 'Generates a graphical representation of the alignment, the thresholds, and the hits.',
17
+ "build" => "Creates in silico metagenomes and training sets from " +
18
+ "reference genomes.",
19
+ "compile" => "Identifies the most discriminant bit-score per alignment " +
20
+ "position in a set of sequence.",
21
+ "search" => "Uses a ROCker compilation to identify reads putatively " +
22
+ "derived from a set of sequences.",
23
+ "filter" => "Uses a pre-compiled set of bit-score thresholds to filter " +
24
+ "a search result.",
25
+ "plot" => "Generates a graphical representation of the alignment, the " +
26
+ "thresholds, and the hits.",
27
+ "info" => "Display additional information about ROCker."
22
28
  }
23
- task = (ARGV.size > 0 ? ARGV.shift : '').downcase
24
- ARGV << '-h' if ARGV.size==0
29
+ task = (ARGV.empty? ? "" : ARGV.shift).downcase
30
+ ARGV << "-h" if ARGV.empty? and task != "info"
25
31
 
26
32
  o = {}
27
33
  opts = OptionParser.new do |opt|
@@ -32,132 +38,293 @@ opts = OptionParser.new do |opt|
32
38
  opt.separator ""
33
39
  end
34
40
  case task
35
- when 'build'
41
+ when "build"
36
42
  unless ROCker.has_build_gems?
37
43
  opt.separator "+ UNSATISFIED REQUIREMENTS"
38
- opt.separator " The building task requires uninstalled gems, please install them executing:"
44
+ opt.separator " The building task requires uninstalled gems, please"
45
+ opt.separator " install them executing:"
39
46
  opt.separator " gem install rest_client"
40
47
  opt.separator ""
41
48
  end
42
49
  opt.separator "+ BUILDING ARGUMENTS"
43
- opt.on("-p", "--positive ID1,ID2,ID3", Array, "Comma-separated list of UniProtKB IDs corresponding to the 'positive' training set. Required unless -P or -a are used."){ |v| o[:posori]=v }
44
- opt.on("-n", "--negative ID1,ID2,ID3", Array, "Comma-separated list of UniProtKB IDs corresponding to the 'negative' training set. See also -N."){ |v| o[:negative]=v }
45
- opt.on("-o", "--baseout PATH", "Prefix for the output files to be generated. Required."){ |v| o[:baseout]=v }
46
- opt.on("-t", "--threads INT", "Number of threads to use. By default: #{ROCker.default :thr}."){ |v| o[:thr]=v.to_i }
50
+ opt.on("-p", "--positive ID1,ID2,ID3", Array,
51
+ "Comma-separated list of UniProtKB IDs corresponding to the positive ",
52
+ "training set. Required unless -P or -a are used."
53
+ ){ |v| o[:positive]=v }
54
+ opt.on("-n", "--negative ID1,ID2,ID3", Array,
55
+ "Comma-separated list of UniProtKB IDs corresponding to the negative ",
56
+ "training set. See also -N."){ |v| o[:negative]=v }
57
+ opt.on("-o", "--baseout PATH",
58
+ "Prefix for the output files to be generated. Required."
59
+ ){ |v| o[:baseout]=v }
60
+
47
61
  opt.separator ""
48
62
  opt.separator "+ ADVANCED BUILDING ARGUMENTS"
49
- opt.on("-P", "--positive-file PATH", "File containing the positive set (see -p), one UniProtKB ID per line. If used, -p is not required."){ |v| o[:posfile]=v }
50
- opt.on("-N", "--negative-file PATH", "File containing the negative set (see -n), one UniProtKB ID per line."){ |v| o[:negfile]=v }
51
- opt.on("-a", "--alignment PATH", "Protein alignment of the reference sequences. The defline must contain UniProtKB ID. If used, -p is not required."){ |v| o[:aln]=v }
52
- opt.on("-s", "--seqdepth NUMBER", "Sequencing depth (reads/bp) to be used in building the in silico metagenome. By default: '#{ROCker.default :seqdepth}'."){ |v| o[:seqdepth]=v.to_f }
53
- opt.on("-l", "--readlen INTEGER", "Average read length of in silico metagenome (in bp). By default: '#{ROCker.default :readlen}'."){ |v| o[:readlen]=v.to_i }
54
- opt.on("-v", "--overlap INTEGER", "Minimum overlap (in bp) with reference gene to tag a read as positive. By default: '#{ROCker.default :minovl}'."){ |v| o[:minovl]=v.to_i }
55
- opt.on( "--per-taxon RANK", "If selected, only one genome per taxon is used to build the metagenome. Valid ranks include: species, genus, family, order, class, phylum."){ |v| o[:pertaxon]=v.downcase }
56
- opt.on( "--genome-frx NUMBER", "Fraction to subsample genomes to generate the metagenome. By default: #{ROCker.default :genomefrx}."){ |v| o[:genomefrx]=v.to_f }
57
- opt.on( "--nosimulate", "Do not simulate metagenome. Implies --nosearch. By default, metagenome is simulated."){ |v| o[:nosimulate]=v }
58
- opt.on( "--nosearch", "Do not execute similarity search. By default, it is executed."){ |v| o[:nosearch]=v }
59
- opt.on( "--noalignment", "Do not align reference set. By default, references are aligned."){ |v| o[:noaln]=v }
60
- opt.on( "--nocleanup", "Keep all intermediate files. By default, intermediate files are removed."){ |v| o[:noclean]=v }
61
- opt.on( "--reuse-files", "Re-use existing result files. By default, existing files are ignored."){ |v| o[:reuse]=true }
63
+ opt.on("-P", "--positive-file PATH",
64
+ "File containing the positive set, one UniProtKB ID per line.",
65
+ "If used, -p is not required."){ |v| o[:posfile]=v }
66
+ opt.on("-N", "--negative-file PATH",
67
+ "File containing the negative set, one UniProtKB ID per line."
68
+ ){ |v| o[:negfile]=v }
69
+ opt.on("-a", "--alignment PATH",
70
+ "Protein alignment of the reference sequences. The defline must have",
71
+ "UniProtKB IDs. If used, -p is not required."){ |v| o[:aln]=v }
72
+ opt.on("-s", "--seqdepth NUMBER",
73
+ "Sequencing depth (reads/bp) to be used in building the in silico" +
74
+ "metagenome.", "By default: '" + ROCker.default(:seqdepth).to_s +
75
+ "'."){ |v| o[:seqdepth]=v.to_f }
76
+ opt.on("-l", "--readlen INTEGER",
77
+ "Average read length of in silico metagenome (in bp).",
78
+ "By default: '" + ROCker.default(:readlen).to_s + "'."
79
+ ){ |v| o[:readlen]=v.to_i }
80
+ opt.on("-v", "--overlap INTEGER",
81
+ "Minimum overlap (in bp) with reference gene to tag a positive read.",
82
+ "By default: '" + ROCker.default(:minovl).to_s +
83
+ "'."){ |v| o[:minovl]=v.to_i }
84
+ opt.on("--per-taxon RANK",
85
+ "Use only one genome per taxon to build the metagenome.",
86
+ "Valid ranks include: species, genus, family, order, class, phylum."
87
+ ){ |v| o[:pertaxon]=v.downcase }
88
+ opt.on("--nosimulate",
89
+ "Do not simulate metagenome. It implies --nosearch.",
90
+ "By default, metagenome is simulated."){ |v| o[:nosimulate]=v }
91
+ opt.on("--nosearch",
92
+ "Do not execute similarity search. By default it's executed."
93
+ ){ |v| o[:nosearch]=v }
94
+ opt.on("--noalignment",
95
+ "Do not align reference set. By default references are aligned."
96
+ ){ |v| o[:noaln]=v }
97
+ opt.on("--nocleanup",
98
+ "Keep all intermediate files. By default temporal files are removed."
99
+ ){ |v| o[:noclean]=v }
100
+ opt.on("--reuse-files",
101
+ "Re-use existing result files. By default existing files are ignored."
102
+ ){ |v| o[:reuse]=true }
103
+
62
104
  opt.separator ""
63
105
  opt.separator "+ EXTERNAL SOFTWARE OPTIONS"
64
- opt.on( "--search STR", "Similarity search algorithm to use. Supported: 'blast' and 'diamond'. By default: '#{ROCker.default :search}'.") { |v| o[:search]=v.to_sym }
65
- opt.on( "--simulator STR", "In silico metagenome simulator to use. Supported: 'grinder'. By default: '#{ROCker.default :simulator}'.") { |v| o[:ssimulator]=v.to_sym }
66
- opt.on( "--aligner STR", "Multiple alignment algorithm to use. Supported: 'clustalo' and 'muscle'. By default: '#{ROCker.default :aligner}'.") { |v| o[:aligner]=v.to_sym }
67
- opt.on( "--search-bins PATH", "Path to the similarity search executables. By default in the $PATH: '#{ROCker.default :searchbins}'.") { |v| o[:searchbins]=v }
68
- opt.on( "--simulator-bin PATH", "Path to the simulator executable. By default in the $PATH: '#{ROCker.default(:simulatorbin).values.join("' or '")}'.") { |v| o[:simulatorbin]=v }
69
- opt.on( "--aligner-bin PATH", "Path to the aligner executable. By default in the $PATH: '#{ROCker.default(:alignerbin).values.join("' or '")}'.") { |v| o[:alignerbin]=v }
70
- opt.on( "--search-cmd STR", "Command calling similarity search, where %1$s: binaries, %2$s: program, %3$s: input, %4$s: database, %5$s: output, %6$d: threads.",
71
- *ROCker.default(:searchcmd).keys.map{|k| "By default if --search #{k}: '#{ROCker.default(:searchcmd)[k]}'."}){ |v| o[:searchcmd]=v }
72
- opt.on( "--makedb-cmd STR", "Command calling database format for similarity search, where %1$s: binaries, %2$s: dbtype, %3$s: input, %4$s: database.",
73
- *ROCker.default(:makedbcmd).keys.map{|k| "By default if --search #{k}: '#{ROCker.default(:makedbcmd)[k]}'."}){ |v| o[:makedbcmd]=v }
74
- opt.on( "--simulator-cmd STR", "Command calling simulator, where %1$s: binary, %2$s: input, %3$s: seq. depth (X), %4$d: read len., %5$s: output.",
75
- *ROCker.default(:simulatorcmd).keys.map{|k| "By default if --simulator #{k}: '#{ROCker.default(:simulatorcmd)[k]}'."}){ |v| o[:simulatorcmd]=v }
76
- opt.on("--aligner-cmd STR", "Command calling aligner, where %1$s: binary, %2$s: input, %3$s: output, %4$d: threads.",
77
- *ROCker.default(:alignercmd).keys.map{|k| "By default if --aligner #{k}: '#{ROCker.default(:alignercmd)[k]}'."}){ |v| o[:alignercmd]=v }
78
- when 'compile'
106
+ opt.on("--search STR",
107
+ "Similarity search algorithm to use. Supported: blast and diamond",
108
+ "By default: '" + ROCker.default(:search).to_s + "'."
109
+ ){ |v| o[:search]=v.to_sym }
110
+ opt.on("--simulator STR",
111
+ "In silico metagenome simulator to use. Supported: grinder.",
112
+ "By default: '" + ROCker.default(:simulator).to_s + "'."
113
+ ){ |v| o[:simulator]=v.to_sym }
114
+ opt.on("--aligner STR",
115
+ "Multiple alignment algorithm to use. Supported: clustalo and muscle.",
116
+ "By default: '" + ROCker.default(:aligner).to_s + "'."
117
+ ){ |v| o[:aligner]=v.to_sym }
118
+ opt.on("--search-bins PATH",
119
+ "Path to the similarity search executables. By default in $PATH: '" +
120
+ ROCker.default(:searchbins) + "'."
121
+ ){ |v| o[:searchbins]=v }
122
+ opt.on("--simulator-bin PATH",
123
+ "Path to the simulator executable. By default in $PATH: '" +
124
+ ROCker.default(:simulatorbin).values.join("' or '") + "'."
125
+ ){ |v| o[:simulatorbin]=v }
126
+ opt.on("--aligner-bin PATH",
127
+ "Path to the aligner executable. By default in $PATH: '" +
128
+ ROCker.default(:alignerbin).values.join("' or '") + "'."
129
+ ){ |v| o[:alignerbin]=v }
130
+ opt.on("--search-cmd STR",
131
+ "Command for similarity search, where %1$s: binaries, %2$s: program,",
132
+ "%3$s: input, %4$s: database, %5$s: output, %6$d: threads.",
133
+ *ROCker.default(:searchcmd).keys.map do |k|
134
+ ["By default if --search #{k}:", "'" +
135
+ ROCker.default(:searchcmd)[k] + "'"]
136
+ end.reduce([],:+) ){ |v| o[:searchcmd]=v }
137
+ opt.on("--makedb-cmd STR",
138
+ "Command calling database formater for similarity search, where",
139
+ "%1$s: binaries, %2$s: dbtype, %3$s: input, %4$s: database.",
140
+ *ROCker.default(:makedbcmd).keys.map do |k|
141
+ ["By default if --search #{k}:", "'" +
142
+ ROCker.default(:makedbcmd)[k] + "'"]
143
+ end.reduce([],:+) ){ |v| o[:makedbcmd]=v }
144
+ opt.on("--simulator-cmd STR",
145
+ "Command calling simulator, where %1$s: binary, %2$s: input,",
146
+ "%3$s: seq. depth (X), %4$d: read len., %5$s: output.",
147
+ *ROCker.default(:simulatorcmd).keys.map do |k|
148
+ ["By default if --simulator #{k}:", "'" +
149
+ ROCker.default(:simulatorcmd)[k] + "'"]
150
+ end.reduce([],:+) ){ |v| o[:simulatorcmd]=v }
151
+ opt.on("--aligner-cmd STR",
152
+ "Command calling aligner, where %1$s: binary, %2$s: input,",
153
+ "%3$s: output, %4$d: threads.",
154
+ *ROCker.default(:alignercmd).keys.map do |k|
155
+ ["By default if --aligner #{k}:", "'" +
156
+ ROCker.default(:alignercmd)[k] + "'."]
157
+ end.reduce([],:+) ){ |v| o[:alignercmd]=v }
158
+ when "compile"
79
159
  opt.separator "+ COMPILATION ARGUMENTS"
80
- opt.on("-a", "--alignment PATH", "Protein alignment of the reference sequences. Required."){ |v| o[:aln]=v }
160
+ opt.on("-a", "--alignment PATH",
161
+ "Protein alignment of the reference sequences. Required."
162
+ ){ |v| o[:aln]=v }
81
163
  opt.on("-b", "--ref-blast PATH",
82
- "Tabular BLAST (blastx) of the test reads vs. the reference dataset. Required unless -t exists."){ |v| o[:blast]=v }
83
- opt.on("-k", "--rocker PATH", "ROCker file to be created. Required."){ |v| o[:rocker]=v }
164
+ "Tabular BLAST (blastx) of the test reads vs. the reference dataset.",
165
+ "Required unless -T exists."){ |v| o[:blast]=v }
166
+ opt.on("-k", "--rocker PATH",
167
+ "ROCker file to be created. Required."){ |v| o[:rocker]=v }
168
+
84
169
  opt.separator ""
85
170
  opt.separator "+ ADVANCED COMPILATION ARGUMENTS"
86
- opt.on("-t", "--table PATH", "Formated tabular file to be created (or reused). Required unless -b is provided."){ |v| o[:table]=v }
87
- opt.on( "--min-score NUMBER", "Minimum Bit-Score to consider a hit. By default: #{ROCker.default :minscore}"){ |v| o[:minscore]=v.to_f }
88
- opt.on( "--norefine", "Do not refine windows."){ o[:refine]=false }
89
- opt.on("-w", "--window INT", "Initial size of alignment windows (in number of AA columns). By default: #{ROCker.default :win}."){ |v| o[:win]=v.to_i }
90
- opt.on( "--reuse-files", "Re-use existing result files. By default, existing files are ignored."){ |v| o[:reuse]=true }
171
+ opt.on("-T", "--table PATH",
172
+ "Formated tabular file to be created (or reused).",
173
+ "Required unless -b is provided."){ |v| o[:table]=v }
174
+ opt.on("--min-score NUMBER",
175
+ "Minimum Bit-Score to consider a hit. By default: " +
176
+ ROCker.default(:minscore).to_s){ |v| o[:minscore]=v.to_f }
177
+ opt.on("--norefine",
178
+ "Do not refine windows."){ o[:refine]=false }
179
+ opt.on("-w", "--window INT",
180
+ "Initial size of alignment windows (in number of AA columns). ",
181
+ "By default: " + ROCker.default(:win).to_s + "."
182
+ ){ |v| o[:win]=v.to_i }
183
+ opt.on("--reuse-files",
184
+ "Re-use existing result files. By default, existing files are " +
185
+ "ignored."){ |v| o[:reuse]=true }
91
186
  opt.separator ""
92
187
  opt.separator "+ INPUT/OUTPUT"
93
- opt.separator " o The input alignment (-a) MUST be in FastA format, and the IDs must"
188
+ opt.separator " o The input alignment (-a) MUST be in FastA format, " +
189
+ "and the IDs must"
94
190
  opt.separator " coincide with those from the BLAST (-b)."
95
- opt.separator " o The input BLAST (-b) MUST be in tabular format. True positives must"
191
+ opt.separator " o The input BLAST (-b) MUST be in tabular format. " +
192
+ "True positives must"
96
193
  opt.separator " contain the string '@%' somewhere in the query ID."
97
- opt.separator " o The table file (-t) should be tab-delimited and contain six columns:"
194
+ opt.separator " o The table file (-T) should be tab-delimited and " +
195
+ "contain six columns:"
98
196
  opt.separator " 1. Subject ID."
99
- opt.separator " 2. Start of alignment in subject (translated to alignment column)."
100
- opt.separator " 3. End of alignment in subject (translated to alignment column)."
197
+ opt.separator " 2. Start of alignment in subject (translated to " +
198
+ "alignment column)."
199
+ opt.separator " 3. End of alignment in subject (translated to " +
200
+ "alignment column)."
101
201
  opt.separator " 4. Bit score."
102
- opt.separator " 5. A number indicating if it was a true (1) or a false (0) positive."
103
- opt.separator " 6. Mid-point of the alignment in the reference sequence."
104
- opt.separator " o The ROCker file (-k) is a tab-delimited file containing five columns:"
202
+ opt.separator " 5. A number indicating if it was a true (1) or a " +
203
+ "false (0) positive."
204
+ opt.separator " 6. Mid-point of the alignment in the reference " +
205
+ "sequence."
206
+ opt.separator " o The ROCker file (-k) is a tab-delimited file " +
207
+ "containing five columns:"
105
208
  opt.separator " 1. First column of the window in the alignment."
106
209
  opt.separator " 2. Last column of the window in the alignment."
107
210
  opt.separator " 3. Number of positives in the window (hits)."
108
211
  opt.separator " 4. Number of true positives in the window."
109
212
  opt.separator " 5. Bit score threshold set for the window."
110
- opt.separator " The file also contains the alignment (commented with #:)."
213
+ opt.separator " The file also contains the alignment (commented " +
214
+ "with #:)."
111
215
  opt.separator ""
112
- when 'search'
113
- opt.on("-k", "--rocker PATH", "ROCker file generated by the compile task (-k). Required."){ |v| o[:rocker]=v }
114
- opt.on("-q", "--query PATH", "File containing the query sequences in FastA format. Required."){ |v| o[:query]=v }
115
- opt.on("-o", "--out-blast PATH", "Filtered tabular BLAST to be created. Required."){ |v| o[:oblast]=v }
216
+ when "search"
217
+ opt.separator "+ SEARCHING ARGUMENTS"
218
+ opt.on("-k", "--rocker PATH",
219
+ "ROCker file generated by the compile task (-k). " +
220
+ "Required."){ |v| o[:rocker]=v }
221
+ opt.on("-i", "--query PATH",
222
+ "File containing the query sequences in FastA format. " +
223
+ "Required."){ |v| o[:query]=v }
224
+ opt.on("-o", "--out-blast PATH",
225
+ "Filtered tabular BLAST to be created. Required."){ |v| o[:oblast]=v }
226
+ opt.on("-x", "--query-blast PATH",
227
+ "Unfiltered tabular BLAST. By default, this file is not " +
228
+ "kept."){ |v| o[:qblast]=v }
229
+
116
230
  opt.separator ""
117
231
  opt.separator "+ EXTERNAL SOFTWARE OPTIONS"
118
- opt.on( "--search STR", "Similarity search algorithm to use. Supported: 'blast' and 'diamond'. By default: '#{ROCker.default :search}'.") { |v| o[:search]=v.to_sym }
119
- opt.on( "--search-bins PATH", "Path to the similarity search executables. By default in the $PATH: '#{ROCker.default :searchbins}'.") { |v| o[:searchbins]=v }
120
- opt.on( "--search-cmd STR", "Command calling similarity search, where %1$s: binaries, %2$s: program, %3$s: input, %4$s: database, %5$s: output, %6$d: threads.",
121
- *ROCker.default(:searchcmd).keys.map{|k| "By default if --search #{k}: '#{ROCker.default(:searchcmd)[k]}'."}){ |v| o[:searchcmd]=v }
122
- opt.on( "--makedb-cmd STR", "Command calling database format for similarity search, where %1$s: binaries, %2$s: dbtype, %3$s: input, %4$s: database.",
123
- *ROCker.default(:makedbcmd).keys.map{|k| "By default if --search #{k}: '#{ROCker.default(:makedbcmd)[k]}'."}){ |v| o[:makedbcmd]=v }
124
- when 'filter'
232
+ opt.on("--search STR",
233
+ "Similarity search algorithm to use. Supported: 'blast' and " +
234
+ "'diamond'. By default: '" + ROCker.default(:search).to_s +
235
+ "'.") { |v| o[:search]=v.to_sym }
236
+ opt.on("--search-bins PATH",
237
+ "Path to the similarity search executables. By default in the " +
238
+ "$PATH: '" + ROCker.default(:searchbins) +
239
+ "'.") { |v| o[:searchbins]=v }
240
+ opt.on("--search-cmd STR",
241
+ "Command calling similarity search, where %1$s: binaries, %2$s: " +
242
+ "program, %3$s: input, %4$s: database, %5$s: output, %6$d: threads.",
243
+ *ROCker.default(:searchcmd).keys.map do |k|
244
+ "By default if --search #{k}: '" + ROCker.default(:searchcmd)[k] +
245
+ "'."
246
+ end ){ |v| o[:searchcmd]=v }
247
+ opt.on("--makedb-cmd STR",
248
+ "Command calling database format for similarity search, where %1$s: " +
249
+ "binaries, %2$s: dbtype, %3$s: input, %4$s: database.",
250
+ *ROCker.default(:makedbcmd).keys.map do |k|
251
+ "By default if --search #{k}: '" + ROCker.default(:makedbcmd)[k] +
252
+ "'."
253
+ end ){ |v| o[:makedbcmd]=v }
254
+ when "filter"
125
255
  opt.separator "+ FILTERING ARGUMENTS"
126
- opt.on("-k", "--rocker PATH", "ROCker file generated by the compile task (-k). Required."){ |v| o[:rocker]=v }
127
- opt.on("-x", "--query-blast PATH", "Tabular BLAST (blastx) of the query reads vs. the reference dataset. Required."){ |v| o[:qblast]=v }
128
- opt.on("-o", "--out-blast PATH", "Filtered tabular BLAST to be created. Required."){ |v| o[:oblast]=v }
129
- when 'plot'
256
+ opt.on("-k", "--rocker PATH",
257
+ "ROCker file generated by the compile task (-k). " +
258
+ "Required."){ |v| o[:rocker]=v }
259
+ opt.on("-x", "--query-blast PATH",
260
+ "Tabular BLAST (blastx) of the query reads vs. the reference " +
261
+ "dataset. Required."){ |v| o[:qblast]=v }
262
+ opt.on("-o", "--out-blast PATH",
263
+ "Filtered tabular BLAST to be created. Required."){ |v| o[:oblast]=v }
264
+ when "plot"
130
265
  opt.separator "+ PLOTTING ARGUMENTS"
131
- opt.on("-k", "--rocker PATH", "ROCker file generated by the compile task (-k). Required."){ |v| o[:rocker]=v }
266
+ opt.on("-k", "--rocker PATH",
267
+ "ROCker file generated by the compile task (-k). " +
268
+ "Required."){ |v| o[:rocker]=v }
132
269
  opt.on("-b", "--ref-blast PATH",
133
- "Tabular BLAST (blastx) of the test reads vs. the reference dataset. Required unless -t exists."){ |v| o[:blast]=v }
134
- opt.on("-o", "--plot-file PATH", "File to be created with the plot. By default: value of -k + '.' + value of -f."){ |v| o[:gout]=v }
270
+ "Tabular BLAST (blastx) of the test reads vs. the reference " +
271
+ "dataset. Required unless -T exists."){ |v| o[:blast]=v }
272
+ opt.on("-o", "--plot-file PATH",
273
+ "File to be created with the plot. By default: value of -k + " +
274
+ "'.' + value of -f."){ |v| o[:gout]=v }
275
+
135
276
  opt.separator ""
136
277
  opt.separator "+ ADVANCED PLOTTING ARGUMENTS"
137
- opt.on("-t", "--table PATH", "Formated tabular file to be created (or reused). Required unless -b is provided."){ |v| o[:table]=v }
138
- opt.on( "--color", "Color alignment by amino acid."){ o[:color]=true }
139
- opt.on( "--no-transparency", "Do not use (semi-)transparencies."){ |v| o[:transparency] = v }
140
- opt.on( "--min-score NUMBER", "Minimum Bit-Score to consider a hit. By default: #{ROCker.default :minscore}."){ |v| o[:minscore]=v.to_f }
141
- opt.on( "--stats-impact", "Plot impact on statistics, instead of absolute values per window."){ o[:impact]=true }
142
- opt.on( "--stats-ylim STRING", "Limits of the Y-axis in the bottom panel. By default: '-2,.1' if --stats-impact is set, '50,100' otherwise."){ |v| o[:ylim]=v }
278
+ opt.on("-T", "--table PATH",
279
+ "Formated tabular file to be created (or reused). Required " +
280
+ "unless -b is provided."){ |v| o[:table]=v }
281
+ opt.on("--color", "Color alignment by amino acid."){ o[:color]=true }
282
+ opt.on("--tag-negatives",
283
+ "Mark hits from negative references."){ o[:tag_negatives] = true }
284
+ opt.on("--no-transparency",
285
+ "Do not use (semi-)transparencies."){ |v| o[:transparency] = v }
286
+ opt.on("--min-score NUMBER",
287
+ "Minimum Bit-Score to consider a hit. By default: " +
288
+ ROCker.default(:minscore).to_s + "."){ |v| o[:minscore]=v.to_f }
289
+ opt.on("--stats-impact",
290
+ "Plot impact on statistics, instead of absolute values per " +
291
+ "window."){ o[:impact]=true }
292
+ opt.on("--stats-ylim STRING",
293
+ "Limits of the Y-axis in the bottom panel. By default: '-2,.1' " +
294
+ "if --stats-impact is set, '50,100' otherwise."){ |v| o[:ylim]=v }
143
295
  opt.on("-s", "--subject SBJ1,SBJ2,...", Array,
144
- "Plot only information regarding this(ese) subject(s). If multiple, separate by comma. By default, all hits are plotted."){ |v| o[:sbj]=v }
296
+ "Plot only information regarding this(ese) subject(s). If multiple, " +
297
+ "separate by comma. By default, all hits are plotted."){ |v| o[:sbj]=v }
145
298
  opt.on("-f", "--plot-format STRING",
146
- "Format of the plot file. Supported values: pdf (default), png, jpeg, and tiff."){ |v| o[:gformat]=v }
147
- opt.on("-W", "--width NUMBER", "Width of the plot in inches. By default: #{ROCker.default :width}."){ |v| o[:width]=v.to_f }
148
- opt.on("-H", "--height NUMBER", "Height of the plot in inches. By defaule: #{ROCker.default :height}."){ |v| o[:width]=v.to_f }
299
+ "Format of the plot file. Supported values: pdf (default), png, " +
300
+ "jpeg, and tiff."){ |v| o[:gformat]=v }
301
+ opt.on("-W", "--width NUMBER",
302
+ "Width of the plot in inches. By default: " +
303
+ ROCker.default(:width).to_s +
304
+ "."){ |v| o[:width]=v.to_f }
305
+ opt.on("-H", "--height NUMBER",
306
+ "Height of the plot in inches. By default: " +
307
+ ROCker.default(:height).to_s +
308
+ "."){ |v| o[:width]=v.to_f }
149
309
  else
150
310
  opt.banner = "Usage: ROCker.rb [task] [options]"
151
311
  opt.separator ""
152
312
  opt.separator "Please specify one of the following tasks:"
153
313
  $t.keys.each{ |t| opt.separator " #{t}:\t#{$t[t]}" }
154
- end
314
+ end # case task
315
+
155
316
  opt.separator ""
156
317
  opt.separator "+ GENERAL ARGUMENTS"
157
- opt.on("-R", "--path-to-r PATH", "Path to the R executable to be used. By default: '#{ROCker.default :r}'."){ |v| o[:r]=v }
318
+ opt.on("-t", "--threads INT",
319
+ "Number of threads to use. By default: " + ROCker.default(:thr).to_s +
320
+ "."){ |v| o[:thr]=v.to_i }
321
+ opt.on("-R", "--path-to-r PATH",
322
+ "Path to the R executable to be used. By default: '" +
323
+ ROCker.default(:r) + "'."){ |v| o[:r]=v }
158
324
  opt.on("-q", "--quiet", "Run quietly."){ |v| o[:q]=true }
159
- opt.on("-d", "--debug", "Display debugging information."){ |v| o[:debug]=true }
160
- opt.on("-h", "--help","Display this screen") do
325
+ opt.on("-d", "--debug",
326
+ "Display debugging information."){ |v| o[:debug]=true }
327
+ opt.on("-h", "--help", "Display this screen") do
161
328
  puts opt
162
329
  exit
163
330
  end
@@ -174,16 +341,29 @@ opts.parse!
174
341
  rocker = ROCker.new(o)
175
342
  begin
176
343
  case task
177
- when 'build'
344
+ when "build"
178
345
  rocker.build!
179
- when 'compile'
346
+ when "compile"
180
347
  rocker.compile!
181
- when 'filter'
348
+ when "filter"
182
349
  rocker.filter!
183
- when 'search'
350
+ when "search"
184
351
  rocker.search!
185
- when 'plot'
352
+ when "plot"
186
353
  rocker.plot!
354
+ when "info"
355
+ puts "ROCker v" + ROCker.VERSION
356
+ puts ""
357
+ puts "If you use ROCker in your research, please cite:"
358
+ puts ROCker.CITATION
359
+ puts ""
360
+ puts "ROCker can be freely used and distributed under the "
361
+ puts "terms of the Artistic License 2.0. See LICENSE.txt."
362
+ puts ""
363
+ puts "For additional information and documentation, visit:"
364
+ puts "http://enve-omics.ce.gatech.edu/rocker/"
365
+ puts "For our list of curated models, visits:"
366
+ puts "http://enve-omics.ce.gatech.edu/rocker/models"
187
367
  end
188
368
  rescue => err
189
369
  $stderr.puts "Exception: #{err}\n\n"