Skip to content

Commit 782ce16

Browse files
authored
Merge pull request #52 from Durbadal0/main
Updated test functions
2 parents 5a922e3 + 98e5f02 commit 782ce16

File tree

1 file changed

+30
-15
lines changed

1 file changed

+30
-15
lines changed

test/datastruc_test.jl

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,53 +21,68 @@ geno = Geno(
2121
=#
2222
#pheno = Pheno(["individual1", "individual2"], ["trait1", "trait2"], [1.0 2.0; nothing 3.0])
2323

24+
########
25+
data_dir = joinpath(@__DIR__, "data/BXD/");
26+
file = joinpath(data_dir, "bxd.json");
27+
28+
29+
# Transforming data to a optimised and accessible data type
30+
data = get_geneticstudydata(file);
31+
32+
33+
2434

2535
# Testing the Gmap type
36+
gmap=data.gmap
2637
@testset "Gmap Tests" begin
2738

28-
@test gmap.chr == ["chr1", "chr2"]
29-
@test length(gmap.marker_name) == 2
39+
# @test gmap.chr == ["chr1", "chr2"]
40+
# @test length(gmap.marker_name) == 2
3041
@test all(isa.(gmap.pos, Vector{Float64}))
3142
end
3243

3344
# Testing the CrossType type
45+
crosstype=data.geno.cross_type
3446
@testset "CrossType Tests" begin
3547
@test isa(cross_type.type, String)
3648
end
3749

3850
# Testing the CrossInfo type
51+
cross_info=data.cross_info
3952
@testset "CrossInfo Tests" begin
4053
@test length(cross_info.sample_id) == length(cross_info.direction)
4154
@test all(isa.(cross_info.direction, Int))
4255
end
4356

4457
# Testing the Alleles type
58+
alleles=data.geno.alleles
4559
@testset "Alleles Tests" begin
46-
@test length(alleles.val) == 3
60+
# @test length(alleles.val) == 3
4761
@test all(isa.(alleles.val, String))
4862
end
4963

5064
# Testing the GenoType type
51-
@testset "GenoType Tests" begin
52-
@test geno_type.label["A"] == 1
53-
@test geno_type.label["H"] == 2
54-
end
65+
#@testset "GenoType Tests" begin
66+
# @test geno_type.label["A"] == 1
67+
# @test geno_type.label["H"] == 2
68+
#end
5569

5670
# Testing the GenoTranspose type
57-
@testset "GenoTranspose Tests" begin
58-
@test geno_transpose.val == true
59-
end
71+
#@testset "GenoTranspose Tests" begin
72+
# @test geno_transpose.val == true
73+
#end
6074

6175
# Testing the Geno type
62-
@testset "Geno Tests" begin
63-
@test length(geno.sample_id) == 1
64-
@test size(geno.val[1]) == (2, 2)
65-
end
76+
#@testset "Geno Tests" begin
77+
# @test length(geno.sample_id) == 1
78+
# @test size(geno.val[1]) == (2, 2)
79+
#end
6680

6781
# Testing the Pheno type
82+
pheno=data.pheno
6883
@testset "Pheno Tests" begin
6984
@test size(pheno.val, 1) == length(pheno.sample_id)
70-
@test pheno.val[2, 1] === nothing
85+
# @test pheno.val[2, 1] === nothing
7186
end
7287

7388

0 commit comments

Comments
 (0)