1
0
Fork 0
mirror of https://github.com/MillironX/beefblup.git synced 2024-12-22 09:08:16 +00:00

Remove verbose text output

This commit is contained in:
Thomas A. Christensen II 2021-06-18 15:27:18 -05:00
parent 7cf650992d
commit f985f4a700
Signed by: millironx
GPG key ID: 139C07724802BC5D

View file

@ -18,12 +18,6 @@ using Gtk
# Main entry-level function - acts just like the script # Main entry-level function - acts just like the script
function beefblup() function beefblup()
# Display stuff
println("beefblup v 0.2")
println("(C) 2021 Thomas A. Christensen II")
println("https://github.com/millironx/beefblup")
print("\n")
### Prompt User ### Prompt User
# Ask for an input spreadsheet # Ask for an input spreadsheet
path = open_dialog_native( path = open_dialog_native(
@ -62,17 +56,9 @@ end
# Main worker function, can perform all the work if given all the user input # Main worker function, can perform all the work if given all the user input
function beefblup(path::String, savepath::String, h2::Float64) function beefblup(path::String, savepath::String, h2::Float64)
### Import input filename
print("[🐮]: Importing data file...")
# Import data from a suitable spreadsheet # Import data from a suitable spreadsheet
data = DataFrame(CSV.File(path)) data = DataFrame(CSV.File(path))
print("Done!\n")
### Process input file
print("[🐮]: Processing and formatting data...")
# Sort the array by date # Sort the array by date
sort!(data, :birthdate) sort!(data, :birthdate)
@ -123,11 +109,6 @@ for i in 1:numtraits
end end
end end
print("Done!\n")
### Create the fixed-effect matrix
print("[🐮]: Creating the fixed-effect matrix...")
# Form the fixed-effect matrix # Form the fixed-effect matrix
X = zeros(Int8, numanimals, floor(Int,sum(numgroups))-length(numgroups)+1) X = zeros(Int8, numanimals, floor(Int,sum(numgroups))-length(numgroups)+1)
X[:,1] = ones(Int8, 1, numanimals) X[:,1] = ones(Int8, 1, numanimals)
@ -156,11 +137,6 @@ for i in 1:length(normal)
end end
end end
print("Done!\n")
### Additive relationship matrix
print("[🐮]: Creating additive relationship matrix...")
# Create an empty matrix for the additive relationship matrix # Create an empty matrix for the additive relationship matrix
A = zeros(numanimals, numanimals) A = zeros(numanimals, numanimals)
@ -194,11 +170,6 @@ for i in 1:numanimals
end end
end end
print("Done!\n")
### Perform BLUP
print("[🐮]: Solving the mixed-model equations...")
# Extract the observed data # Extract the observed data
Y = convert(Array{Float64}, data[:,end]) Y = convert(Array{Float64}, data[:,end])
@ -221,11 +192,6 @@ solutions = MME\MMY
diaginv = diag(inv(MME)) diaginv = diag(inv(MME))
reliability = ones(Float64, length(diaginv)) - diaginv.*λ reliability = ones(Float64, length(diaginv)) - diaginv.*λ
print("Done!\n")
### Output the results
print("[🐮]: Saving results...")
# Find how many traits we found BLUE for # Find how many traits we found BLUE for
numgroups = numgroups .- 1 numgroups = numgroups .- 1
@ -300,8 +266,6 @@ end
write(fileID, "\n - END REPORT -") write(fileID, "\n - END REPORT -")
close(fileID) close(fileID)
print("Done!\n")
end end
end end