@@ -117,6 +117,22 @@ class bin_validator
117
117
{
118
118
if (value.extension () == " .minimiser" )
119
119
minimiser_file_validator (value);
120
+ else if (values.size () == 1u )
121
+ {
122
+ std::ifstream list_of_files{value};
123
+ std::string line;
124
+ while (std::getline (list_of_files, line))
125
+ {
126
+ if (!line.empty ())
127
+ {
128
+ std::filesystem::path bin_path{line};
129
+ if (bin_path.extension () == " .minimiser" )
130
+ minimiser_file_validator (bin_path);
131
+ else
132
+ sequence_file_validator (bin_path);
133
+ }
134
+ }
135
+ }
120
136
else
121
137
throw exception ;
122
138
}
@@ -131,9 +147,10 @@ class bin_validator
131
147
132
148
std::string get_help_page_message () const
133
149
{
134
- return " The input file must exist and read permissions must be granted. Valid file extensions are: [minimiser],"
135
- " or [embl, fasta, fa, fna, ffn, faa, frn, fas, fastq, fq, genbank, gb, gbk, sam] possibly followed by: "
136
- " [gz, bgzf, bz2]." ;
150
+ return " The input file must exist and read permissions must be granted. Valid file extensions for bin files are"
151
+ " : [minimiser], or [embl, fasta, fa, fna, ffn, faa, frn, fas, fastq, fq, genbank, gb, gbk, sam] "
152
+ " possibly followed by: [gz, bgzf, bz2]. All other extensions will be assumed to contain one line per"
153
+ " path to a bin." ;
137
154
}
138
155
139
156
private:
@@ -148,7 +165,7 @@ inline void init_shared_meta(seqan3::argument_parser & parser)
148
165
parser.info .citation = " Seiler, E. et al. (2020). Raptor: A fast and space-efficient pre-filter for"
149
166
" querying very large collections of nucleotide sequences. bioRxiv 2020.10.08.330985. doi:"
150
167
" https://doi.org/10.1101/2020.10.08.330985" ;
151
- parser.info .date = " 12-10 -2020" ;
168
+ parser.info .date = " 16-12 -2020" ;
152
169
parser.
info .
email =
" [email protected] " ;
153
170
parser.info .long_copyright = R"( BSD 3-Clause License
154
171
@@ -182,7 +199,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)";
182
199
parser.info .short_copyright = " BSD 3-Clause License" ;
183
200
parser.info .short_description = " A fast and space-efficient pre-filter for querying very large collections of nucleotide sequences." ;
184
201
parser.info .url = " https://github.com/seqan/raptor" ;
185
- parser.info .version = " 1.0.2 " ;
202
+ parser.info .version = " 1.1.0 " ;
186
203
}
187
204
188
205
void init_top_level_parser (seqan3::argument_parser & parser)
@@ -229,7 +246,8 @@ inline void init_build_parser(seqan3::argument_parser & parser, build_arguments
229
246
init_shared_meta (parser);
230
247
init_shared_options (parser, arguments);
231
248
parser.add_positional_option (arguments.bin_path ,
232
- " Provide a list of input files. One file per bin. " ,
249
+ " Provide a list of input files (one file per bin). Alternatively, provide a text file "
250
+ " containing the paths to the bins (one line per path to a bin). " ,
233
251
bin_validator{});
234
252
parser.add_option (arguments.out_path ,
235
253
' \0 ' ,
@@ -319,6 +337,34 @@ void run_build(seqan3::argument_parser & parser)
319
337
init_build_parser (parser, arguments);
320
338
try_parsing (parser);
321
339
340
+ // ==========================================
341
+ // Process bin_path
342
+ // ==========================================
343
+ if (arguments.bin_path .size () == 1u ) // Either only one bin or a file containing bin paths
344
+ {
345
+ auto & file = arguments.bin_path [0 ];
346
+
347
+ if (file.extension () != " .minimiser" )
348
+ {
349
+ try
350
+ {
351
+ seqan3::input_file_validator<seqan3::sequence_file_input<>> validator;
352
+ validator (file);
353
+ }
354
+ catch (seqan3::validation_error const & exception )
355
+ {
356
+ decltype (arguments.bin_path ) new_values;
357
+ std::ifstream list_of_files{file};
358
+ std::string line;
359
+ while (std::getline (list_of_files, line))
360
+ new_values.emplace_back (line);
361
+ while (new_values.back ().empty ())
362
+ new_values.pop_back ();
363
+ arguments.bin_path = std::move (new_values);
364
+ }
365
+ }
366
+ }
367
+
322
368
// ==========================================
323
369
// Various checks.
324
370
// ==========================================
0 commit comments