2021-06-19 23:49:00 +00:00
|
|
|
using BeefBLUP
|
2021-06-20 01:11:25 +00:00
|
|
|
using DataFrames
|
2021-06-19 23:49:00 +00:00
|
|
|
using Test
|
2021-06-20 00:16:34 +00:00
|
|
|
|
|
|
|
@testset "BeefBLUP.jl" begin
|
|
|
|
# Write your tests here.
|
2021-09-01 00:24:07 +00:00
|
|
|
correctX = [1 1 0 1; 1 1 0 0; 1 0 1 1; 1 0 1 0; 1 0 1 1; 1 0 1 0; 1 0 0 1]
|
2021-06-20 01:11:25 +00:00
|
|
|
fixedfx = DataFrame(year = [1990, 1990, 1991, 1991, 1991, 1991, 1992], sex = ["male", "female", "male", "female", "male", "female", "male"])
|
|
|
|
@test BeefBLUP.fixedeffectmatrix(fixedfx)[1] == correctX
|
2021-08-28 23:07:22 +00:00
|
|
|
correctA = [1 0 1/2 1/2 1/2 0 0;
|
|
|
|
0 1 0 0 1/2 1/2 0;
|
|
|
|
1/2 0 1 1/4 1/4 0 0;
|
|
|
|
1/2 0 1/4 1 1/4 0 0;
|
|
|
|
1/2 1/2 1/4 1/4 1 1/4 0;
|
|
|
|
0 1/2 0 0 1/4 1 0;
|
|
|
|
0 0 0 0 0 0 1]
|
|
|
|
id = collect(1:7)
|
|
|
|
dam_id = [missing, missing, missing, missing, 2, 2, missing]
|
|
|
|
sire_id = [missing, missing, 1, 1, 1, missing, missing]
|
2021-08-29 00:28:25 +00:00
|
|
|
@test BeefBLUP.additiverelationshipmatrix(id, dam_id, sire_id) == correctA
|
2021-06-20 00:16:34 +00:00
|
|
|
end
|