[Genabel-commits] r1269 - pkg/ProbABEL/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jul 14 23:31:53 CEST 2013


Author: lckarssen
Date: 2013-07-14 23:31:53 +0200 (Sun, 14 Jul 2013)
New Revision: 1269

Modified:
   pkg/ProbABEL/src/gendata.cpp
Log:
Small improvement in error messages when reading the genetic data from file. 


Modified: pkg/ProbABEL/src/gendata.cpp
===================================================================
--- pkg/ProbABEL/src/gendata.cpp	2013-07-09 09:14:43 UTC (rev 1268)
+++ pkg/ProbABEL/src/gendata.cpp	2013-07-14 21:31:53 UTC (rev 1269)
@@ -19,6 +19,8 @@
 
 void gendata::get_var(int var, double * data)
 {
+    // Read the genetic data for SNP 'var' and store in the array 'data'
+
     if (DAG == NULL)            // Read from text file
     {
         for (int i = 0; i < G.nrow; i++)
@@ -56,10 +58,12 @@
 
                 if (endptr == str.c_str()) {
                     cerr << "No digits were found while reading genetic data"
+                         << " (individual " << i + 1
+                         << ", position " << var + 1 ")"
                          << endl;
                     exit(EXIT_FAILURE);
                 }
-
+                cout << "!" << val << "# ";
                 /* If we got here, strtod() successfully parsed a number */
                 data[j++] = val;
             }
@@ -206,6 +210,8 @@
 
                     if (endptr == tmpstr.c_str()) {
                         cerr << "No digits were found while reading genetic data"
+                             << " (individual " << i + 1
+                             << ", position " << j + 1 << ")"
                              << endl;
                         exit(EXIT_FAILURE);
                     }



More information about the Genabel-commits mailing list