Skip to content
Permalink
Browse files

fix ByteParser parameter regex

  • Loading branch information...
elileka committed Jun 11, 2019
1 parent e2d1d31 commit 2cb02fd8061858a4a143f523ebcb1a4f436d49a2
Showing with 5 additions and 5 deletions.
  1. +1 −1 src/commons/ByteParser.h
  2. +4 −4 src/commons/Parameters.cpp
@@ -27,7 +27,7 @@ class ByteParser {
unitFactor = TWO_POW_10 * TWO_POW_10 * TWO_POW_10;
} else if ((lastChar == 'm') || (lastChar == 'M')) {
unitFactor = TWO_POW_10 * TWO_POW_10;
} else if ((lastChar == 'k') || (lastChar == 'K')){
} else if ((lastChar == 'k') || (lastChar == 'K')) {
unitFactor = TWO_POW_10;
} else if ((lastChar == 'b') || (lastChar == 'B')) {
unitFactor = 1;
@@ -43,8 +43,8 @@ Parameters::Parameters():
PARAM_PREV_MAX_SEQS(PARAM_PREV_MAX_SEQS_ID, "--prev-max-seqs", "Previous max results per query", "Max results per query in previous calls to prefiltering. Used to compute the correct output offset", typeid(std::string), (void*) &prevMaxResListLengths, "([0-9]+,)?[0-9]+", MMseqsParameter::COMMAND_PREFILTER|MMseqsParameter::COMMAND_EXPERT),
PARAM_SPLIT(PARAM_SPLIT_ID,"--split", "Split database", "Splits input sets into N equally distributed chunks. The default value sets the best split automatically. createindex can only be used with split 1.",typeid(int),(void *) &split, "^[0-9]{1}[0-9]*$", MMseqsParameter::COMMAND_PREFILTER|MMseqsParameter::COMMAND_EXPERT),
PARAM_SPLIT_MODE(PARAM_SPLIT_MODE_ID,"--split-mode", "Split mode", "0: split target db; 1: split query db; 2: auto, depending on main memory",typeid(int),(void *) &splitMode, "^[0-2]{1}$", MMseqsParameter::COMMAND_PREFILTER|MMseqsParameter::COMMAND_EXPERT),
PARAM_SPLIT_MEMORY_LIMIT(PARAM_SPLIT_MEMORY_LIMIT_ID, "--split-memory-limit", "Split memory limit", "Set max memory per split. E.g. 800B, 5K, 10M, 1G. Defaults (0) to all available system memory.", typeid(ByteParser), (void*) &splitMemoryLimit, "^(0|[1-9]{1}[0-9]*(B|K|M|G)?)$", MMseqsParameter::COMMAND_COMMON|MMseqsParameter::COMMAND_PREFILTER|MMseqsParameter::COMMAND_EXPERT),
PARAM_DISK_SPACE_LIMIT(PARAM_DISK_SPACE_LIMIT_ID, "--disk-space-limit", "Disk space limit", "Set max disk space to use for reverse profile searches. E.g. 800B, 5K, 10M, 1G. Defaults (0) to all available disk space in the temp folder.", typeid(ByteParser), (void*) &diskSpaceLimit, "^(0|[1-9]{1}[0-9]*(B|K|M|G)?)$", MMseqsParameter::COMMAND_COMMON|MMseqsParameter::COMMAND_PREFILTER|MMseqsParameter::COMMAND_EXPERT),
PARAM_SPLIT_MEMORY_LIMIT(PARAM_SPLIT_MEMORY_LIMIT_ID, "--split-memory-limit", "Split memory limit", "Set max memory per split. E.g. 800B, 5K, 10M, 1G. Defaults (0) to all available system memory.", typeid(ByteParser), (void*) &splitMemoryLimit, "^(0|[1-9]{1}[0-9]*(B|K|M|G|T)?)$", MMseqsParameter::COMMAND_COMMON|MMseqsParameter::COMMAND_PREFILTER|MMseqsParameter::COMMAND_EXPERT),
PARAM_DISK_SPACE_LIMIT(PARAM_DISK_SPACE_LIMIT_ID, "--disk-space-limit", "Disk space limit", "Set max disk space to use for reverse profile searches. E.g. 800B, 5K, 10M, 1G. Defaults (0) to all available disk space in the temp folder.", typeid(ByteParser), (void*) &diskSpaceLimit, "^(0|[1-9]{1}[0-9]*(B|K|M|G|T)?)$", MMseqsParameter::COMMAND_COMMON|MMseqsParameter::COMMAND_PREFILTER|MMseqsParameter::COMMAND_EXPERT),
PARAM_SPLIT_AMINOACID(PARAM_SPLIT_AMINOACID_ID,"--split-aa", "Split by amino acid","Try to find the best split for the target database by amino acid count instead",typeid(bool), (void *) &splitAA, "$", MMseqsParameter::COMMAND_EXPERT),
PARAM_SUB_MAT(PARAM_SUB_MAT_ID,"--sub-mat", "Substitution matrix", "amino acid substitution matrix file",typeid(std::string),(void *) &scoringMatrixFile, "", MMseqsParameter::COMMAND_COMMON|MMseqsParameter::COMMAND_EXPERT),
PARAM_SEED_SUB_MAT(PARAM_SEED_SUB_MAT_ID,"--seed-sub-mat", "Seed substitution matrix", "amino acid substitution matrix for kmer generation file",typeid(std::string),(void *) &seedScoringMatrixFile, "", MMseqsParameter::COMMAND_COMMON|MMseqsParameter::COMMAND_EXPERT),
@@ -1264,13 +1264,13 @@ void Parameters::parseParameters(int argc, const char* pargv[],
// if no match found or two matches found (we want exactly one match)
if (nomatch){
printUsageMessage(command, outputFlags);
Debug(Debug::ERROR) << "Error in argument " << par[parIdx]->name << "\n";
Debug(Debug::ERROR) << "Error in argument regex " << par[parIdx]->name << "\n";
EXIT(EXIT_FAILURE);
} else {
size_t value = ByteParser::parse(pargv[argIdx+1]);
if (value == ByteParser::INVALID_SIZE) {
printUsageMessage(command, outputFlags);
Debug(Debug::ERROR) << "Error in argument " << par[parIdx]->name << "\n";
Debug(Debug::ERROR) << "Error in value parsing " << par[parIdx]->name << "\n";
EXIT(EXIT_FAILURE);
} else {
*((size_t *) par[parIdx]->value) = value;

0 comments on commit 2cb02fd

Please sign in to comment.
You can’t perform that action at this time.