1
0
Fork 0
mirror of https://github.com/MillironX/beefblup.git synced 2024-11-10 18:23:08 +00:00

Fix report generation

This commit is contained in:
Thomas A. Christensen II 2021-06-18 12:46:01 -05:00
parent 2882f5b932
commit 74683f03d5
Signed by: millironx
GPG key ID: 139C07724802BC5D

View file

@ -211,6 +211,10 @@ 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
# Extract the names of the traits
fixedfxnames = names(fixedfx)
traitname = names(data)[end]
# Start printing results to output # Start printing results to output
fileID = open(savepath, "w") fileID = open(savepath, "w")
write(fileID, "beefblup Results Report\n") write(fileID, "beefblup Results Report\n")
@ -222,20 +226,20 @@ write(fileID, path)
write(fileID, "\nAnalysis performed:\t") write(fileID, "\nAnalysis performed:\t")
write(fileID, string(Dates.today())) write(fileID, string(Dates.today()))
write(fileID, "\nTrait examined:\t") write(fileID, "\nTrait examined:\t")
write(fileID, headers[5]) write(fileID, traitname)
write(fileID, "\n\n") write(fileID, "\n\n")
# Print base population stats # Print base population stats
write(fileID, "Base Population:\n") write(fileID, "Base Population:\n")
for i in 1:length(numgroups) for i in 1:length(normal)
write(fileID, "\t") write(fileID, "\t")
write(fileID, headers[i+5]) write(fileID, fixedfxnames[i])
write(fileID, ":\t") write(fileID, ":\t")
write(fileID, normal[i]) write(fileID, normal[i])
write(fileID, "\n") write(fileID, "\n")
end end
write(fileID, "\tMean ") write(fileID, "\tMean ")
write(fileID, headers[5]) write(fileID, traitname)
write(fileID, ":\t") write(fileID, ":\t")
write(fileID, string(solutions[1])) write(fileID, string(solutions[1]))
write(fileID, "\n\n") write(fileID, "\n\n")
@ -245,7 +249,7 @@ counter = 2
write(fileID, "Contemporary Group Effects:\n") write(fileID, "Contemporary Group Effects:\n")
for i in 1:length(numgroups) for i in 1:length(numgroups)
write(fileID, "\t") write(fileID, "\t")
write(fileID, headers[i+5]) write(fileID, fixedfxnames[i])
write(fileID, "\tEffect\tReliability\n") write(fileID, "\tEffect\tReliability\n")
for j in 1:numgroups[i] for j in 1:numgroups[i]
write(fileID, "\t") write(fileID, "\t")
@ -267,7 +271,7 @@ write(fileID, "Expected Breeding Values:\n")
write(fileID, "\tID\tEBV\tReliability\n") write(fileID, "\tID\tEBV\tReliability\n")
for i in 1:numanimals for i in 1:numanimals
write(fileID, "\t") write(fileID, "\t")
write(fileID, data.id[i]) write(fileID, string(data.id[i]))
write(fileID, "\t") write(fileID, "\t")
write(fileID, string(solutions[i+counter-1])) write(fileID, string(solutions[i+counter-1]))
write(fileID, "\t") write(fileID, "\t")