From 56b38570099741756bee880d2261d11ec8a2aa22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Flutre?= Date: Wed, 22 Nov 2017 13:09:40 +0100 Subject: [PATCH] minor improv in imputeGenosWithMeanPerPop() --- DESCRIPTION | 2 +- R/quantgen.R | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 59d4a56..57fb7a1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: rutilstimflutre Title: Timothee Flutre's personal R code -Version: 0.151.0 +Version: 0.151.1 Authors@R: c( person("Timothee", "Flutre", email="timothee.flutre@inra.fr", role=c("aut", "ctb", "cre")), person("Peter", "Carbonetto", role="aut", comment="function from varbvs example"), diff --git a/R/quantgen.R b/R/quantgen.R index 640d5ce..f52975f 100644 --- a/R/quantgen.R +++ b/R/quantgen.R @@ -5104,6 +5104,8 @@ imputeGenosWithMeanPerPop <- function(X, pops, min.maf.pop=0.1, pops$ind <- as.character(pops$ind) pops$pop <- as.character(pops$pop) + if(any(is.na(pops$pop))) + pops <- pops[! is.na(pops$pop),] if(verbose > 0){ msg <- paste0("nb of genotypes: ", nrow(X),