From 69805861a87db8274731febd8d005c480c96aa24 Mon Sep 17 00:00:00 2001 From: tj Date: Fri, 18 Mar 2022 10:48:30 -0700 Subject: [PATCH] update GWAS() to remove extra snps in user's mapfile --- src/3.GWAS/src/GWAS.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/3.GWAS/src/GWAS.jl b/src/3.GWAS/src/GWAS.jl index 1d2ac9cc..2efbcd1c 100644 --- a/src/3.GWAS/src/GWAS.jl +++ b/src/3.GWAS/src/GWAS.jl @@ -77,6 +77,11 @@ function GWAS(mme,map_file,marker_effects_file::AbstractString...; window_size_bp = map(Int64,parse(Float64,split(window_size)[1])*1_000_000) mapfile = (header == true ? readdlm(map_file,',',header=true)[1] : readdlm(map_file,',')) + #remove SNPs in mapfile that are not used in Bayesian analysis (e.g., removed in QC) + snpID = mme.M[1].markerID + in_snpID = findall(x -> x ∈ snpID, mapfile[:,1]) + mapfile = mapfile[in_snpID,:] + chr = map(string,mapfile[:,2]) pos = map(Int64,mapfile[:,3])