Skip to content

Commit 54008ed

Browse files
committed
allow both singular and plural names
1 parent 9b0e437 commit 54008ed

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/SplitCode.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,8 +1572,8 @@ struct SplitCode {
15721572
std::transform(field.begin(), field.end(), field.begin(), ::toupper);
15731573
h.push_back(field);
15741574
}
1575-
if (std::find(h.begin(), h.end(), "BARCODES") == h.end() && std::find(h.begin(), h.end(), "TAGS") == h.end()) {
1576-
std::cerr << "Error: The file \"" << config_file << "\" must contain a header with, minimally, a column header named tags" << std::endl;
1575+
if (std::find(h.begin(), h.end(), "BARCODES") == h.end() && std::find(h.begin(), h.end(), "TAGS") == h.end() && std::find(h.begin(), h.end(), "BARCODE") == h.end() && std::find(h.begin(), h.end(), "TAG") == h.end()) {
1576+
std::cerr << "Error: The file \"" << config_file << "\" must contain a header with, minimally, a column header named tag" << std::endl;
15771577
return false;
15781578
}
15791579
if (std::set<std::string>(h.begin(), h.end()).size() != h.size()) {
@@ -1611,15 +1611,15 @@ struct SplitCode {
16111611
bool ret = true;
16121612
for (int i = 0; ss >> field; i++) {
16131613
if (field == "-") field = ""; // - means empty
1614-
if (h[i] == "BARCODES" || h[i] == "TAGS") {
1614+
if (h[i] == "BARCODES" || h[i] == "TAGS" || h[i] == "BARCODE" || h[i] == "TAG") {
16151615
bc = field;
1616-
} else if (h[i] == "DISTANCES") {
1616+
} else if (h[i] == "DISTANCES" || h[i] == "DISTANCE") {
16171617
ret = ret && parseDistance(field, mismatch, indel, total_dist);
1618-
} else if (h[i] == "LOCATIONS") {
1618+
} else if (h[i] == "LOCATIONS" || h[i] == "LOCATION") {
16191619
ret = ret && parseLocation(field, file, pos_start, pos_end, nFiles);
1620-
} else if (h[i] == "IDS") {
1620+
} else if (h[i] == "IDS" || h[i] == "ID") {
16211621
name = field;
1622-
} else if (h[i] == "GROUPS") {
1622+
} else if (h[i] == "GROUPS" || h[i] == "GROUP") {
16231623
group = field;
16241624
} else if (h[i] == "MINFINDS") {
16251625
std::stringstream(field) >> min_finds;
@@ -1631,7 +1631,7 @@ struct SplitCode {
16311631
std::stringstream(field) >> max_finds_g;
16321632
} else if (h[i] == "EXCLUDE") {
16331633
std::stringstream(field) >> exclude;
1634-
} else if (h[i] == "SUBS") {
1634+
} else if (h[i] == "SUBS" || h[i] == "SUB") {
16351635
std::stringstream(field) >> subs_str;
16361636
} else if (h[i] == "AFTER" || h[i] == "NEXT") {
16371637
std::stringstream(field) >> after_str;

src/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,16 @@ void ParseOptions(int argc, char **argv, ProgramOptions& opt) {
230230
{"nFastqs", required_argument, 0, 'N'},
231231
{"numReads", required_argument, 0, 'n'},
232232
{"tags", required_argument, 0, 'b'},
233+
{"tag", required_argument, 0, 'b'},
233234
{"distances", required_argument, 0, 'd'},
235+
{"distance", required_argument, 0, 'd'},
234236
{"min-delta", required_argument, 0, 'D'},
235237
{"locations", required_argument, 0, 'l'},
238+
{"location", required_argument, 0, 'l'},
236239
{"ids", required_argument, 0, 'i'},
240+
{"id", required_argument, 0, 'i'},
237241
{"groups", required_argument, 0, 'g'},
242+
{"group", required_argument, 0, 'g'},
238243
{"maxFinds", required_argument, 0, 'F'},
239244
{"minFinds", required_argument, 0, 'f'},
240245
{"maxFindsG", required_argument, 0, 'J'},
@@ -243,6 +248,7 @@ void ParseOptions(int argc, char **argv, ProgramOptions& opt) {
243248
{"next", required_argument, 0, 'a'},
244249
{"after", required_argument, 0, 'a'},
245250
{"subs", required_argument, 0, 'U'},
251+
{"sub", required_argument, 0, 'U'},
246252
{"previous", required_argument, 0, 'v'},
247253
{"partial5", required_argument, 0, 'z'},
248254
{"partial3", required_argument, 0, 'Z'},

0 commit comments

Comments
 (0)