Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/util/createdb.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@ int createdb(int argc, const char **argv, const Command& command) {
std::vector<std::string> filenames(par.filenames);
std::string dataFile = filenames.back();
filenames.pop_back();
if (Util::endsWith(".txt", filenames[0])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use .tsv.

Also please adjust MMseqsBase.cpp to explain that users can pass in a tsv

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the createdb module only, or in all search/cluster modules as well?

if (filenames.size() > 1) {
Debug(Debug::ERROR) << "Only one txt file can be given\n";
EXIT(EXIT_FAILURE);
}
std::string tsv = filenames.back();
filenames.pop_back();

FILE* file = FileUtil::openFileOrDie(tsv.c_str(), "r", true);
char* line = NULL;
size_t len = 0;
ssize_t read;
while ((read = getline(&line, &len, file)) != -1) {
if (line[read - 1] == '\n') {
line[read - 1] = '\0';
read--;
}
filenames.push_back(line);
}
free(line);
fclose(file);
}

for (size_t i = 0; i < filenames.size(); i++) {
if (FileUtil::directoryExists(filenames[i].c_str()) == true) {
Expand Down