Skip to content

Commit 170f99c

Browse files
authored
Merge pull request #98 from nextstrain/improve-ppx-fetch
ingest: Improve fetch from PPX
2 parents 1831d49 + 06ef494 commit 170f99c

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

ingest/config/config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ ncbi_taxon_id:
99

1010
ppx_fetch:
1111
a:
12-
seqs: https://lapis.pathoplexus.org/rsv-a/sample/unalignedNucleotideSequences
12+
seqs: https://lapis.pathoplexus.org/rsv-a/sample/unalignedNucleotideSequences?versionStatus=LATEST_VERSION
1313
meta: https://lapis.pathoplexus.org/rsv-a/sample/details?dataFormat=csv&versionStatus=LATEST_VERSION
1414
b:
15-
seqs: https://lapis.pathoplexus.org/rsv-b/sample/unalignedNucleotideSequences
15+
seqs: https://lapis.pathoplexus.org/rsv-b/sample/unalignedNucleotideSequences?versionStatus=LATEST_VERSION
1616
meta: https://lapis.pathoplexus.org/rsv-b/sample/details?dataFormat=csv&versionStatus=LATEST_VERSION
1717

1818

ingest/workflow/snakemake_rules/fetch_sequences.smk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ rule download_ppx_seqs:
102102
sequences= "data/{subtype}/ppx_sequences.fasta",
103103
params:
104104
sequences_url=lambda w: config["ppx_fetch"][w.subtype]["seqs"],
105+
# Allow retries in case of network errors
106+
retries: 5
105107
shell:
106108
"""
107-
curl {params.sequences_url:q} -o {output.sequences}
109+
curl -fsSL {params.sequences_url:q} -o {output.sequences}
108110
"""
109111

110112
rule download_ppx_meta:
@@ -113,9 +115,11 @@ rule download_ppx_meta:
113115
params:
114116
metadata_url=lambda w: config["ppx_fetch"][w.subtype]["meta"],
115117
fields = ",".join(config["ppx_metadata_fields"])
118+
# Allow retries in case of network errors
119+
retries: 5
116120
shell:
117121
"""
118-
curl '{params.metadata_url}&fields={params.fields}' -o {output.metadata}
122+
curl -fsSL '{params.metadata_url}&fields={params.fields}' -o {output.metadata}
119123
"""
120124

121125
rule format_ppx_ndjson:

0 commit comments

Comments
 (0)