diff --git a/data/sample.csv b/data/sample.csv index c3be9f3..8483994 100644 --- a/data/sample.csv +++ b/data/sample.csv @@ -1,8 +1,8 @@ -id,birthdate,dam,sire,year,sex,weaning_weight -1,1/1/1990,,,1990,male,354 -2,1/1/1990,,,1990,female,251 -3,1/1/1991,,1,1991,male,327 -4,1/1/1991,,1,1991,female,328 -5,1/1/1991,2,1,1991,male,301 -6,1/1/1991,2,,1991,female,270 -7,1/1/1992,,,1992,male,330 +id,birthdate,dam,sire,year,sex,species,weaning_weight +1,1/1/1990,,,1990,male,cow,354 +2,1/1/1990,,,1990,female,cow,251 +3,1/1/1991,,1,1991,male,cow,327 +4,1/1/1991,,1,1991,female,cow,328 +5,1/1/1991,2,1,1991,male,cow,301 +6,1/1/1991,2,,1991,female,cow,270 +7,1/1/1992,,,1992,male,cow,330 diff --git a/gtktest.jl b/gtktest.jl new file mode 100644 index 0000000..73396fb --- /dev/null +++ b/gtktest.jl @@ -0,0 +1,13 @@ +using Gtk +openpath = open_dialog_native( + "Select a datasheet") +# GtkNullContainer(), +# ("*.csv", GtkFileFilter("*.csv", name="Comma-separated values")) +# ) + +# savepath = save_dialog_native( +# "Save your results", +# GtkNullContainer(), +# (GtkFileFilter("*.txt", name="Results file"), +# "*.txt") +# ) diff --git a/src/BeefBLUP.jl b/src/BeefBLUP.jl index b06a5ae..4216ba8 100755 --- a/src/BeefBLUP.jl +++ b/src/BeefBLUP.jl @@ -18,7 +18,6 @@ using Gtk # Main entry-level function - acts just like the script function beefblup() -### Prompt User # Ask for an input spreadsheet path = open_dialog_native( "Select a beefblup worksheet", @@ -75,10 +74,7 @@ fixedfx = select(data, Not([:id, :birthdate, :sire, :dam]))[:,1:end-1] # Find any columns that need to be deleted for i in 1:ncol(fixedfx) if length(unique(fixedfx[:,i])) <= 1 - colname = names(fixedfx)[i] - print("Column '") - print(colname) - print("' does not have any unique animals and will be removed from this analysis\n") + @warn string("column '", names(fixedfx[i]), "' does not have any unique animals and will be removed from this analysis") deletecols!(fixedfx,i) end end @@ -92,9 +88,7 @@ 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() + throw(ErrorException("there are more contemporary groups than animals")) end # Define a "normal" animal as one of the last in the groups, provided that