Commit 850123fa authored by Mathieu Giraud's avatar Mathieu Giraud

core/windowExtractor.{h,cpp}, vidjil.cpp: W09 when interrupted during first pass

parent 2478e5c5
Pipeline #143914 passed with stages
in 39 minutes and 33 seconds
......@@ -18,7 +18,8 @@ WindowsStorage *WindowExtractor::extract(OnlineBioReader *reads,
map<string, string> &windows_labels, bool only_labeled_windows,
bool keep_unsegmented_as_clone,
double nb_expected, int nb_reads_for_evalue,
VirtualReadScore *scorer) {
VirtualReadScore *scorer,
SampleOutput *output) {
init_stats();
WindowsStorage *windowsStorage = new WindowsStorage(windows_labels);
......@@ -34,7 +35,9 @@ WindowsStorage *WindowExtractor::extract(OnlineBioReader *reads,
if (global_interrupted)
{
cout << WARNING_STRING << "Interrupted after processing " << nb_reads << " reads" << endl ;
string msg = "Interrupted after processing " + string_of_int(nb_reads) + " reads" ;
if (output) output->add_warning("W09", msg, LEVEL_WARN);
cout << WARNING_STRING << msg << endl ;
break;
}
......
......@@ -12,6 +12,7 @@
#include "read_storage.h"
#include "bioreader.hpp"
#include "read_score.h"
#include "output.h"
#define NB_BINS_CLONES 10
#define MAX_VALUE_BINS_CLONES 1000
......@@ -53,6 +54,7 @@ class WindowExtractor {
* @param nb_expected: maximal e-value of the segmentation
* @param nb_reads_for_evalue: number of reads, used for e-value computation. Can be approximate or faked.
* @param scorer: how reads are scored (only the best ones are keeped for large clones)
* @param output: global output, used here for warnings
* @return a pointer to a WindowsStorage that will contain all the windows.
* It is a pointer so that the WindowsStorage is not duplicated.
* @post Statistics on segmentation will be provided through the getSegmentationStats() methods
......@@ -63,7 +65,8 @@ class WindowExtractor {
map<string, string> &windows_labels, bool only_labeled_windows=false,
bool keep_unsegmented_as_clone=false,
double nb_expected = THRESHOLD_NB_EXPECTED, int nb_reads_for_evalue = 1,
VirtualReadScore *scorer = &DEFAULT_READ_SCORE);
VirtualReadScore *scorer = &DEFAULT_READ_SCORE,
SampleOutput *output = NULL);
/**
* @return the average length of sequences whose segmentation has been classified as seg
......
......@@ -1133,7 +1133,7 @@ int main (int argc, char **argv)
windows_labels, only_labeled_windows,
keep_unsegmented_as_clone,
expected_value_kmer, nb_reads_for_evalue,
readScorer);
readScorer, &output);
windowsStorage->setIdToAll();
size_t nb_total_reads = we.getNbReads();
......
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