66
77from malariagen_data import af1 as _af1
88from malariagen_data import ag3 as _ag3
9+ from malariagen_data import adir1 as _adir1
10+ from malariagen_data import amin1 as _amin1
911from malariagen_data .anoph .g123 import AnophelesG123Analysis
1012
1113
@@ -56,6 +58,44 @@ def af1_sim_api(af1_sim_fixture):
5658 )
5759
5860
61+ @pytest .fixture
62+ def adir1_sim_api (adir1_sim_fixture ):
63+ return AnophelesG123Analysis (
64+ url = adir1_sim_fixture .url ,
65+ public_url = adir1_sim_fixture .url ,
66+ config_path = _adir1 .CONFIG_PATH ,
67+ major_version_number = _adir1 .MAJOR_VERSION_NUMBER ,
68+ major_version_path = _adir1 .MAJOR_VERSION_PATH ,
69+ pre = False ,
70+ gff_gene_type = "protein_coding_gene" ,
71+ gff_gene_name_attribute = "Note" ,
72+ gff_default_attributes = ("ID" , "Parent" , "Note" , "description" ),
73+ default_site_mask = "dirus" ,
74+ results_cache = adir1_sim_fixture .results_cache_path .as_posix (),
75+ taxon_colors = _adir1 .TAXON_COLORS ,
76+ default_phasing_analysis = None ,
77+ )
78+
79+
80+ @pytest .fixture
81+ def amin1_sim_api (amin1_sim_fixture ):
82+ return AnophelesG123Analysis (
83+ url = amin1_sim_fixture .url ,
84+ public_url = amin1_sim_fixture .url ,
85+ config_path = _amin1 .CONFIG_PATH ,
86+ major_version_number = _amin1 .MAJOR_VERSION_NUMBER ,
87+ major_version_path = _amin1 .MAJOR_VERSION_PATH ,
88+ pre = False ,
89+ gff_gene_type = "protein_coding_gene" ,
90+ gff_gene_name_attribute = "Note" ,
91+ gff_default_attributes = ("ID" , "Parent" , "Note" , "description" ),
92+ default_site_mask = "minimus" ,
93+ results_cache = amin1_sim_fixture .results_cache_path .as_posix (),
94+ taxon_colors = _amin1 .TAXON_COLORS ,
95+ default_phasing_analysis = None ,
96+ )
97+
98+
5999# N.B., here we use pytest_cases to parametrize tests. Each
60100# function whose name begins with "case_" defines a set of
61101# inputs to the test functions. See the documentation for
@@ -76,6 +116,14 @@ def case_af1_sim(af1_sim_fixture, af1_sim_api):
76116 return af1_sim_fixture , af1_sim_api
77117
78118
119+ def case_adir1_sim (adir1_sim_fixture , adir1_sim_api ):
120+ return adir1_sim_fixture , adir1_sim_api
121+
122+
123+ def case_amin1_sim (amin1_sim_fixture , amin1_sim_api ):
124+ return amin1_sim_fixture , amin1_sim_api
125+
126+
79127def check_g123_gwss (* , api , g123_params ):
80128 # Run main gwss function under test.
81129 x , g123 = api .g123_gwss (** g123_params )
@@ -115,6 +163,10 @@ def test_g123_gwss_with_default_sites(fixture, api: AnophelesG123Analysis):
115163
116164@parametrize_with_cases ("fixture,api" , cases = "." )
117165def test_g123_gwss_with_phased_sites (fixture , api : AnophelesG123Analysis ):
166+ # Skip if this dataset has no phasing analyses (e.g., Adir1, Amin1).
167+ if not api .phasing_analysis_ids :
168+ pytest .skip ("No phasing analyses available for this dataset." )
169+
118170 # Set up test parameters.
119171 all_sample_sets = api .sample_sets ()["sample_set" ].to_list ()
120172 g123_params = dict (
@@ -182,6 +234,10 @@ def test_g123_gwss_with_bad_sites(fixture, api: AnophelesG123Analysis):
182234
183235@parametrize_with_cases ("fixture,api" , cases = "." )
184236def test_g123_calibration (fixture , api : AnophelesG123Analysis ):
237+ # Skip if this dataset has no phasing analyses (e.g., Adir1, Amin1).
238+ if not api .phasing_analysis_ids :
239+ pytest .skip ("No phasing analyses available for this dataset." )
240+
185241 # Set up test parameters.
186242 all_sample_sets = api .sample_sets ()["sample_set" ].to_list ()
187243 window_sizes = np .random .randint (100 , 500 , size = random .randint (2 , 5 )).tolist ()
0 commit comments