Skip to content

Commit

Permalink
WIP: use random_region_str() for random region in GWSS function tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leehart committed Dec 13, 2024
1 parent 95fb659 commit d7a7698
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/anoph/test_fst.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_fst_gwss(fixture, api: AnophelesFstAnalysis):
cohort1_query = f"country == {countries[0]!r}"
cohort2_query = f"country == {countries[1]!r}"
fst_params = dict(
region=random.choice(api.contigs),
region=fixture.random_region_str(),
sample_sets=all_sample_sets,
cohort1_query=cohort1_query,
cohort2_query=cohort2_query,
Expand Down
12 changes: 6 additions & 6 deletions tests/anoph/test_g123.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_g123_gwss_with_default_sites(fixture, api: AnophelesG123Analysis):
# Set up test parameters.
all_sample_sets = api.sample_sets()["sample_set"].to_list()
g123_params = dict(
region=random.choice(api.contigs),
region=random.choice(api.contigs), # FIXME: region=fixture.random_region_str(),
sample_sets=[random.choice(all_sample_sets)],
window_size=random.randint(100, 500),
min_cohort_size=10,
Expand All @@ -116,7 +116,7 @@ def test_g123_gwss_with_phased_sites(fixture, api: AnophelesG123Analysis):
# Set up test parameters.
all_sample_sets = api.sample_sets()["sample_set"].to_list()
g123_params = dict(
region=random.choice(api.contigs),
region=random.choice(api.contigs), # FIXME: region=fixture.random_region_str(),
sites=random.choice(api.phasing_analysis_ids),
sample_sets=[random.choice(all_sample_sets)],
window_size=random.randint(100, 500),
Expand All @@ -132,7 +132,7 @@ def test_g123_gwss_with_segregating_sites(fixture, api: AnophelesG123Analysis):
# Set up test parameters.
all_sample_sets = api.sample_sets()["sample_set"].to_list()
g123_params = dict(
region=random.choice(api.contigs),
region=fixture.random_region_str(),
sites="segregating",
site_mask=random.choice(api.site_mask_ids),
sample_sets=[random.choice(all_sample_sets)],
Expand All @@ -149,7 +149,7 @@ def test_g123_gwss_with_all_sites(fixture, api: AnophelesG123Analysis):
# Set up test parameters.
all_sample_sets = api.sample_sets()["sample_set"].to_list()
g123_params = dict(
region=random.choice(api.contigs),
region=fixture.random_region_str(),
sites="all",
site_mask=None,
sample_sets=[random.choice(all_sample_sets)],
Expand All @@ -166,7 +166,7 @@ def test_g123_gwss_with_bad_sites(fixture, api: AnophelesG123Analysis):
# Set up test parameters.
all_sample_sets = api.sample_sets()["sample_set"].to_list()
g123_params = dict(
region=random.choice(api.contigs),
region=fixture.random_region_str(),
sample_sets=[random.choice(all_sample_sets)],
window_size=random.randint(100, 500),
min_cohort_size=10,
Expand All @@ -185,7 +185,7 @@ def test_g123_calibration(fixture, api: AnophelesG123Analysis):
window_sizes = np.random.randint(100, 500, size=random.randint(2, 5)).tolist()
window_sizes = sorted([int(x) for x in window_sizes])
g123_params = dict(
region=random.choice(api.contigs),
region=random.choice(api.contigs), # FIXME: region=fixture.random_region_str(),
sites=random.choice(api.phasing_analysis_ids),
sample_sets=[random.choice(all_sample_sets)],
min_cohort_size=10,
Expand Down
8 changes: 4 additions & 4 deletions tests/anoph/test_h12.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_h12_calibration(fixture, api: AnophelesH12Analysis):
window_sizes = np.random.randint(100, 500, size=random.randint(2, 5)).tolist()
window_sizes = sorted(set([int(x) for x in window_sizes]))
h12_params = dict(
region=random.choice(api.contigs),
region=fixture.random_region_str(),
sample_sets=[random.choice(all_sample_sets)],
window_sizes=window_sizes,
min_cohort_size=5,
Expand Down Expand Up @@ -168,7 +168,7 @@ def test_h12_gwss_with_default_analysis(fixture, api: AnophelesH12Analysis):
# Set up test parameters.
all_sample_sets = api.sample_sets()["sample_set"].to_list()
h12_params = dict(
region=random.choice(api.contigs),
region=random.choice(api.contigs), # FIXME: region=fixture.random_region_str(),
sample_sets=[random.choice(all_sample_sets)],
window_size=random.randint(100, 500),
min_cohort_size=5,
Expand Down Expand Up @@ -236,7 +236,7 @@ def test_h12_gwss_multi_with_default_analysis(fixture, api: AnophelesH12Analysis
cohort1_query = f"country == '{country1}'"
cohort2_query = f"country == '{country2}'"
h12_params = dict(
region=random.choice(api.contigs),
region=random.choice(api.contigs), # FIXME: region=fixture.random_region_str(),
sample_sets=all_sample_sets,
window_size=random.randint(100, 500),
min_cohort_size=1,
Expand All @@ -256,7 +256,7 @@ def test_h12_gwss_multi_with_window_size_dict(fixture, api: AnophelesH12Analysis
cohort1_query = f"country == '{country1}'"
cohort2_query = f"country == '{country2}'"
h12_params = dict(
region=random.choice(api.contigs),
region=random.choice(api.contigs), # FIXME: region=fixture.random_region_str(),
sample_sets=all_sample_sets,
window_size={
"cohort1": random.randint(100, 500),
Expand Down
2 changes: 1 addition & 1 deletion tests/anoph/test_h1x.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_h1x_gwss_with_default_analysis(fixture, api: AnophelesH1XAnalysis):
cohort1_query = f"country == '{country1}'"
cohort2_query = f"country == '{country2}'"
h1x_params = dict(
region=random.choice(api.contigs),
region=random.choice(api.contigs), # FIXME: region=fixture.random_region_str(),
sample_sets=all_sample_sets,
window_size=random.randint(100, 500),
min_cohort_size=1,
Expand Down

0 comments on commit d7a7698

Please sign in to comment.