Commit 78239588 authored by Mikaël Salson's avatar Mikaël Salson

Merge branch 'feature-a/3302-smaller-stdout' into 'dev'

algo/vidjil.cpp: only a few clones on stdout

Closes #3302

See merge request !530
parents b19f850b 6b171aaf
Pipeline #102416 failed with stages
in 37 seconds
......@@ -4,6 +4,11 @@
using namespace std ;
typedef string junction ;
// Progress bar
#define PROGRESS_POINT 25000
#define PROGRESS_POINT_CLONES 25
#define PROGRESS_LINE 40
// error
#define ERROR_STRING "[error] "
#define WARNING_STRING "[warning] "
......
#include "windowExtractor.h"
#include "segment.h"
// Progress bar
#define PROGRESS_POINT 25000
#define PROGRESS_LINE 40
#include "tools.h"
WindowExtractor::WindowExtractor(MultiGermline *multigermline): out_segmented(NULL), out_unsegmented(NULL), out_unsegmented_detail(NULL), out_affects(NULL),
max_reads_per_window(~0), multigermline(multigermline){
......
......@@ -138,6 +138,7 @@ enum { CMD_WINDOWS, CMD_CLONES, CMD_SEGMENT, CMD_GERMLINES } ;
#define WARN_NUM_CLONES_SIMILAR 10
// display
#define CLONES_ON_STDOUT 50
#define WIDTH_NB_READS 7
#define WIDTH_NB_CLONES 3
#define PAD_HELP "\n "
......@@ -1290,9 +1291,10 @@ int main (int argc, char **argv)
junction win = it->first;
size_t clone_nb_reads = it->second;
++num_clone ;
bool clone_on_stdout = (num_clone <= CLONES_ON_STDOUT) || verbose;
Germline *segmented_germline = windowsStorage->getGermline(it->first);
//$$ Computing labels
......@@ -1338,9 +1340,23 @@ int main (int argc, char **argv)
}
}
if (clone_on_stdout)
{
cout << clone_id_human << endl ;
last_num_clone_on_stdout = num_clone ;
}
else
{
// Progress bar. See the other progress bar in windowExtractor.cpp
if (!(num_clone % PROGRESS_POINT_CLONES))
{
cout << "." ;
if (!(num_clone % (PROGRESS_POINT_CLONES * PROGRESS_LINE)))
cout << setw(10) << num_clone / 1000 << "k clones " << endl;
cout.flush() ;
}
}
cout << clone_id_human << endl ;
last_num_clone_on_stdout = num_clone ;
//$$ Open CLONE_FILENAME
......@@ -1349,7 +1365,8 @@ int main (int argc, char **argv)
//$$ Output window
cout << window_str ;
if (clone_on_stdout)
cout << window_str ;
out_clone << window_str ;
//$$ Compute a representative sequence
......@@ -1413,7 +1430,8 @@ int main (int argc, char **argv)
&& ! windowsStorage->isInterestingJunction(it->first))
{
cout << representative << endl ;
if (clone_on_stdout)
cout << representative << endl ;
out_clones << representative << endl ;
continue;
}
......@@ -1433,7 +1451,8 @@ int main (int argc, char **argv)
// Output representative, possibly segmented...
// to stdout, CLONES_FILENAME, and CLONE_FILENAME-*
cout << seg << endl ;
if (clone_on_stdout)
cout << seg << endl ;
out_clone << seg << endl ;
out_clones << seg << endl ;
......@@ -1447,6 +1466,7 @@ int main (int argc, char **argv)
if (cc)
{
if (clone_on_stdout)
cout << " (similar to Clone #" << setfill('0') << setw(WIDTH_NB_CLONES) << cc << setfill(' ') << ")";
clone->add_warning("W53", "Similar to another clone " + code,
num_clone <= WARN_NUM_CLONES_SIMILAR ? LEVEL_WARN : LEVEL_INFO);
......@@ -1485,7 +1505,8 @@ int main (int argc, char **argv)
}
}
cout << endl ;
if (clone_on_stdout)
cout << endl ;
out_clone.close();
} // end for clones
......@@ -1494,6 +1515,7 @@ int main (int argc, char **argv)
if (num_clone > last_num_clone_on_stdout)
{
cout << endl << endl ;
cout << "#### Clones "
<< "#" << setfill('0') << setw(WIDTH_NB_CLONES) << last_num_clone_on_stdout + 1 << " to "
<< "#" << setfill('0') << setw(WIDTH_NB_CLONES) << num_clone << "..." << endl ;
......
......@@ -699,7 +699,8 @@ in the following situations:
the center of the window may be shifted up to 15 bases from the
actual center.
- in a second pass, on the standard output and in both `.vidjil` and `.vdj.fa` files
- in a second pass, on the `.vidjil` and `.vdj.fa` files
(and, for the first 50 clones, on the standard output)
- at the end of the clones detection (default command `-c clones`,
on a number of clones limited by the `--max-designations` option)
......
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