Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

Commit 4f37bccb authored by Mikaël Salson's avatar Mikaël Salson

algo: GZ_SUFFIX factorization

parent e687b492
Pipeline #216816 passed with stages
in 36 minutes and 15 seconds
......@@ -494,14 +494,20 @@ string extractGeneName(string label){
/*
Opens a ostream, possibly gz-compressed
*/
std::ostream* new_ofgzstream(const char *f, bool gz)
std::ostream* new_ofgzstream(string &f, bool gz, string message)
{
if (gz)
{
return new ogzstream(f);
f += GZ_SUFFIX;
}
cout << " ==> " << f << message << endl ;
if (gz) {
return new ogzstream(f.c_str());
}
else
{
return new ofstream(f);
return new ofstream(f.c_str());
}
}
\ No newline at end of file
}
......@@ -14,6 +14,7 @@ typedef string junction ;
#define ERROR_STRING "[error] "
#define WARNING_STRING "[warning] "
#define GZ_SUFFIX ".gz"
#define NO_LIMIT_VALUE -1 // Value for 'all' on command-line options
#define NO_LIMIT_VALUE_STRING "-1"
......@@ -295,7 +296,7 @@ void json_add_warning(json &clone, string code, string msg, string level=LEVEL_W
/*
Opens a ostream, possibly gz-compressed
*/
std::ostream* new_ofgzstream(const char *f, bool gz);
std::ostream* new_ofgzstream(string &f, bool gz, string message="");
//////////////////////////////////////////////////
......
......@@ -109,7 +109,6 @@ enum { CMD_DETECT, CMD_WINDOWS, CMD_CLONES, CMD_SEGMENT, CMD_GERMLINES } ;
#define COMP_FILENAME "comp.vidjil"
#define AIRR_SUFFIX ".tsv"
#define JSON_SUFFIX ".vidjil"
#define GZ_SUFFIX ".gz"
#define DEFAULT_K 0
#define DEFAULT_W 50
......@@ -891,13 +890,6 @@ int main (int argc, char **argv)
string f_airr = out_dir + f_basename + AIRR_SUFFIX ;
string f_json = out_dir + f_basename + JSON_SUFFIX ;
if (out_gz)
{
f_clones += GZ_SUFFIX;
f_airr += GZ_SUFFIX;
f_json += GZ_SUFFIX;
}
ostringstream stream_cmdline;
for (int i=0; i < argc; i++) stream_cmdline << argv[i] << " ";
......@@ -1158,19 +1150,13 @@ int main (int argc, char **argv)
if (output_segmented) {
string f_segmented = out_dir + f_basename + SEGMENTED_FILENAME ;
if (out_gz)
f_segmented += GZ_SUFFIX;
cout << " ==> " << f_segmented << endl ;
out_segmented = new_ofgzstream(f_segmented.c_str(), out_gz);
out_segmented = new_ofgzstream(f_segmented, out_gz);
we.setSegmentedOutput(out_segmented);
}
if (output_unsegmented) {
string f_unsegmented = out_dir + f_basename + UNSEGMENTED_FILENAME ;
if (out_gz)
f_unsegmented += GZ_SUFFIX;
cout << " ==> " << f_unsegmented << endl ;
out_unsegmented = new_ofgzstream(f_unsegmented.c_str(), out_gz);
out_unsegmented = new_ofgzstream(f_unsegmented, out_gz);
we.setUnsegmentedOutput(out_unsegmented);
}
......@@ -1186,10 +1172,7 @@ int main (int argc, char **argv)
replace(s.begin(), s.end(), '\'', '_');
string f_unsegmented_detail = out_dir + f_basename + "." + s + UNSEGMENTED_DETAIL_FILENAME ;
if (out_gz)
f_unsegmented_detail += GZ_SUFFIX;
cout << " ==> " << f_unsegmented_detail << endl ;
out_unsegmented_detail[i] = new_ofgzstream(f_unsegmented_detail.c_str(), out_gz);
out_unsegmented_detail[i] = new_ofgzstream(f_unsegmented_detail, out_gz);
}
we.setUnsegmentedDetailOutput(out_unsegmented_detail, output_unsegmented_detail_full);
......@@ -1390,9 +1373,8 @@ int main (int argc, char **argv)
ostream* out_clones = NULL;
if (output_vdjfa)
{
cout << " ==> " << f_clones << " \t(for sequence post-processing with other software)" << endl;
out_clones = new_ofgzstream(f_clones, out_gz, " \t(for sequence post-processing with other software)");
cout << "!! To get structured data, do not parse the Fasta headers, but rather work on the .vidjil file." << endl;
out_clones = new_ofgzstream(f_clones.c_str(), out_gz);
}
if (output_clone_files)
......@@ -1890,14 +1872,18 @@ int main (int argc, char **argv)
//$ Output AIRR .tsv(.gz)
if (!no_airr)
{
cout << " ==> " << f_airr << " \t(AIRR output)" << endl;
std::ostream *out_airr = new_ofgzstream(f_airr.c_str(), out_gz);
std::ostream *out_airr = new_ofgzstream(f_airr, out_gz, " \t(AIRR output)");
static_cast<SampleOutputAIRR *>(&output) -> out(*out_airr);
delete out_airr;
}
//$ Output .vidjil(.gz) json
cout << " ==> " << f_json ;
std::ostream *out_json = new_ofgzstream(f_json, out_gz);
SampleOutputVidjil *outputVidjil = static_cast<SampleOutputVidjil *>(&output);
outputVidjil -> out(*out_json, !no_vidjil);
if (!no_vidjil)
{
cout << "\t(main output file, may be opened by the Vidjil web application)" << endl;
......@@ -1906,12 +1892,6 @@ int main (int argc, char **argv)
{
cout << "\t(only metadata, no clone output)" << endl;
}
std::ostream *out_json = new_ofgzstream(f_json.c_str(), out_gz);
SampleOutputVidjil *outputVidjil = static_cast<SampleOutputVidjil *>(&output);
outputVidjil -> out(*out_json, !no_vidjil);
// In the case of ogzstream, delete actually calls .close() that is mandatory to make it work
delete out_json;
......
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