From 4b29cbd55a7754f92e514d864b6ff6ff7c2401d1 Mon Sep 17 00:00:00 2001 From: Christopher Chang Date: Tue, 3 Dec 2024 20:09:16 -0500 Subject: [PATCH] --sort-vars forced-QUAL/FILTER segfault fix --- 2.0/Tests/TEST_ONE_WAY_EXPORT/run_tests.sh | 6 +++--- 2.0/Tests/TEST_PHASED_VCF/run_tests.sh | 6 +++--- 2.0/plink2.cc | 6 +++--- 2.0/plink2_data.cc | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/2.0/Tests/TEST_ONE_WAY_EXPORT/run_tests.sh b/2.0/Tests/TEST_ONE_WAY_EXPORT/run_tests.sh index 98368ae9..3274b426 100755 --- a/2.0/Tests/TEST_ONE_WAY_EXPORT/run_tests.sh +++ b/2.0/Tests/TEST_ONE_WAY_EXPORT/run_tests.sh @@ -6,11 +6,11 @@ set -exo pipefail # manually-sanity-checked ground truth files. $1/plink2 $2 $3 --pfile all_ploidy vzs --snps-only --export phylip --out plink2_test -plink2 --zd plink2_test.phy.want.zst > plink2_test.phy.want +$1/plink2 --zd plink2_test.phy.want.zst > plink2_test.phy.want diff -q plink2_test.phy plink2_test.phy.want $1/plink2 $2 $3 --pfile all_ploidy vzs --chr PAR1,X,PAR2 --keep-females --snps-only --export phylip-phased --out plink2_test.phased -plink2 --zd plink2_test.phased.phy.want.zst > plink2_test.phased.phy.want +$1/plink2 --zd plink2_test.phased.phy.want.zst > plink2_test.phased.phy.want diff -q plink2_test.phased.phy plink2_test.phased.phy.want $1/plink2 $2 $3 --pfile all_ploidy vzs --export A --out plink2_test -plink2 --zd plink2_test.raw.want.zst > plink2_test.raw.want +$1/plink2 --zd plink2_test.raw.want.zst > plink2_test.raw.want diff -q plink2_test.raw plink2_test.raw.want diff --git a/2.0/Tests/TEST_PHASED_VCF/run_tests.sh b/2.0/Tests/TEST_PHASED_VCF/run_tests.sh index 4351836c..e3609798 100755 --- a/2.0/Tests/TEST_PHASED_VCF/run_tests.sh +++ b/2.0/Tests/TEST_PHASED_VCF/run_tests.sh @@ -132,7 +132,7 @@ plink --bfile plink1_data --clump plink2_glm_dbl.PHENO1.glm.logistic --clump-snp # ($12 != "") check needed because plink 1.x puts two blank lines at the end of # the .clumped file. cat plink1_test.clumped | tail -n +2 | awk '{if ($12 == "NONE") $12 = "."; if ($12 != "") print $3"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11"\t"$12}' > plink1_test.clump_compare -plink2 --bfile plink1_data --clump cols=+f plink2_glm_dbl.PHENO1.glm.logistic --clump-p1 0.1 --clump-p2 0.2 --out plink2_test +$1/plink2 --bfile plink1_data --clump cols=+f plink2_glm_dbl.PHENO1.glm.logistic --clump-p1 0.1 --clump-p2 0.2 --out plink2_test cat plink2_test.clumps | tail -n +2 | awk '{print $3"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11"\t"$12}' > plink2_test.clump_compare diff -q plink1_test.clump_compare plink2_test.clump_compare @@ -141,7 +141,7 @@ $1/plink2 $2 $3 --bfile plink1_data --maf 0.02 --pheno pheno_qt.txt --glm allow- python3 glm_compare.py -1 plink1_glm.assoc.linear -2 plink2_glm.PHENO1.glm.linear -t 0.1 plink --bfile plink1_data --clump plink2_glm.PHENO1.glm.linear --clump-snp-field ID --clump-p1 0.1 --clump-p2 0.2 --out plink1_test cat plink1_test.clumped | tail -n +2 | awk '{if ($12 == "NONE") $12 = "."; if ($12 != "") print $3"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11"\t"$12}' > plink1_test.clump_compare -plink2 --bfile plink1_data --clump cols=+f plink2_glm.PHENO1.glm.linear --clump-p1 0.1 --clump-p2 0.2 --out plink2_test +$1/plink2 --bfile plink1_data --clump cols=+f plink2_glm.PHENO1.glm.linear --clump-p1 0.1 --clump-p2 0.2 --out plink2_test cat plink2_test.clumps | tail -n +2 | awk '{print $3"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11"\t"$12}' > plink2_test.clump_compare diff -q plink1_test.clump_compare plink2_test.clump_compare @@ -167,7 +167,7 @@ python3 glm_compare.py -1 plink1_glm.assoc.linear -2 plink2_glm.PHENO1.glm.linea $1/plink2 $2 $3 --bfile plink1_data --maf 0.02 --pheno pheno_qt.txt --glm hide-covar --covar plink2_pca.eigenvec --out plink2_glm plink --bfile plink1_data --clump plink2_glm.PHENO1.glm.linear --clump-snp-field ID --clump-p1 0.1 --clump-p2 0.2 --out plink1_test cat plink1_test.clumped | tail -n +2 | awk '{if ($12 == "NONE") $12 = "."; if ($12 != "") print $3"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11"\t"$12}' > plink1_test.clump_compare -plink2 --bfile plink1_data --clump cols=+f plink2_glm.PHENO1.glm.linear --clump-p1 0.1 --clump-p2 0.2 --out plink2_test +$1/plink2 --bfile plink1_data --clump cols=+f plink2_glm.PHENO1.glm.linear --clump-p1 0.1 --clump-p2 0.2 --out plink2_test cat plink2_test.clumps | tail -n +2 | awk '{print $3"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11"\t"$12}' > plink2_test.clump_compare diff -q plink1_test.clump_compare plink2_test.clump_compare diff --git a/2.0/plink2.cc b/2.0/plink2.cc index 9749e695..52037e6d 100644 --- a/2.0/plink2.cc +++ b/2.0/plink2.cc @@ -44,7 +44,7 @@ namespace plink2 { #endif -static const char ver_str[] = "PLINK v2.0.0-a.6.2" +static const char ver_str[] = "PLINK v2.0.0-a.6.3" #ifdef NOLAPACK "NL" #elif defined(LAPACK_ILP64) @@ -72,10 +72,10 @@ static const char ver_str[] = "PLINK v2.0.0-a.6.2" #elif defined(USE_AOCL) " AMD" #endif - " (24 Nov 2024)"; + " (3 Dec 2024)"; static const char ver_str2[] = // include leading space if day < 10, so character length stays the same - "" + " " #ifdef NOLAPACK #elif defined(LAPACK_ILP64) diff --git a/2.0/plink2_data.cc b/2.0/plink2_data.cc index 529496ed..15e26c50 100644 --- a/2.0/plink2_data.cc +++ b/2.0/plink2_data.cc @@ -8902,7 +8902,7 @@ PglErr WritePvarResortedInterval(const ChrInfo* write_cip, const uint32_t* varia if (write_qual) { *cswritep++ = '\t'; - if (!IsSet(qual_present, variant_uidx)) { + if ((!qual_present) || (!IsSet(qual_present, variant_uidx))) { *cswritep++ = '.'; } else { cswritep = ftoa_g(quals[variant_uidx], cswritep); @@ -8911,7 +8911,7 @@ PglErr WritePvarResortedInterval(const ChrInfo* write_cip, const uint32_t* varia if (write_filter) { *cswritep++ = '\t'; - if (!IsSet(filter_present, variant_uidx)) { + if ((!filter_present) || (!IsSet(filter_present, variant_uidx))) { *cswritep++ = '.'; } else if (!IsSet(filter_npass, variant_uidx)) { cswritep = strcpya_k(cswritep, "PASS");