7
7
from pytest_cases import parametrize_with_cases
8
8
9
9
from malariagen_data import ag3 as _ag3
10
+ from malariagen_data import af1 as _af1
10
11
from malariagen_data .anoph .hap_frq import AnophelesHapFrequencyAnalysis
11
12
from .test_frq import (
12
13
test_plot_frequencies_heatmap ,
13
14
test_plot_frequencies_time_series ,
14
15
test_plot_frequencies_time_series_with_taxa ,
15
16
test_plot_frequencies_time_series_with_areas ,
17
+ test_plot_frequencies_interactive_map ,
16
18
)
17
19
18
20
@@ -42,6 +44,23 @@ def ag3_sim_api(ag3_sim_fixture):
42
44
)
43
45
44
46
47
+ @pytest .fixture
48
+ def af1_sim_api (af1_sim_fixture ):
49
+ return AnophelesHapFrequencyAnalysis (
50
+ url = af1_sim_fixture .url ,
51
+ config_path = _af1 .CONFIG_PATH ,
52
+ major_version_number = _af1 .MAJOR_VERSION_NUMBER ,
53
+ major_version_path = _af1 .MAJOR_VERSION_PATH ,
54
+ pre = False ,
55
+ gff_gene_type = "protein_coding_gene" ,
56
+ gff_gene_name_attribute = "Note" ,
57
+ gff_default_attributes = ("ID" , "Parent" , "Note" , "description" ),
58
+ results_cache = af1_sim_fixture .results_cache_path .as_posix (),
59
+ taxon_colors = _af1 .TAXON_COLORS ,
60
+ default_phasing_analysis = "funestus" ,
61
+ )
62
+
63
+
45
64
# N.B., here we use pytest_cases to parametrize tests. Each
46
65
# function whose name begins with "case_" defines a set of
47
66
# inputs to the test functions. See the documentation for
@@ -58,6 +77,10 @@ def case_ag3_sim(ag3_sim_fixture, ag3_sim_api):
58
77
return ag3_sim_fixture , ag3_sim_api
59
78
60
79
80
+ def case_af1_sim (af1_sim_fixture , af1_sim_api ):
81
+ return af1_sim_fixture , af1_sim_api
82
+
83
+
61
84
def check_frequency (x ):
62
85
loc_nan = np .isnan (x )
63
86
assert np .all (x [~ loc_nan ] >= 0 )
@@ -90,7 +113,7 @@ def check_hap_frequencies_advanced(
90
113
test_plot_frequencies_time_series (api , ds )
91
114
test_plot_frequencies_time_series_with_taxa (api , ds )
92
115
test_plot_frequencies_time_series_with_areas (api , ds )
93
- # test_plot_frequencies_interactive_map(api, ds)
116
+ test_plot_frequencies_interactive_map (api , ds )
94
117
assert set (ds .dims ) == {"cohorts" , "variants" }
95
118
96
119
expected_cohort_vars = [
0 commit comments