From 33092acee232fc30c38d92877864cb37d5b412f7 Mon Sep 17 00:00:00 2001 From: Zilong-Li Date: Fri, 27 Sep 2024 14:10:48 +0200 Subject: [PATCH] debug ld clump --- src/LD.cpp | 27 ++++++++++++++------------- src/Utils.hpp | 4 ++-- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/LD.cpp b/src/LD.cpp index f1dcb38..4a6c326 100644 --- a/src/LD.cpp +++ b/src/LD.cpp @@ -69,19 +69,20 @@ std::tuple get_target_snp_idx(const SNPld& snp_t, Int1D idx, bp; UMapIntInt mpos; int c, s, e, p, i; - Int1D ord; - for (c = 0; c < (int)snp.chr.size(); c++) { - i = 0; - while (snp_t.chr[i] != snp.chr[c]) { - i++; - } - ord.push_back(i); - } - if (!std::is_sorted(ord.begin(), ord.end())) - cao.error( - "the association file may be not sorted or not matching the order of " - ".kept.bim file!"); - + // Int1D ord; + // for (c = 0; c < (int)snp.chr.size(); c++) { + // i = 0; + // while (snp_t.chr[i] != snp.chr[c]) { + // i++; + // } + // ord.push_back(i); + // } + // if (!std::is_sorted(ord.begin(), ord.end())) + // cao.error( + // "the association file may be not sorted or not matching the order of " + // ".kept.bim file!"); + + cao.print("hellooooooooooooooooooooooooooo"); Int2D idx_per_chr(snp_t.chr.size()); Int2D bp_per_chr(snp_t.chr.size()); for (int tc = 0; tc < (int)snp_t.chr.size(); tc++) { diff --git a/src/Utils.hpp b/src/Utils.hpp index 73ef46a..bce09da 100644 --- a/src/Utils.hpp +++ b/src/Utils.hpp @@ -51,8 +51,8 @@ struct SNPld { std::vector pos; // pos of each SNP std::vector end_pos; // 0-based index for last snp pos std::vector chr; // chr sequences - std::vector ws; // the snp index, i.e the index for lead SNP - std::vector we; // the number of SNPs (including lead SNP) in a window + std::vector ws, we; // the snp index, i.e the index for lead SNP + // std::vector we; // the number of SNPs (including lead SNP) in a window Double1D af; // allele frequency };