From 86530ebf08926596697f44f7b5f05af9da2880c3 Mon Sep 17 00:00:00 2001 From: Becky Sweger Date: Mon, 16 Sep 2024 10:00:12 -0400 Subject: [PATCH] Include Puerto Rico when filtering Nextstrain metadata Adding Puerto Rico to the US state filter per the WIP variant nowcast hub guidelines https://github.com/reichlab/variant-nowcast-hub/pull/39/files#r1759244751 --- src/virus_clade_utils/util/sequence.py | 2 +- tests/data/test_metadata.tsv | 2 +- tests/unit/test_get_clade_list.py | 2 +- tests/unit/util/test_sequence.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/virus_clade_utils/util/sequence.py b/src/virus_clade_utils/util/sequence.py index d24158e..4ee3cc3 100644 --- a/src/virus_clade_utils/util/sequence.py +++ b/src/virus_clade_utils/util/sequence.py @@ -116,7 +116,7 @@ def filter_covid_genome_metadata(metadata: pl.LazyFrame, cols: list = []) -> pl. # There are some other odd divisions in the data, but these are 50 states and DC states = [state.name for state in us.states.STATES] - states.append("Washington DC") + states.extend(["Washington DC", "Puerto Rico"]) # Filter dataset and do some general tidying filtered_metadata = ( diff --git a/tests/data/test_metadata.tsv b/tests/data/test_metadata.tsv index af283f6..1021de5 100644 --- a/tests/data/test_metadata.tsv +++ b/tests/data/test_metadata.tsv @@ -27,4 +27,4 @@ ghi ghi.4 i ❤️ wombats 2024-09-22 Homo sapiens USA Utah BB Cardassia hummus jkl jkl.1 i ❤️ wombats 2024-09-22 Homo sapiens USA Utah CC Bajor hummus a tune mno mno.1 i ❤️ wombats 2024-09-22 Homo sapiens Canada Mississippi FF Earth hummus a tune mno mno.1 i ❤️ wombats 2024-09-22 marmots USA Massachusetts FF Cardassia hummus a tune -mno mno.1 i ❤️ wombats 2024-09-22 Homo sapiens USA Puerto Rico FF Bajor hummus a tune \ No newline at end of file +mno mno.1 i ❤️ wombats 2024-09-22 Homo sapiens USA Guam FF Bajor hummus a tune diff --git a/tests/unit/test_get_clade_list.py b/tests/unit/test_get_clade_list.py index fd4c08a..27fa80e 100644 --- a/tests/unit/test_get_clade_list.py +++ b/tests/unit/test_get_clade_list.py @@ -20,7 +20,7 @@ def test_file_path() -> Path: (0.1, 3, 9, ["AA", "AA.ZZ", "BB", "CC", "DD", "EE", "FF"]), (0.3, 3, 9, ["AA", "AA.ZZ", "EE"]), (0.1, 2, 9, ["AA.ZZ", "AA", "BB", "CC", "DD", "EE", "FF"]), - (0.1, 1, 9, ["AA", "BB", "CC", "FF"]), + (0.1, 1, 9, ["AA", "BB", "CC", "DD", "FF"]), (0.3, 1, 9, ["AA"]), (0.1, 3, 4, ["AA", "AA.ZZ", "BB", "CC"]), (0.3, 3, 2, ["AA", "AA.ZZ"]), diff --git a/tests/unit/util/test_sequence.py b/tests/unit/util/test_sequence.py index 8647edf..4bb7c17 100644 --- a/tests/unit/util/test_sequence.py +++ b/tests/unit/util/test_sequence.py @@ -58,7 +58,7 @@ def test_filter_covid_genome_metadata(): "date": ["2022-01-01", "2022-01-02", "2022-01-03", "2023-12-25", None, "2023-12-27"], "host": ["Homo sapiens", "Homo sapiens", "Homo sapiens", "Narwhals", "Homo sapiens", "Homo sapiens"], "country": ["USA", "Argentina", "USA", "USA", "USA", "USA"], - "division": ["Alaska", "Maine", "Puerto Rico", "Massachusetts", "Utah", "Pennsylvania"], + "division": ["Alaska", "Maine", "Guam", "Puerto Rico", "Utah", "Pennsylvania"], "clade_nextstrain": ["AAA", "BBB", "CCC", "DDD", "EEE", "FFF"], "location": ["Vulcan", "Reisa", "Bajor", "Deep Space 9", "Earth", "Cardassia"], "genbank_accession": ["A1", "A2", "B1", "B2", "C1", "C2"],