From be45bcca0ddc1d88066bd18a56ca57d588e41e99 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sat, 26 Aug 2017 10:00:18 +0000 Subject: Debug: only output check on -debug --- src/io.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/io.cpp') diff --git a/src/io.cpp b/src/io.cpp index f5783cd..80adbe6 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -608,7 +608,7 @@ bool ReadFile_geno(const string &file_geno, const set &setSnps, const double &r2_level, map &mapRS2chr, map &mapRS2bp, map &mapRS2cM, vector &snpInfo, - size_t &ns_test) { + size_t &ns_test, bool debug) { indicator_snp.clear(); snpInfo.clear(); @@ -679,10 +679,11 @@ bool ReadFile_geno(const string &file_geno, const set &setSnps, } if (mapRS2bp.count(rs) == 0) { - std::string msg = "Can't figure out position for "; - msg += rs; - debug_msg(msg); - + if (debug) { + std::string msg = "Can't figure out position for "; + msg += rs; + debug_msg(msg); + } chr = "-9"; b_pos = -9; cM = -9; @@ -1633,7 +1634,7 @@ bool PlinkKin(const string &file_bed, vector &indicator_snp, // genotype and calculate K. bool ReadFile_geno(const string file_geno, vector &indicator_idv, vector &indicator_snp, gsl_matrix *UtX, gsl_matrix *K, - const bool calc_K) { + const bool calc_K, bool debug) { igzstream infile(file_geno.c_str(), igzstream::in); if (!infile) { cout << "error reading genotype file:" << file_geno << endl; @@ -1737,7 +1738,7 @@ bool ReadFile_geno(const string &file_geno, vector &indicator_idv, vector &indicator_snp, vector> &Xt, gsl_matrix *K, const bool calc_K, const size_t ni_test, - const size_t ns_test) { + const size_t ns_test, bool debug) { igzstream infile(file_geno.c_str(), igzstream::in); if (!infile) { cout << "error reading genotype file:" << file_geno << endl; -- cgit v1.2.3