Skip to content

Commit

Permalink
Merge branch 'master' into feat-add-mode-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasbtf authored Dec 19, 2021
2 parents 0ea3fa6 + 9690f12 commit 7a3d594
Show file tree
Hide file tree
Showing 3 changed files with 28 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
27 changes: 26 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,7 @@ def get_aggregated_pangolin_calls(wildcards, return_list="paths"):
return expanded_patterns



def get_checked_mode():
mode = config["mode"]
if mode == "patient" or mode == "environment":
Expand Down Expand Up @@ -1583,6 +1587,27 @@ def get_input_by_mode(wildcard):
return sum(paths, [])


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_patient_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 7a3d594

Please sign in to comment.