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

Change main script to module and function call

This commit is contained in:
Thomas A. Christensen II 2021-06-18 13:51:26 -05:00
parent 1928eb3c4f
commit b61eae3324
Signed by: millironx
GPG key ID: 139C07724802BC5D

View file

@ -1,16 +1,13 @@
#!/bin/bash
#=
exec julia --project=$(realpath $(dirname $(dirname "${BASH_SOURCE[0]}"))) "${BASH_SOURCE[0]}" "$@"
=#
# beefblup # beefblup
# Main script for performing single-variate BLUP to find beef cattle # Julia package for performing single-variate BLUP to find beef cattle
# breeding values # breeding values
# Usage: julia beefblup.jl
# (C) 2021 Thomas A. Christensen II # (C) 2021 Thomas A. Christensen II
# Licensed under BSD-3-Clause License # Licensed under BSD-3-Clause License
# cSpell:includeRegExp #.* # cSpell:includeRegExp #.*
# cSpell:includeRegExp ("""|''')[^\1]*\1 # cSpell:includeRegExp ("""|''')[^\1]*\1
module BeefBLUP
# Import the required packages # Import the required packages
using CSV using CSV
using DataFrames using DataFrames
@ -18,6 +15,9 @@ using LinearAlgebra
using Dates using Dates
using Gtk using Gtk
# Main entry-level function - acts just like the script
function beefblup()
# Display stuff # Display stuff
println("beefblup v 0.2") println("beefblup v 0.2")
println("(C) 2021 Thomas A. Christensen II") println("(C) 2021 Thomas A. Christensen II")
@ -134,7 +134,7 @@ for i in 1:length(normal)
# Add this trait to the string # Add this trait to the string
adjustedtraits[counter - 1] = traits[j] adjustedtraits[counter - 1] = traits[j]
# Increment the big counter # Increment the big counter
global counter = counter + 1 counter = counter + 1
end end
end end
@ -260,7 +260,7 @@ for i in 1:length(numgroups)
write(fileID, string(reliability[counter])) write(fileID, string(reliability[counter]))
write(fileID, "\n") write(fileID, "\n")
global counter = counter + 1 counter = counter + 1
end end
write(fileID, "\n") write(fileID, "\n")
end end
@ -283,3 +283,7 @@ write(fileID, "\n - END REPORT -")
close(fileID) close(fileID)
print("Done!\n") print("Done!\n")
end
end