@@ -143,6 +143,7 @@ void usage() {
143143 << " -s, --summary File where summary statistics will be written to" << endl
144144 << " -h, --help Displays usage information" << endl
145145 << " --assign Assign reads to a final barcode sequence identifier based on tags present" << endl
146+ << " --bclen The length of the final barcode sequence identifier (default: 16)" << endl
146147 << " --inleaved Specifies that input is an interleaved FASTQ file" << endl
147148 << " --remultiplex Turn on remultiplexing mode" << endl
148149 << " --version Prints version number" << endl
@@ -259,6 +260,7 @@ void ParseOptions(int argc, char **argv, ProgramOptions& opt) {
259260 {" sam-tags" , required_argument, 0 , ' M' },
260261 {" sub-assign" , required_argument, 0 , ' X' },
261262 {" compress" , required_argument, 0 , ' C' },
263+ {" bclen" , required_argument, 0 , ' 9' },
262264 {0 ,0 ,0 ,0 }
263265 };
264266
@@ -441,6 +443,10 @@ void ParseOptions(int argc, char **argv, ProgramOptions& opt) {
441443 stringstream (optarg) >> opt.trim_3_str ;
442444 break ;
443445 }
446+ case ' 9' : {
447+ stringstream (optarg) >> opt.bclen ;
448+ break ;
449+ }
444450 case ' w' : {
445451 stringstream (optarg) >> opt.filter_length_str ;
446452 break ;
@@ -624,6 +630,16 @@ bool CheckOptions(ProgramOptions& opt, SplitCode& sc) {
624630 << " , but only " << n << " cores on the machine" << endl;
625631 }
626632 }
633+ if (opt.bclen != 0 ) {
634+ if (!opt.barcode_prefix .empty ()) {
635+ cerr << ERROR_STR << " Cannot specify --prefix with --bclen" << endl;
636+ ret = false ;
637+ }
638+ if (opt.bclen >= 32 || opt.bclen < 2 ) {
639+ cerr << ERROR_STR << " --bclen must have value between 2 and 32 " << endl;
640+ ret = false ;
641+ }
642+ }
627643 if (opt.remultiplex && opt.files .size () != 1 ) {
628644 cerr << ERROR_STR << " A single batch file must be supplied (for remultiplexing)" << endl;
629645 ret = false ;
@@ -1297,7 +1313,7 @@ int main(int argc, char *argv[]) {
12971313 ProgramOptions opt;
12981314 ParseOptions (argc,argv,opt);
12991315 SplitCode sc (opt.nfiles , opt.summary_file , opt.trim_only , opt.disable_n , opt.trim_5_str , opt.trim_3_str , opt.extract_str , opt.extract_no_chain , opt.barcode_prefix , opt.filter_length_str ,
1300- opt.quality_trimming_5 , opt.quality_trimming_3 , opt.quality_trimming_pre , opt.quality_trimming_naive , opt.quality_trimming_threshold , opt.phred64 , opt.write_locations , opt.sub_assign_vec );
1316+ opt.quality_trimming_5 , opt.quality_trimming_3 , opt.quality_trimming_pre , opt.quality_trimming_naive , opt.quality_trimming_threshold , opt.phred64 , opt.write_locations , opt.sub_assign_vec , opt. bclen );
13011317 bool checkopts = CheckOptions (opt, sc);
13021318 if (!checkopts) {
13031319 usage ();
0 commit comments