Skip to content

Commit

Permalink
fixup: simplify the default targest in the Snakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
j23414 committed Mar 19, 2024
1 parent 2e14f00 commit ed1bf1f
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions ingest/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,10 @@ configfile: "defaults/config.yaml"

serotypes = ['all', 'denv1', 'denv2', 'denv3', 'denv4']

def _get_all_targets(wildcards):
# Default targets are the metadata TSV and sequences FASTA files
all_targets = expand(["results/sequences_{serotype}.fasta", "results/metadata_{serotype}.tsv"], serotype=serotypes)


# Add additional targets based on upload config
upload_config = config.get("upload", {})

for target, params in upload_config.items():
files_to_upload = params.get("files_to_upload", {})

if not params.get("dst"):
print(
f"Skipping file upload for {target!r} because the destination was not defined."
)
else:
all_targets.extend(
expand(
[f"data/upload/{target}/{{remote_file_name}}.done"],
zip,
remote_file_name=files_to_upload.keys(),
)
)

return all_targets


rule all:
input:
_get_all_targets,
expand(["results/sequences_{serotype}.fasta", "results/metadata_{serotype}.tsv"], serotype=serotypes)


include: "rules/fetch_from_ncbi.smk"
Expand Down

0 comments on commit ed1bf1f

Please sign in to comment.