From d4192142b85c0b8543b6b435d3c690ab840f4d56 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Thu, 29 Aug 2019 18:59:13 -0700 Subject: [PATCH 1/7] Added all results files to gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index b7f3332..6d5306c 100644 --- a/.gitignore +++ b/.gitignore @@ -198,3 +198,7 @@ venv.bak/ .mypy_cache/ .dmypy.json dmypy.json + +# Ignore results files +Results.txt +results.txt \ No newline at end of file From e101ff3585a14fc29f090f1cd26566c3867292b3 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Thu, 29 Aug 2019 19:56:14 -0700 Subject: [PATCH 2/7] Added Julius van der Werf's example to test agains --- Excel/van der Werf.xlsx | Bin 0 -> 12285 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Excel/van der Werf.xlsx diff --git a/Excel/van der Werf.xlsx b/Excel/van der Werf.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..2cc896006a3e737aa02ca23d007d73c7b2c7a796 GIT binary patch literal 12285 zcmeHtWm_Bzwr=AdAh^2*cWWTHy99T4cXxM(1Pc}*xJz&g4nZ4tm*95Do|&^}XZC&W z4>(gFs#@xOpX$}i*HVy%fJ6sC17HCF013dR?gq^R3;+m+0szneu;5z4cDBwYw$6Gg z9`+_qIt=bM*2MXc;MBPQ@YnnQd;A}kKzZ`GTn`gs|EWZqaLPN&S_eVciY0?@sFciv z#N;QM^s@O}4>#9M8k{65YI#>vbumvqolW&rwLTR|^zP;5LknDZ)sWG3Wh`H^eHiqn z#Z&cB#Ncd@wvGUUrqfGVLlD6B&%6{}CyW(b#dB}djYBcn{@~D5p&TK9cbaB7r5-(nTRkoKG2!O(0EVf>iiR|a=H!`mV ziSTN%dX6U6PK*q{&i}R4|HJ0_Z$G^}QC9xdQbSKA9>WH2WTeElVt zk?Ug$$nij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_#Q%MW|5$zao#prO*PkqluN}G9pYr=K?016S8+d;bXyE=q@Mk;kcj)i6 z{hv?|!hb-2uk?Rs_`QhzlVR$$>V19szb$EhXZbx}`; t!VpU-tGp;qNKXpM>uy z{~-KJLi9WOuW7=cSO7qj3IO4Kf4gOCruOJQes Date: Fri, 8 Nov 2019 18:33:01 -0800 Subject: [PATCH 3/7] Add Julia stuff to gitignore --- .gitignore | 30 ++++++- .idea/dictionaries/cclea.xml | 9 ++ .idea/workspace.xml | 167 +++++++++++++++++++++++++++++++++++ Julia/install.jl | 3 + 4 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 .idea/dictionaries/cclea.xml create mode 100644 .idea/workspace.xml create mode 100644 Julia/install.jl diff --git a/.gitignore b/.gitignore index 6d5306c..2ed722b 100644 --- a/.gitignore +++ b/.gitignore @@ -201,4 +201,32 @@ dmypy.json # Ignore results files Results.txt -results.txt \ No newline at end of file +results.txt + +### Julia.gitignore +# (https://github.com/github/gitignore/blob/master/Julia.gitignore) + +# Files generated by invoking Julia with --code-coverage +*.jl.cov +*.jl.*.cov + +# Files generated by invoking Julia with --track-allocation +*.jl.mem + +# System-specific files and directories generated by the BinaryProvider and BinDeps packages +# They contain absolute paths specific to the host computer, and so should not be committed +deps/deps.jl +deps/build.log +deps/downloads/ +deps/usr/ +deps/src/ + +# Build artifacts for creating documentation generated by the Documenter package +docs/build/ +docs/site/ + +# File generated by Pkg, the package manager, based on a corresponding Project.toml +# It records a fixed state of all packages used by the project. As such, it should not be +# committed for packages, but should be committed for applications that require a static +# environment. +Manifest.toml \ No newline at end of file diff --git a/.idea/dictionaries/cclea.xml b/.idea/dictionaries/cclea.xml new file mode 100644 index 0000000..8c49cbc --- /dev/null +++ b/.idea/dictionaries/cclea.xml @@ -0,0 +1,9 @@ + + + + beefblup + blup + matlab + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..bbe788f --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1567039339175 + + + 1567130353481 + + + 1567131158833 + + + 1567131230009 + + + 1567131261939 + + + 1567133774405 + + + + + + + + + + + + + + + + + file://$PROJECT_DIR$/Python/beefblup.py + 44 + + + file://$PROJECT_DIR$/Python/beefblup.py + 59 + + + file://$PROJECT_DIR$/Python/beefblup.py + 71 + + + + + \ No newline at end of file diff --git a/Julia/install.jl b/Julia/install.jl new file mode 100644 index 0000000..396cdc4 --- /dev/null +++ b/Julia/install.jl @@ -0,0 +1,3 @@ + +using Pkg +Pkg.add("XLSXReader") \ No newline at end of file From 22b934dc49869790c280ba25b9907daecdc679d2 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Fri, 8 Nov 2019 18:46:11 -0800 Subject: [PATCH 4/7] Add excel reader dependency to install script --- Julia/install.jl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Julia/install.jl b/Julia/install.jl index 396cdc4..3276384 100644 --- a/Julia/install.jl +++ b/Julia/install.jl @@ -1,3 +1,12 @@ +# beefblup install +# Prepares the Julia environment for using beefblup by installing the requisite +# packages +# Usage: julia install.jl +# (C) 2019 Thomas A. Christensen II +# Licensed under BSD-3-Clause License +# Import the package manager using Pkg -Pkg.add("XLSXReader") \ No newline at end of file + +# Install requisite packages +Pkg.add("XLSX") \ No newline at end of file From 6ac985fee45f3c24bc8f4ce2994e50b59906e7ee Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Fri, 8 Nov 2019 19:01:46 -0800 Subject: [PATCH 5/7] Complete import section port --- Julia/beefblup.jl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Julia/beefblup.jl diff --git a/Julia/beefblup.jl b/Julia/beefblup.jl new file mode 100644 index 0000000..f519cf0 --- /dev/null +++ b/Julia/beefblup.jl @@ -0,0 +1,28 @@ +# beefblup +# Main script for performing single-variate BLUP to find beef cattle +# breeding values +# Usage: julia beefblup.jl +# (C) 2019 Thomas A. Christensen II +# Licensed under BSD-3-Clause License + +# Import the required packages +using XLSX + +# Display stuff +print("beefblup v 0.0.0.1\n") +print("(C) 2019 Thomas A. Christensen II\n") +print("https://github.com/millironx/beefblup\n") +print("\n") + +### Prompt User +# Ask for an input spreadsheet +print("Enter the full filename of a beefblup worksheet> ") +path = readline(stdin) + +# Ask for an output text filename +print("Enter the full filename of your desired results> ") +savepath = readline(stdin) + +# Ask for heritability +print("What is the heritability for this trait?> ") +h2 = parse(Float64, readline(stdin)) From 44ec5ae1da4b28895a23a0eb651dbcfa70f3867a Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Sat, 14 Dec 2019 09:57:48 -0800 Subject: [PATCH 6/7] Complete through "Processing and formatting" --- Julia/beefblup.jl | 110 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 101 insertions(+), 9 deletions(-) diff --git a/Julia/beefblup.jl b/Julia/beefblup.jl index f519cf0..547cfb4 100644 --- a/Julia/beefblup.jl +++ b/Julia/beefblup.jl @@ -9,20 +9,112 @@ using XLSX # Display stuff -print("beefblup v 0.0.0.1\n") -print("(C) 2019 Thomas A. Christensen II\n") -print("https://github.com/millironx/beefblup\n") +println("beefblup v 0.0.0.1") +println("(C) 2019 Thomas A. Christensen II") +println("https://github.com/millironx/beefblup") print("\n") ### Prompt User # Ask for an input spreadsheet -print("Enter the full filename of a beefblup worksheet> ") -path = readline(stdin) +# print("Enter the full filename of a beefblup worksheet> ") +# path = readline(stdin) +path = "C:\\Users\\cclea\\source\\repos\\beefblup\\Excel\\Master BLUP Worksheet.xlsx" # Ask for an output text filename -print("Enter the full filename of your desired results> ") -savepath = readline(stdin) +# print("Enter the full filename of your desired results> ") +# savepath = readline(stdin) +savepath = "C:\\Users\\cclea\\source\\repos\\beefblup\\results.txt" # Ask for heritability -print("What is the heritability for this trait?> ") -h2 = parse(Float64, readline(stdin)) +# print("What is the heritability for this trait?> ") +# h2 = parse(Float64, readline(stdin)) +h2 = 0.4 + +### Import input filename +print("[🐮]: Importing Excel file...") + +# Import data from a suitable spreadsheet +data = XLSX.readxlsx(path)[1][:] + +print("Done!\n") + +### Process input file +print("[🐮]: Processing and formatting data ...") + +# Extract the headers into a separate array +headers = data[1,:] +data = data[2:end,:] + +# Sort the array by date +data = sortslices(data, dims=1, lt=(x,y)->isless(x[2],y[2])) + +# Define fields to hold id values for animals and their parents +ids = data[:,1] +damids = data[:,3] +sireids = data[:,4] +numanimals = length(ids) + +# Find the index values for animals and their parents +dam = indexin(damids, ids) +sire = indexin(sireids, ids) + +# Store column numbers that need to be deleted +# Column 6 contains an intermediate Excel calculation and always need to +# be deleted +colstokeep = [1, 2, 3, 4, 5] + +# Find any columns that need to be deleted +for i in 7:length(headers) + if length(unique(data[:,i])) <= 1 + colname = headers[i] + print("Column '") + print(colname) + print("' does not have any unique animals and will be removed from this analysis\n") + else + push!(colstokeep, i) + end +end + +# Delete the appropriate columns from the datasheet and the headers +data = data[:, colstokeep] +headers = headers[colstokeep] + +# Determine how many contemporary groups there are +numgroups = ones(1, length(headers)-5) +for i in 6:length(headers) + numgroups[i-5] = length(unique(data[:,i])) +end + +# If there are more groups than animals, then the analysis cannot continue +if sum(numgroups) >= numanimals + println("There are more contemporary groups than animals. The analysis will + now abort.") + exit() +end + +# Define a "normal" animal as one of the last in the groups, provided that +# all traits do not have null values +normal = Array{String}(undef,1,length(headers)-5) +for i in 6:length(headers) + for j in numanimals:-1:1 + if !ismissing(data[j,i]) + normal[i-5] = data[j,i] + break + end + end +end + +# Print the results of the "normal" definition +println(" ") +println("For the purposes of this analysis, a 'normal' animal will be defined by") +println("the following traits:") +for i in 6:length(headers) + print(headers[i]) + print(": ") + print(normal[i-5]) + print("\n") +end +println("If no animal matching this description exists, the results may appear") +println("outlandish, but are still as correct as the accuracy suggests") + +print("Done!\n") From fc771d338a94dde9db2d8c5ec46372cf342b5a5f Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Mon, 3 Feb 2020 18:11:55 -0800 Subject: [PATCH 7/7] Complete port of beefblup to Julia --- .idea/dictionaries/cclea.xml | 9 -- .idea/workspace.xml | 167 --------------------------- Excel/van der Werf2.xlsx | Bin 0 -> 17061 bytes Julia/beefblup.jl | 217 +++++++++++++++++++++++++++++++---- Julia/install.jl | 3 +- 5 files changed, 194 insertions(+), 202 deletions(-) delete mode 100644 .idea/dictionaries/cclea.xml delete mode 100644 .idea/workspace.xml create mode 100644 Excel/van der Werf2.xlsx diff --git a/.idea/dictionaries/cclea.xml b/.idea/dictionaries/cclea.xml deleted file mode 100644 index 8c49cbc..0000000 --- a/.idea/dictionaries/cclea.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - beefblup - blup - matlab - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index bbe788f..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1567039339175 - - - 1567130353481 - - - 1567131158833 - - - 1567131230009 - - - 1567131261939 - - - 1567133774405 - - - - - - - - - - - - - - - - - file://$PROJECT_DIR$/Python/beefblup.py - 44 - - - file://$PROJECT_DIR$/Python/beefblup.py - 59 - - - file://$PROJECT_DIR$/Python/beefblup.py - 71 - - - - - \ No newline at end of file diff --git a/Excel/van der Werf2.xlsx b/Excel/van der Werf2.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..e7884259d4fbad99a212e383d2c813d83960595d GIT binary patch literal 17061 zcmeIZbyQqSvp0-GNN^7l+})kv!7aE9?t=$+g1b8e2*KTg2Mb9E?hNh;?hfxja&FGU zIp6oL`{%pv9oAxcYFGVsbyaos-rd!TGSD!X5O5F(5D*X~5OXT^-vS{aAX;D{ATS^h zptMD8ZJbPO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J|5?X44&XX<+YIqE-3(vhP7ZWqW!+zB31FG}#7!xxZEUhAgIpDWGyTVW`!2Klp zURfJyk5~88Vmu%}<*Ad8D^NZ69Eb{+A$?5AhY?Z*2O5j0Q+TB*)N>ud0Fe`Cof2fk zb2eagCe9=YjkEEYL?6mviNJp23-qleC*>$#cOTEe7v=+bZjhfXuj2rhUaG<+l?P$7 zac69x%1KwCndhr!S1Sa)NjJgQpb6u`3t0IrL8LJOTh=QQf5J(g)bx&1GqBd-_O1O<*vWJ|K$|CqRf8+{O8fzzXb2U+rVSu zZwGN73qC%4_(${vyr1{`z{+1o5g!Zx=NYL#q7V?_h!4X5A19_B<2*hm^9O10*?%eV zk5e;`Q65*I|3PU+dq8`UBX+ z{Q&qMPfCxa|MOwvk1Pa40ngvM^w*=uWAXo-8~!fN#s4?)-!p}x3@kY8As~>!f2rV+ Kb1HcM>;C{s!H#VJ literal 0 HcmV?d00001 diff --git a/Julia/beefblup.jl b/Julia/beefblup.jl index 547cfb4..16c0c6e 100644 --- a/Julia/beefblup.jl +++ b/Julia/beefblup.jl @@ -7,6 +7,9 @@ # Import the required packages using XLSX +using LinearAlgebra +using Dates +using Gtk # Display stuff println("beefblup v 0.0.0.1") @@ -16,19 +19,23 @@ print("\n") ### Prompt User # Ask for an input spreadsheet -# print("Enter the full filename of a beefblup worksheet> ") -# path = readline(stdin) -path = "C:\\Users\\cclea\\source\\repos\\beefblup\\Excel\\Master BLUP Worksheet.xlsx" +path = open_dialog_native( + "Select a beefblup worksheet", + GtkNullContainer(), + ("*.xlsx", GtkFileFilter("*.xlsx", name="beefblup worksheet")) +) # Ask for an output text filename -# print("Enter the full filename of your desired results> ") -# savepath = readline(stdin) -savepath = "C:\\Users\\cclea\\source\\repos\\beefblup\\results.txt" +savepath = save_dialog_native( + "Save your beefblup results", + GtkNullContainer(), + (GtkFileFilter("*.txt", name="Results file"), + "*.txt") +) # Ask for heritability -# print("What is the heritability for this trait?> ") -# h2 = parse(Float64, readline(stdin)) -h2 = 0.4 +print("What is the heritability for this trait?> ") +h2 = parse(Float64, readline(stdin)) ### Import input filename print("[🐮]: Importing Excel file...") @@ -39,7 +46,7 @@ data = XLSX.readxlsx(path)[1][:] print("Done!\n") ### Process input file -print("[🐮]: Processing and formatting data ...") +print("[🐮]: Processing and formatting data...") # Extract the headers into a separate array headers = data[1,:] @@ -49,9 +56,9 @@ data = data[2:end,:] data = sortslices(data, dims=1, lt=(x,y)->isless(x[2],y[2])) # Define fields to hold id values for animals and their parents -ids = data[:,1] -damids = data[:,3] -sireids = data[:,4] +ids = string.(data[:,1]) +damids = string.(data[:,3]) +sireids = string.(data[:,4]) numanimals = length(ids) # Find the index values for animals and their parents @@ -98,23 +105,183 @@ normal = Array{String}(undef,1,length(headers)-5) for i in 6:length(headers) for j in numanimals:-1:1 if !ismissing(data[j,i]) - normal[i-5] = data[j,i] + normal[i-5] = string(data[j,i]) break end end end -# Print the results of the "normal" definition -println(" ") -println("For the purposes of this analysis, a 'normal' animal will be defined by") -println("the following traits:") -for i in 6:length(headers) - print(headers[i]) - print(": ") - print(normal[i-5]) - print("\n") +print("Done!\n") + +### Create the fixed-effect matrix +print("[🐮]: Creating the fixed-effect matrix...") + +# Form the fixed-effect matrix +X = zeros(Int8, numanimals, floor(Int,sum(numgroups))-length(numgroups)+1) +X[:,1] = ones(Int8, 1, numanimals) + +# Create an external counter that will increment through both loops +counter = 2 + +# Store the traits in a string array +adjustedtraits = +Array{String}(undef,floor(Int,sum(numgroups))-length(numgroups)) +# Iterate through each group +for i in 1:length(normal) + # Find the traits that are present in this trait + localdata = string.(data[:,i+5]) + traits = unique(localdata) + # Remove the normal version from the analysis + effecttraits = traits[findall(x -> x != normal[i], traits)] + # Iterate inside of the group + for j in 1:length(effecttraits) + matchedindex = findall(x -> x != effecttraits[j], localdata) + X[matchedindex, counter] .= 1 + # Add this trait to the string + adjustedtraits[counter - 1] = traits[j] + # Increment the big counter + global counter = counter + 1 + end end -println("If no animal matching this description exists, the results may appear") -println("outlandish, but are still as correct as the accuracy suggests") + +print("Done!\n") + +### Additive relationship matrix +print("[🐮]: Creating additive relationship matrix...") + +# Create an empty matrix for the additive relationship matrix +A = zeros(numanimals, numanimals) + +# Create the additive relationship matrix by the FORTRAN method presented by +# Henderson +for i in 1:numanimals + if !isnothing(dam[i]) && !isnothing(sire[i]) + for j in 1:(i-1) + A[j,i] = 0.5*(A[j,sire[i]] + A[j,dam[i]]) + A[i,j] = A[j,i] + end + A[i,i] = 1 + 0.5*A[sire[i], dam[i]] + elseif !isnothing(dam[i]) && isnothing(sire[i]) + for j in 1:(i-1) + A[j,i] = 0.5*A[j,dam[i]] + A[i,j] = A[j,i] + end + A[i,i] = 1 + elseif isnothing(dam[i]) && !isnothing(sire[i]) + for j in 1:(i-1) + A[j,i] = 0.5*A[j,sire[i]] + A[i,j] = A[j,i] + end + A[i,i] = 1 + else + for j in 1:(i-1) + A[j,i] = 0 + A[i,j] = 0 + end + A[i,i] = 1 + end +end + +print("Done!\n") + +### Perform BLUP +print("[🐮]: Solving the mixed-model equations...") + +# Extract the observed data +Y = convert(Array{Float64}, data[:,5]) + +# The random effects matrix +Z = Matrix{Int}(I, numanimals, numanimals) + +# Remove items where there is no data +nullobs = findall(isnothing, Y) +Z[nullobs, nullobs] .= 0 + +# Calculate heritability +λ = (1-h2)/h2 + +# Use the mixed-model equations +MME = [X'*X X'*Z; Z'*X (Z'*Z)+(inv(A).*λ)] +MMY = [X'*Y; Z'*Y] +solutions = MME\MMY + +# Find the accuracies +diaginv = diag(inv(MME)) +reliability = ones(Float64, length(diaginv)) - diaginv.*λ + +print("Done!\n") + +### Output the results +print("[🐮]: Saving results...") + +# Find how many traits we found BLUE for +numgroups = numgroups .- 1 + +# Start printing results to output +fileID = open(savepath, "w") +write(fileID, "beefblup Results Report\n") +write(fileID, "Produced using beefblup for Julia (") +write(fileID, "https://github.com/millironx/beefblup") +write(fileID, ")\n\n") +write(fileID, "Input:\t") +write(fileID, path) +write(fileID, "\nAnalysis performed:\t") +write(fileID, string(Dates.today())) +write(fileID, "\nTrait examined:\t") +write(fileID, headers[5]) +write(fileID, "\n\n") + +# Print base population stats +write(fileID, "Base Population:\n") +for i in 1:length(numgroups) + write(fileID, "\t") + write(fileID, headers[i+5]) + write(fileID, ":\t") + write(fileID, normal[i]) + write(fileID, "\n") +end +write(fileID, "\tMean ") +write(fileID, headers[5]) +write(fileID, ":\t") +write(fileID, string(solutions[1])) +write(fileID, "\n\n") + +# Contemporary group adjustments +counter = 2 +write(fileID, "Contemporary Group Effects:\n") +for i in 1:length(numgroups) + write(fileID, "\t") + write(fileID, headers[i+5]) + write(fileID, "\tEffect\tReliability\n") + for j in 1:numgroups[i] + write(fileID, "\t") + write(fileID, adjustedtraits[counter - 1]) + write(fileID, "\t") + write(fileID, string(solutions[counter])) + write(fileID, "\t") + write(fileID, string(reliability[counter])) + write(fileID, "\n") + + global counter = counter + 1 + end + write(fileID, "\n") +end +write(fileID, "\n") + +# Expected breeding values +write(fileID, "Expected Breeding Values:\n") +write(fileID, "\tID\tEBV\tReliability\n") +for i in 1:numanimals + write(fileID, "\t") + write(fileID, ids[i]) + write(fileID, "\t") + write(fileID, string(solutions[i+counter-1])) + write(fileID, "\t") + write(fileID, string(reliability[i+counter-1])) + write(fileID, "\n") +end + +write(fileID, "\n - END REPORT -") +close(fileID) print("Done!\n") diff --git a/Julia/install.jl b/Julia/install.jl index 3276384..1a3698d 100644 --- a/Julia/install.jl +++ b/Julia/install.jl @@ -9,4 +9,5 @@ using Pkg # Install requisite packages -Pkg.add("XLSX") \ No newline at end of file +Pkg.add("XLSX") +Pkg.add("Gtk") \ No newline at end of file