Skip to content

Commit

Permalink
Add mean-imputation back to scoring when samples aren't using a refer…
Browse files Browse the repository at this point in the history
…ence panel
  • Loading branch information
smlmbrt committed Sep 27, 2023
1 parent 8faa6e5 commit 83a9c37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/local/plink2_score.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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(' ')
Expand Down

0 comments on commit 83a9c37

Please sign in to comment.