Commit 44e4d60a authored by Carsten Kemena's avatar Carsten Kemena

improved output

[RADS]
-added gop/gep information to output
-added hidden option to makeRadsDB to print only file name not path (for servers)

[makeRadsDB]
-added rads version and commandline to sql database into info table
parent 74d92e61
Pipeline #648 passed with stage
in 3 minutes and 39 seconds
v. 2.0.0
- Initial release
v. 2.1.3
- added gop/gep information to output file
- added commandline and rads version to databse file in additional table
v. 2.1.2
- improved error reporting in case of input format problems
v. 2.1.1
- fixed sorting in makeDB on InterPro data
v. 2.1.0
- fixed problem in the score calculation (problem in BSDL)
- added the time the program was run to the output file
- added database file, query file and matrix information to the output file
v. 2.1.1
- fixed sorting in makeDB on InterPro data
v. 2.1.2
- improved error reporting in case of input format problems
v. 2.0.0
- Initial release
......@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.6)
project (RADS C CXX)
SET(MAJOR_VERSION 2)
SET(MINOR_VERSION 1)
SET(PATCH_VERSION 2)
SET(PATCH_VERSION 3)
SET(CMAKE_CXX_FLAGS_COVERAGE
......
......@@ -97,6 +97,14 @@ shortenNumber(std::string &number)
int
main(int argc, char *argv[])
{
std::string input_command;
for (int i = 0; i < argc; i++)
{
input_command += argv[i];
if (i < (argc-1))
input_command += " ";
}
std::string version(std::string(STR(MAJOR_VERSION)) + "." + std::string(STR(MINOR_VERSION)) + "." + std::string(STR(PATCH_VERSION)));
po::options_description allOpts("makeRadsDB " + version + " (C) 2016-2018 Carsten Kemena\nThis program comes with ABSOLUTELY NO WARRANTY;\n\nAllowed options are displayed below.");
......@@ -122,7 +130,7 @@ main(int argc, char *argv[])
("threshold,t", po::value<unsigned int>(&threshold)->default_value(10), "Maximal number of allowed overlap")
;
allOpts.add(general).add(filterOpts);
try
{
......@@ -157,6 +165,7 @@ main(int argc, char *argv[])
// Create tables
db.exec("CREATE TABLE IF NOT EXISTS domain('id' INT PRIMARY KEY, 'accession' VARCHAR(45) NULL,'position' INT NULL)");
db.exec("CREATE TABLE IF NOT EXISTS info('id' INT PRIMARY KEY, 'version' VARCHAR(20), 'command' VARCHAR(200) NULL)");
db.startTransaction();
std::set<std::string> empty;
......@@ -335,6 +344,7 @@ main(int argc, char *argv[])
// write the databaes to files
size_t nSeqs = 0;
db.exec("INSERT INTO info VALUES(NULL,'"+ version + "','" + input_command + "')");
for (auto &arrangements : dbContent)
{
......
......@@ -227,7 +227,6 @@ main(int argc, char *argv[])
vector<std::string> q, domains;
unsigned short nThreads;
po::options_description allOpts("rads " + version + " (C) 2015-2018 Carsten Kemena\nThis program comes with ABSOLUTELY NO WARRANTY;\n\nAllowed options are displayed below.");
po::options_description general("General options");
general.add_options()
("help,h", "Produces this help message")
......@@ -261,14 +260,24 @@ main(int argc, char *argv[])
("min-score,M", po::value<int>(&minScore)->default_value(0), "The minimum alignment score to list")
;
allOpts.add(general).add(queryOpts).add(scoreOpts).add(filterOpts);
bool print_filename_only;
po::options_description hiddenOpts("Server Options");
hiddenOpts.add_options()
("print_filename_only", po::value<bool>(&print_filename_only)->default_value(false)->zero_tokens(), "Print the file name only in parameters (no path)")
;
po::options_description visibleOpts("rads " + version + " (C) 2015-2018 Carsten Kemena\nThis program comes with ABSOLUTELY NO WARRANTY;\n\nAllowed options are displayed below.");
visibleOpts.add(general).add(queryOpts).add(scoreOpts).add(filterOpts);
po::options_description allOpts("Everything");
allOpts.add(general).add(queryOpts).add(scoreOpts).add(filterOpts).add(hiddenOpts);
try
{
po::variables_map vm;
po::store(po::command_line_parser(argc, argv).options(allOpts).run(), vm);
if (vm.count("help"))
{
cout << allOpts<< "\n";
cout << visibleOpts<< "\n";
return EXIT_SUCCESS;
}
po::notify(vm);
......@@ -355,13 +364,17 @@ main(int argc, char *argv[])
string qPath = querySeqFile.empty() ? "-" : fs::canonical(querySeqFile).string();
string print_matrix_name = (print_filename_only) ? matrixName.stem().string() : fs::canonical(matrixName).string();
string print_db_name = (print_filename_only) ? fs::change_extension(daFile, "").stem().string() : fs::change_extension(fs::canonical(daFile), "").string();
// print output header
outS << "# RADS version " + version + "\n"
<< "# RADS Output v1\n"
<< "# run at " << ctime (&tt) << "#\n"
<< "# query file: " << qPath << "\n"
<< "# database: " << fs::change_extension(fs::canonical(daFile), "").string() << "\n"
<< "# matrix: " << fs::canonical(matrixName).string() << "\n"
<< "# database: " << print_db_name << "\n"
<< "# gap open penalty " << std::to_string(gop) << "\n"
<< "# gap extension penalty " << std::to_string(gep) << "\n"
<< "# matrix: " << print_matrix_name << "\n"
<< "# ******************************************************************\n"
<< "\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment