Skip to content

Commit

Permalink
fix delly calls by removing breakends for now since the cause invalid…
Browse files Browse the repository at this point in the history
… BCFs after annotation. (#77)

[W::bcf_record_check] BCF record at 19:20064191 has invalid RLEN (-8103858). Only one invalid RLEN will be reported.
  • Loading branch information
johanneskoester authored May 28, 2021
1 parent 03a97e8 commit 066c954
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
16 changes: 15 additions & 1 deletion workflow/rules/candidate_calling.smk
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,23 @@ rule delly:
"0.68.0/bio/delly"


# Delly breakends lead to invalid BCFs after VEP annotation (invalid RLEN). Therefore we exclude them for now.
rule fix_delly_calls:
input:
"results/candidate-calls/{group}.delly.bcf",
output:
"results/candidate-calls/{group}.delly.no_bnds.bcf",
log:
"logs/fix_delly_calls/{group}.log",
conda:
"../envs/bcftools.yaml"
shell:
"""bcftools view -e 'INFO/SVTYPE="BND"' {input} -Ob > {output} 2> {log}"""


rule scatter_candidates:
input:
"results/candidate-calls/{group}.{caller}.bcf",
get_fixed_candidate_calls,
output:
scatter.calling(
"results/candidate-calls/{{group}}.{{caller}}.{scatteritem}.bcf"
Expand Down
7 changes: 7 additions & 0 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,13 @@ def get_fdr_control_params(wildcards):
return {"threshold": threshold, "events": events, "local": local}


def get_fixed_candidate_calls(wildcards):
if wildcards.caller == "delly":
return "results/candidate-calls/{group}.delly.no_bnds.bcf"
else:
return "results/candidate-calls/{group}.{caller}.bcf"


wildcard_constraints:
group="|".join(samples["group"].unique()),
sample="|".join(samples["sample_name"]),
Expand Down

0 comments on commit 066c954

Please sign in to comment.