Skip to content

Commit

Permalink
added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GregFa committed Aug 24, 2024
1 parent 1567f67 commit befb05f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/plots/plots_qtl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function plot_QTL(vLOD::Vector{<:AbstractFloat}, dfgInfo::Gmap; kwargs...)
return plot_QTL(vLOD, gmap2df(dfgInfo); kwargs...)
end


function plot_QTL(scanresult::NamedTuple, dfgInfo::Gmap; kwargs...)
return plot_QTL(scanresult, gmap2df(dfgInfo); kwargs...)
end
Expand Down
15 changes: 9 additions & 6 deletions test/plots_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
data_dir = joinpath(@__DIR__, "data/BXD/");
file = joinpath(data_dir, "bxd.json");


# Transforming data to a optimised and accessible data type
data = get_geneticstudydata(file);

Expand Down Expand Up @@ -60,17 +59,21 @@
#########

# QTL plots
p1 = plot_QTL(single_results_perms, gInfo, mbColname = "Pos");
p1a = plot_QTL(single_results_perms, gInfo, mbColname = "Pos");
p1b = plot_QTL(single_results_perms.lod, gInfo, mbColname = "Pos");

# Manhattan plots
p2 = plot_manhattan(single_results_perms, gInfo, mbColname = "Pos");
p2a = plot_manhattan(single_results_perms, gInfo, mbColname = "Pos");
p2b = plot_manhattan(single_results_perms.lod, gInfo, mbColname = "Pos");

@testset "QTL plot Tests" begin
@test isa(p1[1][4], Plots.Series)
@test isa(p1a[1][4], Plots.Series)
@test isa(p1b[1][3], Plots.Series)
end

@testset "Mahattan plot Tests" begin
@test isa(p2[1][2], Plots.Series)
@testset "Manhattan plot Tests" begin
@test isa(p2a[1][2], Plots.Series)
@test isa(p2b[1][1], Plots.Series)
end

end

0 comments on commit befb05f

Please sign in to comment.