Skip to content

Commit

Permalink
fixup: directly access serotype wildcard value
Browse files Browse the repository at this point in the history
Co-authored-by: Jover Lee <[email protected]>
  • Loading branch information
j23414 and joverlee521 committed Feb 12, 2024
1 parent 5da76d9 commit 3ddefcf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ingest/workflow/snakemake_rules/split_serotypes.smk
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@ rule split_by_ncbi_serotype:
metadata = "results/metadata_{serotype}.tsv",
sequences = "results/sequences_{serotype}.fasta"
params:
ncbi_serotype = lambda wildcards: wildcards.serotype,
id_field = config["transform"]["id_field"]
shell:
"""
if [[ "{params.ncbi_serotype}" == "all" ]]; then
if [[ "{wildcards.serotype}" == "all" ]]; then
cp {input.metadata} {output.metadata}
cp {input.sequences} {output.sequences}
else
augur filter \
--sequences {input.sequences} \
--metadata {input.metadata} \
--metadata-id-columns {params.id_field} \
--query "ncbi_serotype=='{params.ncbi_serotype}'" \
--query "ncbi_serotype=='{wildcards.serotype}'" \
--output-sequences {output.sequences} \
--output-metadata {output.metadata}
fi
Expand Down

0 comments on commit 3ddefcf

Please sign in to comment.