Skip to content

Commit

Permalink
feat!: 237 revive cnvkit (#339)
Browse files Browse the repository at this point in the history
feat!: revives cvnkit implementation

* Reference creation moved to panel_of_normal step

* Added support for creating a reference based on whole genome data

* Support for Copy Number Alterations using cnvkit for somatic_targeted_seq_cnv_calling & somatic_wgs_cnv_calling

* Closes #236 & closes #339

BREAKING CHANGE: broken plot generation for the control_freec tool in the somatic_wgs_cnv_calling step, and the sample selection for the mutect2 panel_of_normal generation can be based on a user-generated file.
  • Loading branch information
ericblanc20 authored Jan 23, 2023
1 parent a660bda commit bc4c55b
Show file tree
Hide file tree
Showing 24 changed files with 2,945 additions and 854 deletions.
7 changes: 7 additions & 0 deletions docs/step/panel_of_normals.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _step_panel_of_normals::

==========================================================
Creation of panel of normals for somatic SNV & CNV calling
==========================================================

.. automodule:: snappy_pipeline.workflows.panel_of_normals
114 changes: 114 additions & 0 deletions snappy_pipeline/workflows/panel_of_normals/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,117 @@ rule panel_of_normals_mutect2_create_panel:
**wf.get_log_file("mutect2", "create_panel"),
wrapper:
wf.wrapper_path("mutect2/create_panel")


# Panel of normals (cnvkit) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# Write out access file (if required, must be run prior to the cnvkit panel of normals)


rule panel_of_normals_access_run:
output:
**wf.get_output_files("access", "run"),
resources:
time=wf.get_resource("access", "run", "time"),
memory=wf.get_resource("access", "run", "memory"),
partition=wf.get_resource("access", "run", "partition"),
log:
**wf.get_log_file("access", "run"),
wrapper:
wf.wrapper_path("cnvkit/access")


# Write out the normals-only results for the normals --------------------------


rule panel_of_normals_cnvkit_target:
input:
unpack(wf.get_input_files("cnvkit", "target")),
output:
**wf.get_output_files("cnvkit", "target"),
threads: wf.get_resource("cnvkit", "target", "threads")
resources:
time=wf.get_resource("cnvkit", "target", "time"),
memory=wf.get_resource("cnvkit", "target", "memory"),
partition=wf.get_resource("cnvkit", "target", "partition"),
log:
**wf.get_log_file("cnvkit", "target"),
params:
args=wf.substep_dispatch("cnvkit", "get_args", "target"),
wrapper:
wf.wrapper_path("cnvkit/target")


rule panel_of_normals_cnvkit_antitarget:
input:
unpack(wf.get_input_files("cnvkit", "antitarget")),
output:
**wf.get_output_files("cnvkit", "antitarget"),
threads: wf.get_resource("cnvkit", "antitarget", "threads")
resources:
time=wf.get_resource("cnvkit", "antitarget", "time"),
memory=wf.get_resource("cnvkit", "antitarget", "memory"),
partition=wf.get_resource("cnvkit", "antitarget", "partition"),
log:
**wf.get_log_file("cnvkit", "antitarget"),
params:
args=wf.substep_dispatch("cnvkit", "get_args", "antitarget"),
wrapper:
wf.wrapper_path("cnvkit/antitarget")


rule panel_of_normals_cnvkit_coverage:
input:
unpack(wf.get_input_files("cnvkit", "coverage")),
output:
**wf.get_output_files("cnvkit", "coverage"),
threads: wf.get_resource("cnvkit", "coverage", "threads")
resources:
time=wf.get_resource("cnvkit", "coverage", "time"),
memory=wf.get_resource("cnvkit", "coverage", "memory"),
partition=wf.get_resource("cnvkit", "coverage", "partition"),
log:
**wf.get_log_file("cnvkit", "coverage"),
params:
args=wf.substep_dispatch("cnvkit", "get_args", "coverage"),
wrapper:
wf.wrapper_path("cnvkit/coverage")


# Create the panel of normals -------------------------------------------------


rule panel_of_normals_cnvkit_create_panel:
input:
unpack(wf.get_input_files("cnvkit", "create_panel")),
output:
**wf.get_output_files("cnvkit", "create_panel"),
threads: wf.get_resource("cnvkit", "create_panel", "threads")
resources:
time=wf.get_resource("cnvkit", "create_panel", "time"),
memory=wf.get_resource("cnvkit", "create_panel", "memory"),
partition=wf.get_resource("cnvkit", "create_panel", "partition"),
log:
**wf.get_log_file("cnvkit", "create_panel"),
params:
args=wf.substep_dispatch("cnvkit", "get_args", "create_panel"),
wrapper:
wf.wrapper_path("cnvkit/reference")


rule panel_of_normals_cnvkit_report:
input:
unpack(wf.get_input_files("cnvkit", "report")),
output:
**wf.get_output_files("cnvkit", "report"),
threads: wf.get_resource("cnvkit", "report", "threads")
resources:
time=wf.get_resource("cnvkit", "report", "time"),
memory=wf.get_resource("cnvkit", "report", "memory"),
partition=wf.get_resource("cnvkit", "report", "partition"),
log:
**wf.get_log_file("cnvkit", "report"),
params:
args=wf.substep_dispatch("cnvkit", "get_args", "report"),
wrapper:
wf.wrapper_path("cnvkit/report")
Loading

0 comments on commit bc4c55b

Please sign in to comment.