Skip to content

Commit

Permalink
Renamed Normalize to Compact.
Browse files Browse the repository at this point in the history
  • Loading branch information
OndrejSladky committed Feb 29, 2024
1 parent 4a38629 commit 62460d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The recognized commands are:
- `index` Creates a BWT based index of the given masked superstring.
- `query` Queries a $k$-mer against an index.
- `merge` Merge several indexes.
- `normalize` Normalize an index.
- `compact` Compacts an index.
- `export` Export the underlying masked superstring.
- `clean` Cleans the files stored for index.
- `-v` Prints the version of the program.
Expand Down Expand Up @@ -77,9 +77,9 @@ It recognizes the following arguments:

For example: `./fmsi merge -p spneumoniae1.fa -p spneumoniae2.fa -r spneumoniae.fa -k 13`

### Normalize
### Compact

Normalize (`./fmsi normalize`) normalizes the index by removing the redundant information by computing a new or-masked superstring.
Compact (`./fmsi compacts`) compacts the index by removing the redundant information by computing a new or-masked superstring.
Especially note that the resulting superstring is or-masked superstring and not f-masked superstring.

It recognizes the following arguments:
Expand All @@ -97,7 +97,7 @@ It recognizes the following arguments:
- `-l` - Use the local algorithm acting directly on the index.
- `-d value_of_d_max` - The maximum extension length. Relevant only for the local algorithm. Default is 5.

For example: `./fmsi normalize -p spneumoniae.fa -k 13 -f xor -s`
For example: `./fmsi compact -p spneumoniae.fa -k 13 -f xor -s`

### Export

Expand Down
13 changes: 7 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static int usage() {
std::cerr << " `query` - Queries a $k$-mer against an index." << std::endl;
std::cerr << " `clean` - Cleans the files stored for index." << std::endl;
std::cerr << " `merge` - Merges several indices." << std::endl;
std::cerr << " `normalize` - Normalizes the given index." << std::endl;
std::cerr << " `compact` - Compacts the given index." << std::endl;
std::cerr << " `export` - Export the underlying masked superstring." << std::endl;
std::cerr << " `-v` - Prints the version of the program." << std::endl;
std::cerr << " `-h` - Prints this help." << std::endl;
Expand Down Expand Up @@ -75,7 +75,7 @@ static int usage_query() {
"masked superstring or not."
<< std::endl;
std::cerr
<< "`./ms-index index` must be run on the provided fasta file beforehand."
<< "`./fmsi index` must be run on the provided fasta file beforehand."
<< std::endl;
std::cerr << std::endl << "The recognized arguments are:" << std::endl;
std::cerr << " `-p path_to_fasta` - The path to the fasta file from which "
Expand Down Expand Up @@ -111,7 +111,7 @@ static int usage_query() {
}

static int usage_normalize() {
std::cerr << "FMSI Normalize normalizes the given FM-index so that it "
std::cerr << "FMSI Compact compacts the given index so that it "
"does not occupy more space than needed."
<< std::endl;
std::cerr << std::endl << "The recognized arguments are:" << std::endl;
Expand Down Expand Up @@ -143,7 +143,7 @@ static int usage_normalize() {
std::cerr << " `-l` - Use local algorithm instead of global." << std::endl;
std::cerr << " `-d` - Value of d_max. Default 5." << std::endl;
std::cerr << " `-s` - Only print the masked superstring and do not "
"normalize the FM-index"
"compact the index"
<< std::endl;
std::cerr << " `-h` - Prints this help and terminates." << std::endl;
return 1;
Expand Down Expand Up @@ -253,7 +253,7 @@ bool load_index_pair(std::string fn, int k, fm_index_t &ret_fm_index,
!std::filesystem::exists(std::filesystem::path{index_path})) {
std::cerr << "The index for file " << fn << " and k=" << std::to_string(k)
<< " is not properly created." << std::endl;
std::cerr << "Please run `./ms-index index` before." << std::endl;
std::cerr << "Please run `./fmsi index` before." << std::endl;
return false;
}
// Load FM-index.
Expand Down Expand Up @@ -610,7 +610,8 @@ int main(int argc, char *argv[]) {
ret = ms_clean(argc - 1, argv + 1);
else if (strcmp(argv[1], "merge") == 0)
ret = ms_merge(argc - 1, argv + 1);
else if (strcmp(argv[1], "normalize") == 0)
// Recognize "normalize" for backwards compatibility
else if (strcmp(argv[1], "normalize") == 0 || strcmp(argv[1], "compact") == 0)
ret = ms_normalize(argc - 1, argv + 1);
else if (strcmp(argv[1], "export") == 0)
ret = ms_export(argc - 1, argv + 1);
Expand Down

0 comments on commit 62460d3

Please sign in to comment.