Skip to content

Commit

Permalink
fix: pangolin input for overview table, bamclipper samtools error, in…
Browse files Browse the repository at this point in the history
…clude flag for high quality genome report (#418)

* fixes from production

* fmt
  • Loading branch information
thomasbtf authored Dec 19, 2021
1 parent cf9ec16 commit 9690f12
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
1 change: 1 addition & 0 deletions workflow/envs/bamclipper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ channels:
- conda-forge
dependencies:
- bamclipper =1.0
- samtools =1.9 # see https://github.com/merenlab/anvio/issues/1479
26 changes: 25 additions & 1 deletion workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,10 @@ def get_include_flag(sample):


def get_include_flag_for_date(wildcards):
return [get_include_flag(sample) for sample in get_samples_for_date(wildcards.date)]
return [
get_include_flag(sample)
for sample in get_assemblies_for_submission(wildcards, "accepted samples")
]


def get_artic_primer(wildcards):
Expand Down Expand Up @@ -1541,6 +1544,27 @@ def get_aggregated_pangolin_calls(wildcards, return_list="paths"):
return expanded_patterns


def get_pangolin_for_report(wildcards):
paths = []

path = "results/{date}/tables/strain-calls/{sample}.{stage}.strains.pangolin.csv"

for entry in get_assemblies_for_submission(wildcards, "all samples"):
sample, assembly = entry.split(",")
if assembly == "normal":
pango_stage = "polished"
elif assembly == "pseudo":
pango_stage = "pseudo"
elif assembly == "consensus":
pango_stage = "consensus"
elif assembly == "not-accepted":
pango_stage = "polished"

paths.append(path.format(sample=sample, date=wildcards.date, stage=pango_stage))

return paths


wildcard_constraints:
sample="[^/.]+",
vartype="|".join(VARTYPES),
Expand Down
4 changes: 1 addition & 3 deletions workflow/rules/generate_output.smk
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ rule overview_table_csv:
pseudo_contigs=get_fallbacks_for_report("pseudo"),
consensus_contigs=get_fallbacks_for_report("consensus"),
kraken=get_kraken_output,
pangolin=expand_samples_for_date(
"results/{{date}}/tables/strain-calls/{sample}.polished.strains.pangolin.csv",
),
pangolin=get_pangolin_for_report,
bcf=expand_samples_for_date(
"results/{{date}}/filtered-calls/ref~main/{sample}.subclonal.high+moderate-impact.bcf",
),
Expand Down

0 comments on commit 9690f12

Please sign in to comment.