Skip to content

Commit 677ebcf

Browse files
committed
Added tests on funestus for hap_frq
1 parent 2604b2e commit 677ebcf

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

tests/anoph/test_hap_frq.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
from pytest_cases import parametrize_with_cases
88

99
from malariagen_data import ag3 as _ag3
10+
from malariagen_data import af1 as _af1
1011
from malariagen_data.anoph.hap_frq import AnophelesHapFrequencyAnalysis
1112
from .test_frq import (
1213
test_plot_frequencies_heatmap,
1314
test_plot_frequencies_time_series,
1415
test_plot_frequencies_time_series_with_taxa,
1516
test_plot_frequencies_time_series_with_areas,
17+
test_plot_frequencies_interactive_map,
1618
)
1719

1820

@@ -42,6 +44,23 @@ def ag3_sim_api(ag3_sim_fixture):
4244
)
4345

4446

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+
4564
# N.B., here we use pytest_cases to parametrize tests. Each
4665
# function whose name begins with "case_" defines a set of
4766
# inputs to the test functions. See the documentation for
@@ -58,6 +77,10 @@ def case_ag3_sim(ag3_sim_fixture, ag3_sim_api):
5877
return ag3_sim_fixture, ag3_sim_api
5978

6079

80+
def case_af1_sim(af1_sim_fixture, af1_sim_api):
81+
return af1_sim_fixture, af1_sim_api
82+
83+
6184
def check_frequency(x):
6285
loc_nan = np.isnan(x)
6386
assert np.all(x[~loc_nan] >= 0)
@@ -90,7 +113,7 @@ def check_hap_frequencies_advanced(
90113
test_plot_frequencies_time_series(api, ds)
91114
test_plot_frequencies_time_series_with_taxa(api, ds)
92115
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)
94117
assert set(ds.dims) == {"cohorts", "variants"}
95118

96119
expected_cohort_vars = [

0 commit comments

Comments
 (0)