[GenABEL-dev] [Genabel-commits] r1689 - pkg/ProbABEL/src
L.C. Karssen
lennart at karssen.org
Mon Apr 14 22:55:01 CEST 2014
Hi Maarten,
Thanks for doing the cleaning :-)!
Lennart.
On 14-04-14 22:19, noreply at r-forge.r-project.org wrote:
> Author: maartenk
> Date: 2014-04-14 22:19:03 +0200 (Mon, 14 Apr 2014)
> New Revision: 1689
>
> Modified:
> pkg/ProbABEL/src/gendata.cpp
> Log:
> removed some old non functional code
>
> Modified: pkg/ProbABEL/src/gendata.cpp
> ===================================================================
> --- pkg/ProbABEL/src/gendata.cpp 2014-04-11 09:26:28 UTC (rev 1688)
> +++ pkg/ProbABEL/src/gendata.cpp 2014-04-14 20:19:03 UTC (rev 1689)
> @@ -253,7 +253,6 @@
> }
>
> std::string tmpid, tmpstr;
> - char inStr[8];
>
> int k = 0;
> for (unsigned int i = 0; i < npeople; i++)
> @@ -290,58 +289,11 @@
> infile >> tmpstr;
> }
>
> - int oldstyle = 0;
> - if (oldstyle == 1)
> - {
> - for (unsigned int j = 0; j < (nsnps * ngpreds); j++)
> - {
> - if (infile.good())
> - {
> - infile >> inStr;
> - // tmpstr contains the dosage/probability in
> - // string form. Convert it to double (if tmpstr is
> - // NaN it will be set to nan).
> - double dosage;
> - char *endptr;
> - errno = 0; // To distinguish success/failure
> - // after strtod()
> + std::string all_numbers;
> + all_numbers.reserve(nsnps * ngpreds * 7);
> + std::getline(infile, all_numbers);
> + mldose_line_to_matrix(k, all_numbers.c_str(), nsnps * ngpreds);
>
> - dosage = strtod(inStr, &endptr);
> - if ((errno == ERANGE
> - && (dosage == HUGE_VALF || dosage == HUGE_VALL))
> - || (errno != 0 && dosage == 0))
> - {
> - perror("Error while reading genetic data (strtod)");
> - exit(EXIT_FAILURE);
> - }
> -
> - if (endptr == tmpstr.c_str())
> - {
> - cerr
> - << "No digits were found while reading genetic data"
> - << " (individual " << i + 1 << ", position "
> - << j + 1 << ")" << endl;
> - exit(EXIT_FAILURE);
> - }
> - /* If we got here, strtod() successfully parsed a number */
> - G.put(dosage, k, j);
> - }
> - else
> - {
> - std::cerr << "cannot read dose-file: " << fname
> - << "check skipd and ngpreds parameters\n";
> - infile.close();
> - exit(1);
> - }
> - }
> - }
> - else
> - {
> - std::string all_numbers;
> - all_numbers.reserve(nsnps * ngpreds * 7);
> - std::getline(infile, all_numbers);
> - mldose_line_to_matrix(k, all_numbers.c_str(), nsnps * ngpreds);
> - }
> k++;
> }
> else
> @@ -361,7 +313,6 @@
>
> }
>
> -
> // HERE NEED A NEW CONSTRUCTOR BASED ON DATABELBASECPP OBJECT
> gendata::~gendata()
> {
>
> _______________________________________________
> Genabel-commits mailing list
> Genabel-commits at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits
>
--
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
L.C. Karssen
Utrecht
The Netherlands
lennart at karssen.org
http://blog.karssen.org
GPG key ID: A88F554A
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: OpenPGP digital signature
URL: <http://lists.r-forge.r-project.org/pipermail/genabel-devel/attachments/20140414/f14ff67b/attachment-0001.sig>
More information about the genabel-devel
mailing list