From 28588ac3c083a35a94b6b8eeb4bc2a140455ea94 Mon Sep 17 00:00:00 2001 From: Zilong-Li Date: Sat, 2 Jul 2022 17:20:19 +0100 Subject: [PATCH] fix bug for pcangsd --- CHANGELOG.org | 3 +++ Makefile | 2 +- src/FileBeagle.cpp | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index b25911e..e29a04e 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -1,3 +1,6 @@ +- v0.2.1 + - bug fix for PCAngsd + - v0.2.0 - add =--maf= option for SNPs filtering - faster parser for beagle file diff --git a/Makefile b/Makefile index 15ce418..46861d8 100755 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ IOMP5 = 0 ########################### end ########################### -VERSION=0.2.0 +VERSION=0.2.1 # detect OS architecture and add flags Platform := $(shell uname -s) diff --git a/src/FileBeagle.cpp b/src/FileBeagle.cpp index 3d5165d..355f2be 100644 --- a/src/FileBeagle.cpp +++ b/src/FileBeagle.cpp @@ -34,17 +34,17 @@ void FileBeagle::read_all() while (tgets(fp, &buffer, &bufsize)) { if (buffer != original) - { original = buffer; - } tok = strtok_r(buffer, delims, &buffer); tok = strtok_r(NULL, delims, &buffer); tok = strtok_r(NULL, delims, &buffer); - for (i = 0; i < nsamples * 3; i++) + for (i = 0; i < nsamples; i++) { tok = strtok_r(NULL, delims, &buffer); - assert(tok != NULL); - P(i, j) = strtod(tok, NULL); + P(2 * i + 0, j) = strtod(tok, NULL); + tok = strtok_r(NULL, delims, &buffer); + P(2 * i + 1, j) = strtod(tok, NULL); + tok = strtok_r(NULL, delims, &buffer); } buffer = original; j++;