Skip to content

Commit

Permalink
maf not af for prune
Browse files Browse the repository at this point in the history
  • Loading branch information
Zilong-Li committed Dec 22, 2023
1 parent a99399c commit f68eb57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ void calc_ld_metrics(std::string fileout,
double r = (G.col(i).array() * G.col(k).array() * (sds(i) * sds(k))).sum() * df;
if(r * r > r2_tol)
{
int o = F(k) > F(i) ? i : k;
int o = MAF(F(k)) > MAF(F(i)) ? i : k;
keep(o) = false;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ typedef unsigned long long uint64;
using Int1D = std::vector<int>;
using Int2D = std::vector<Int1D>;

#define MAF(a) ((a)>0.5?(1-a):(a))

struct Line
{
std::string data;
Expand Down

0 comments on commit f68eb57

Please sign in to comment.