From 9b08127add884d8f9cf61b87b5c3706433e27dd6 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sun, 27 Aug 2017 10:21:13 +0000 Subject: -a ReadFile_geno: stop warnings after 10x --- src/io.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/io.cpp') diff --git a/src/io.cpp b/src/io.cpp index 80adbe6..bfbfc15 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -659,6 +659,7 @@ bool ReadFile_geno(const string &file_geno, const set &setSnps, ns_test = 0; file_pos = 0; + auto count_warnings = 0; while (!safeGetline(infile, line).eof()) { ch_ptr = strtok((char *)line.c_str(), " , \t"); rs = ch_ptr; @@ -679,10 +680,12 @@ bool ReadFile_geno(const string &file_geno, const set &setSnps, } if (mapRS2bp.count(rs) == 0) { - if (debug) { + if (debug && count_warnings++ < 10) { std::string msg = "Can't figure out position for "; msg += rs; debug_msg(msg); + if (count_warnings == 10) + debug_msg("Skipping similar warnings"); } chr = "-9"; b_pos = -9; -- cgit v1.2.3