Skip to content

Commit

Permalink
Merge pull request #79 from nextstrain/remove-ncov-ingest-geolocation…
Browse files Browse the repository at this point in the history
…-rules

ingest: Remove use of ncov-ingest geolocation rules
  • Loading branch information
joverlee521 authored Mar 4, 2025
2 parents de4b930 + 2a51aef commit 1daa5e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
4 changes: 0 additions & 4 deletions ingest/defaults/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ ncbi_datasets_fields:

# Config parameters related to the curate pipeline
curate:
# URL pointed to public generalized geolocation rules
# For the Nextstrain team, this is currently
# 'https://raw.githubusercontent.com/nextstrain/ncov-ingest/master/source-data/gisaid_geoLocationRules.tsv'
geolocation_rules_url: 'https://raw.githubusercontent.com/nextstrain/ncov-ingest/master/source-data/gisaid_geoLocationRules.tsv'
# The path to the local geolocation rules within the pathogen repo
# The path should be relative to the ingest directory.
local_geolocation_rules: 'defaults/geolocation-rules.tsv'
Expand Down
27 changes: 2 additions & 25 deletions ingest/rules/curate.smk
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,6 @@ Parameters are expected to be defined in `config.curate`.
"""


rule fetch_general_geolocation_rules:
output:
general_geolocation_rules="data/general-geolocation-rules.tsv",
params:
geolocation_rules_url=config["curate"]["geolocation_rules_url"],
shell:
"""
curl {params.geolocation_rules_url} > {output.general_geolocation_rules}
"""


rule concat_geolocation_rules:
input:
general_geolocation_rules="data/general-geolocation-rules.tsv",
local_geolocation_rules=config["curate"]["local_geolocation_rules"],
output:
all_geolocation_rules="data/all-geolocation-rules.tsv",
shell:
"""
cat {input.general_geolocation_rules} {input.local_geolocation_rules} >> {output.all_geolocation_rules}
"""


def format_field_map(field_map: dict[str, str]) -> str:
"""
Format dict to `"key1"="value1" "key2"="value2"...` for use in shell commands.
Expand All @@ -46,7 +23,7 @@ def format_field_map(field_map: dict[str, str]) -> str:
rule curate:
input:
sequences_ndjson="data/sequences.ndjson",
all_geolocation_rules="data/all-geolocation-rules.tsv",
geolocation_rules=config["curate"]["local_geolocation_rules"],
annotations=config["curate"]["annotations"],
output:
metadata="data/all_metadata.tsv",
Expand Down Expand Up @@ -90,7 +67,7 @@ rule curate:
--authors-field {params.authors_field} \
--default-value {params.authors_default_value} \
| augur curate apply-geolocation-rules \
--geolocation-rules {input.all_geolocation_rules} \
--geolocation-rules {input.geolocation_rules} \
| ./scripts/fix-zika-strain-names.py \
| augur curate apply-record-annotations \
--annotations {input.annotations} \
Expand Down

0 comments on commit 1daa5e0

Please sign in to comment.