You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
beefblup/beefblup

48 lines
1.2 KiB
Julia

#!/bin/bash
# -*- mode: julia -*-
#=
exec julia --project="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" "${BASH_SOURCE[0]}" "$@"
=#
# beefblup cli
# Provides a convenient CLI for using beefblup
# cSpell:includeRegExp #.*
# cSpell:includeRegExp ("""|''')[^\1]*\1
# Import packages
using BeefBLUP
using ArgParse
# If this is run without arguments, catch that before parsing
if isempty(ARGS)
BeefBLUP.beefblup()
exit()
end
# Setup the argument table
argsettings = ArgParseSettings()
@add_arg_table argsettings begin
"datafile"
help = "datasheet containing the pedigree, fixed effects, and response trait formatted in CSV"
required = true
arg_type = String
"resultsfile"
help = "filename for storing the results of the analysis"
required = false
arg_type = String
"--heritability", "-t"
help = "heritability of the response trait being analyzed"
required = true
arg_type = Float64
end
arguments = parse_args(argsettings)
h2 = arguments["heritability"]
if isnothing(arguments["resultsfile"])
BeefBLUP.beefblup(arguments["datafile"], h2)
exit()
end
BeefBLUP.beefblup(arguments["datafile"], arguments["resultsfile"], h2)