Skip to content

Commit

Permalink
if cF, constrain init F as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Zilong-Li committed Feb 5, 2024
1 parent ad376bb commit eaf2368
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/admixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,16 @@ void Admixture::setStartPoint(const std::unique_ptr<BigAss> & genome, std::strin
for(int s = 0; s < S; s++) P.col(m + s) = AE.col(s).reshaped(C, C).colwise().sum();
m += S;
}
if(cF)
{
for(int k = 0; k < K; k++)
{
for(int c = 0; c < C; c++)
for(int m = 0; m < M; m++)
if(F(k * C + c, m) < P(c, m)) F(k * C + c, m) = P(c, m);
F.middleRows(k * C, C).rowwise() /= F.middleRows(k * C, C).colwise().sum();
}
}

if(!qfile.empty()) load_csv(Q, qfile);
}
Expand Down

0 comments on commit eaf2368

Please sign in to comment.