Skip to content

Commit

Permalink
fix: use homopolymer-pair-HMM-mode of Varlociraptor in case of nanopo…
Browse files Browse the repository at this point in the history
…re reads (#587)

* Revert "Revert "fix: use homopolymer-pair-HMM-mode of Varlociraptor in case of nanopore reads""

This reverts commit 91274a5.

* properly retrieve sample data frame

* use pep sample table

* fix typo

* fix technology call

---------

Co-authored-by: Alex Thomas <[email protected]>
  • Loading branch information
johanneskoester and alethomas authored Sep 14, 2023
1 parent aced95e commit 9bc814f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -1592,6 +1592,16 @@ def get_checked_mode():
raise TypeError(f'Mode {mode} not recognized. Can be "patient" or "environment".')


def get_varlociraptor_preprocess_flags(wildcards):
technology = get_technology(wildcards)
if technology == "ont":
return "--pairhmm-mode homopolymer"
elif technology == "illumina" or technology == "ion":
return ""
else:
raise NotImplementedError(f"Technology {technology} not supported.")


def get_input_by_mode(wildcard):
paths = [
expand(
Expand Down
3 changes: 2 additions & 1 deletion workflow/rules/variant_calling.smk
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,13 @@ rule varlociraptor_preprocess:
temp("results/{date}/observations/ref~{reference}/{sample}.{varrange}.bcf"),
params:
depth=config["variant-calling"]["max-read-depth"],
extra=get_varlociraptor_preprocess_flags,
log:
"logs/{date}/varlociraptor/preprocess/ref~{reference}/{sample}.{varrange}.log",
conda:
"../envs/varlociraptor.yaml"
shell:
"varlociraptor preprocess variants --candidates {input.candidates} "
"varlociraptor preprocess variants {params.extra} --candidates {input.candidates} "
"{input.ref} --bam {input.bam} --max-depth {params.depth} --output {output} 2> {log}"


Expand Down

0 comments on commit 9bc814f

Please sign in to comment.