Skip to content

Commit

Permalink
debug ld clump
Browse files Browse the repository at this point in the history
  • Loading branch information
Zilong-Li committed Sep 27, 2024
1 parent e44eb67 commit 33092ac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
27 changes: 14 additions & 13 deletions src/LD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,20 @@ std::tuple<Int2D, Int2D> 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++) {
Expand Down
4 changes: 2 additions & 2 deletions src/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ struct SNPld {
std::vector<int> pos; // pos of each SNP
std::vector<int> end_pos; // 0-based index for last snp pos
std::vector<std::string> chr; // chr sequences
std::vector<int> ws; // the snp index, i.e the index for lead SNP
std::vector<int> we; // the number of SNPs (including lead SNP) in a window
std::vector<int> ws, we; // the snp index, i.e the index for lead SNP
// std::vector<int> we; // the number of SNPs (including lead SNP) in a window
Double1D af; // allele frequency
};

Expand Down

0 comments on commit 33092ac

Please sign in to comment.