Skip to content

Commit

Permalink
fix: pangolin data updates (#662)
Browse files Browse the repository at this point in the history
* restructure data download

* fmt

* change name

* change name of rule

* remove old rules

* change input name
  • Loading branch information
alethomas authored Aug 20, 2024
1 parent 6d78c8a commit f46ec83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
27 changes: 5 additions & 22 deletions workflow/rules/ref.smk
Original file line number Diff line number Diff line change
Expand Up @@ -191,32 +191,15 @@ rule get_human_genome:
"curl -SL -o {output} {params.human_genome} 2> {log}"


rule update_pangoLEARN:
rule get_pangolin_data:
output:
directory("results/{date}/pangolin/pangoLEARN"),
"results/{date}/pangolin/pangolin-data.log",
log:
"logs/{date}/pangolin/update.log",
"logs/{date}/pangolin/pangolin-data.log",
conda:
"../envs/unix.yaml"
shell:
"(mkdir -p {output} &&"
" curl -L https://github.com/cov-lineages/pangoLEARN/archive/master.tar.gz |"
" tar xvz --strip-components=1 -C {output})"
" > {log} 2>&1"


rule update_lineages:
output:
directory("results/{date}/pangolin/lineages"),
log:
"logs/{date}/pangolin/update.log",
conda:
"../envs/unix.yaml"
"../envs/pangolin.yaml"
shell:
"(mkdir -p {output} &&"
" curl -L https://github.com/cov-lineages/lineages/archive/master.tar.gz | "
" tar xvz --strip-components=1 -C {output})"
" > {log} 2>&1"
"pangolin --update-data > {log} 2>&1 && cp {log} {output}"


rule get_gisaid_provision:
Expand Down
7 changes: 2 additions & 5 deletions workflow/rules/strain_calling.smk
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,16 @@ rule kallisto_plot_all_strains:
rule pangolin_call_strains:
input:
contigs=get_pangolin_input,
pangoLEARN="results/{date}/pangolin/pangoLEARN",
lineages="results/{date}/pangolin/lineages",
data="results/{date}/pangolin/pangolin-data.log",
output:
"results/{date}/tables/strain-calls/{sample}.{stage}.strains.pangolin.csv",
log:
"logs/{date}/pangolin/{sample}.{stage}.log",
params:
pango_data_path=lambda w, input: os.path.dirname(input.pangoLEARN),
conda:
"../envs/pangolin.yaml"
threads: 8
shell:
"pangolin {input.contigs} --data {params.pango_data_path} --outfile {output} > {log} 2>&1"
"pangolin {input.contigs} --outfile {output} > {log} 2>&1"


rule pangolin_plot_all_strains:
Expand Down

0 comments on commit f46ec83

Please sign in to comment.