Skip to content

Commit

Permalink
ingest: Use raw-string for Nextclade metadata merge rule
Browse files Browse the repository at this point in the history
Preserving the line-breaks makes the command much more readable in
Snakemake output¹, which is important since I'm changing this rule right
now.

The \n previously interpreted by Python is now interpreted by `tr`,
which is preferable.

¹ <https://docs.nextstrain.org/en/latest/reference/snakemake-style-guide.html#use-triple-quoted-command-definitions>
  • Loading branch information
tsibley committed Sep 4, 2024
1 parent 168b91a commit 762acdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ingest/rules/nextclade.smk
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ rule join_metadata_and_nextclade:
metadata_id_field=config["curate"]["output_id_field"],
nextclade_id_field=config["nextclade"]["id_field"],
shell:
"""
r"""
export SUBSET_FIELDS=`grep -v '^#' {input.nextclade_field_map} | awk '{{print $1}}' | tr '\n' ',' | sed 's/,$//g'`
csvtk -tl cut -f $SUBSET_FIELDS \
Expand Down

0 comments on commit 762acdb

Please sign in to comment.