From 83a9c375cafa21974d6c5866e86167c58712f7d9 Mon Sep 17 00:00:00 2001 From: smlmbrt Date: Wed, 27 Sep 2023 16:00:21 +0100 Subject: [PATCH] Add mean-imputation back to scoring when samples aren't using a reference panel --- modules/local/plink2_score.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/local/plink2_score.nf b/modules/local/plink2_score.nf index f8b21fc3..4b4c5b8e 100644 --- a/modules/local/plink2_score.nf +++ b/modules/local/plink2_score.nf @@ -41,11 +41,11 @@ process PLINK2_SCORE { def maxcol = (scoremeta.n_scores.toInteger() + 2) // id + effect allele = 2 cols // if we load allelic frequencies, don't do mean imputation - def no_imputation = (ref_afreq.name == 'NO_FILE') ? "no-mean-imputation" : "" + def no_imputation = ((ref_afreq.name == 'NO_FILE') && (meta.n_samples.toInteger() < 50)) ? "no-mean-imputation" : "" // if no-mean-imputation, be more efficient def error_on_freq_calc = (no_imputation == "no-mean-imputation") ? "--error-on-freq-calc" : "" - def cols = (meta.n_samples.toInteger() < 50) ? 'header-read cols=+scoresums,+denom,-fid' : 'header-read cols=+scoresums,+denom,-fid' + def cols = 'header-read cols=+scoresums,+denom,-fid' def recessive = (scoremeta.effect_type == 'recessive') ? ' recessive ' : '' def dominant = (scoremeta.effect_type == 'dominant') ? ' dominant ' : '' args2 = [args2, cols, 'list-variants', no_imputation, recessive, dominant, error_on_freq_calc].join(' ')