Skip to content

Commit c0512bf

Browse files
committed
Merge remote-tracking branch 'origin/master'
Resolve conflicts in g123.py and test_g123.py: - Keep DEFAULT_SITE_PARAMETER approach in all 4 function signatures - Drop remote's base_params.DEFAULT fallback blocks (now dead code) - Fix pre=False for adir1/amin1 fixtures (not pre-release datasets)
2 parents 6bc2ec3 + 4b444a4 commit c0512bf

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ package index (PyPI) and can be installed via `pip`, e.g.:
1010
```bash
1111
pip install malariagen-data
1212
```
13+
## Quick Start
14+
15+
Once installed, you can begin accessing MalariaGEN datasets directly
16+
from Python.
17+
18+
For example, to work with the Pf8 dataset:
19+
20+
```python
21+
import malariagen_data
22+
23+
# Instantiate dataset
24+
pf8 = malariagen_data.Pf8()
25+
26+
# Load sample metadata
27+
df = pf8.sample_metadata()
28+
print(df.head())
1329

1430
## Documentation
1531

malariagen_data/anoph/g123.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ def g123_calibration(
276276
# invalidate any previously cached data.
277277
name = "g123_calibration_v1"
278278

279+
valid_sites = self.phasing_analysis_ids + ("all", "segregating")
280+
if sites not in valid_sites:
281+
raise ValueError(
282+
f"Invalid value for `sites` parameter, must be one of {valid_sites}."
283+
)
284+
279285
params = dict(
280286
contig=contig,
281287
sites=sites,

tests/anoph/test_g123.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ def test_g123_gwss_with_default_sites(fixture, api: AnophelesG123Analysis):
163163

164164
@parametrize_with_cases("fixture,api", cases=".")
165165
def test_g123_gwss_with_phased_sites(fixture, api: AnophelesG123Analysis):
166+
# Skip if this dataset has no phasing analyses (e.g., Adir1, Amin1).
166167
if not api.phasing_analysis_ids:
167-
pytest.skip("No phasing analysis available")
168+
pytest.skip("No phasing analyses available for this dataset.")
168169

169170
# Set up test parameters.
170171
all_sample_sets = api.sample_sets()["sample_set"].to_list()
@@ -233,8 +234,9 @@ def test_g123_gwss_with_bad_sites(fixture, api: AnophelesG123Analysis):
233234

234235
@parametrize_with_cases("fixture,api", cases=".")
235236
def test_g123_calibration(fixture, api: AnophelesG123Analysis):
237+
# Skip if this dataset has no phasing analyses (e.g., Adir1, Amin1).
236238
if not api.phasing_analysis_ids:
237-
pytest.skip("No phasing analysis available")
239+
pytest.skip("No phasing analyses available for this dataset.")
238240

239241
# Set up test parameters.
240242
all_sample_sets = api.sample_sets()["sample_set"].to_list()

0 commit comments

Comments
 (0)