diff --git a/algo/core/windowExtractor.cpp b/algo/core/windowExtractor.cpp index 8364d8fdaf9931e993a17ca5116b65d83cea8c15..6fb8b5ab28c228fbeccb9e83de2c918f7f3cdc47 100644 --- a/algo/core/windowExtractor.cpp +++ b/algo/core/windowExtractor.cpp @@ -18,7 +18,8 @@ WindowsStorage *WindowExtractor::extract(OnlineBioReader *reads, map &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; } diff --git a/algo/core/windowExtractor.h b/algo/core/windowExtractor.h index f0867f6927736b98b06a08dd5a9eea20caa96aea..d4b80cf268feb694c03d02faac73ceaed8876364 100644 --- a/algo/core/windowExtractor.h +++ b/algo/core/windowExtractor.h @@ -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 &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 diff --git a/algo/vidjil.cpp b/algo/vidjil.cpp index 21c10494b584a82b5e13b739cff225fe265a6e62..60d62961d17d2b4e88a0d4feec3afedf011b4e7b 100644 --- a/algo/vidjil.cpp +++ b/algo/vidjil.cpp @@ -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();