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>

Ported-from: <nextstrain/measles@762acdb>
Related-to: <nextstrain/measles#52>
Related-to: <#65>
  • Loading branch information
tsibley committed Oct 3, 2024
1 parent 6cac65b commit bd393f1
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 @@ -72,7 +72,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 bd393f1

Please sign in to comment.