Skip to content

Commit

Permalink
Ingest: Use augur merge (#60)
Browse files Browse the repository at this point in the history
Use augur merge to comply with pathogen repo guide nextstrain/pathogen-repo-guide@3fc3e65

Co-authored-by: DOH-LMT2303 <[email protected]>
  • Loading branch information
DOH-LMT2303 and DOH-LMT2303 authored Jan 20, 2025
1 parent 325a677 commit 41ee393
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions ingest/defaults/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ curate:
nextclade:
nextclade_dataset_path: '../nextclade/dataset'
nextclade_field: 'clade_membership'
nextclade_id: 'accession'

pathoplexus:
URL: 'https://lapis.pathoplexus.org/west-nile/sample/details'
Expand Down
24 changes: 14 additions & 10 deletions ingest/rules/nextclade.smk
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,28 @@ rule select_nextclade_columns:
"""

rule append_nextclade_columns:
#Append the nextclade results to the metadata
"""
Append the nextclade results to the metadata
"""
input:
metadata="data/raw_metadata.tsv",
nextclade_subtypes="data/nextclade_clades.tsv",
output:
metadata_all="data/metadata_nextclade.tsv",
params:
id_field=config["curate"]["output_id_field"],
nextclade_field=config["nextclade"]["nextclade_field"],
nextclade_id_field=config["nextclade"]["nextclade_id"],
shell:
"""
tsv-join -H \
--filter-file {input.nextclade_subtypes} \
--key-fields {params.id_field} \
--append-fields {params.nextclade_field} \
--write-all ? \
{input.metadata} \
> {output.metadata_all}
r"""
augur merge \
--metadata \
metadata={input.metadata:q} \
nextclade={input.nextclade_subtypes:q} \
--metadata-id-columns \
metadata={params.id_field:q} \
nextclade={params.nextclade_id_field:q} \
--output-metadata {output.metadata_all:q} \
--no-source-columns
"""

rule append_pathoplexus_columns:
Expand Down

0 comments on commit 41ee393

Please sign in to comment.