sinarueeger / GWAS.utils

R package 📦 for handy functions when working with GWAS (summary) data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add max_iter to while condition in eff_nbr_tests

sinarueeger opened this issue · comments

Something like

eff_nbr_tests <- function(..., max_iter = 100)
{
...
  K <- 1
  while (sum.tp / sum(svd.data$d) < 0.995 & K < k_iteration) {
    zhc.correction <- zhc.correction + 1
    sum.tp <- sum.tp + svd.data$d[zhc.correction]
    K <- K + 1
  }
if(K == max_iter) message("max_iter reached, but ")

}