Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update GWAS: fixed data type for 2nd and 3rd column when read mapfile. #156

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/1.JWAS/src/markers/BayesianAlphabet/MTBayesC0L.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function MTBayesL!(genotypes,ycorr_array,vare)
MTBayesL!(genotypes.mArray,genotypes.mRinvArray,genotypes.mpRinvm,
ycorr_array,genotypes.α,genotypes.gammaArray,vare,genotypes.G)
ycorr_array,genotypes.α,genotypes.gammaArray,vare,genotypes.G.val)
end

function MTBayesC0!(genotypes,ycorr_array,vare)
MTBayesL!(genotypes.mArray,genotypes.mRinvArray,genotypes.mpRinvm,
ycorr_array,genotypes.α,[1.0],vare,genotypes.G)
ycorr_array,genotypes.α,[1.0],vare,genotypes.G.val)
end

function MTBayesL!(xArray,xRinvArray,xpRinvx,
Expand Down
6 changes: 3 additions & 3 deletions src/3.GWAS/src/GWAS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function GWAS(mme,map_file,marker_effects_file::AbstractString...;
end

window_size_bp = map(Int64,parse(Float64,split(window_size)[1])*1_000_000)
mapfile = CSV.read(map_file, DataFrame, header = header, types=Dict(1 => String)) #the 1st column (markerID) must be string
mapfile = CSV.read(map_file, DataFrame, header = header, types=Dict(1 => String, 2 => String, 3 => Int64)) #the 1st column (markerID) must be string
#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])
Expand All @@ -85,8 +85,8 @@ function GWAS(mme,map_file,marker_effects_file::AbstractString...;
error("Please check the 1st column of the mapfile (i.e., marker ID)")
end

chr = map(string,mapfile[:,2])
pos = map(Int64,mapfile[:,3])
chr = mapfile[:,2]
pos = mapfile[:,3]

window_size_nSNPs = Array{Int64,1}() #save number of markers in ith window for all windows
window_chr = Array{String,1}() #1
Expand Down
Loading