Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/day_profiles/local/templates/rule_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ deepsomatic:
numa: " OMP_NUM_THREADS=8 OMP_PROC_BIND=close OMP_PLACES=threads OMP_PROC_BIND=TRUE OMP_DYNAMIC=TRUE OMP_MAX_ACTIVE_LEVELS=1 OMP_SCHEDULE=dynamic OMP_WAIT_POLICY=ACTIVE "
dvsom_conda: "../envs/vanilla_v0.1.yaml"

facets:
threads: 2
env_yaml: "../envs/vanilla_v0.1.yaml"
container: "docker://mskcc/facets-suite:2.2.1"
partition: "i8"
mem_mb: 8000

duphold:
threads: 7
env_yaml: "../envs/duphold_v0.1.yaml"
Expand Down
7 changes: 7 additions & 0 deletions config/day_profiles/slurm/templates/rule_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ deepsomatic:
numa: " OMP_THREADS=64 OMP_PROC_BIND=close OMP_PLACES=threads OMP_DYNAMIC=true OMP_MAX_ACTIVE_LEVELS=1 OMP_SCHEDULE=dynamic OMP_WAIT_POLICY=ACTIVE "
dvsom_conda: "../envs/vanilla_v0.1.yaml"

facets:
threads: 8
env_yaml: "../envs/vanilla_v0.1.yaml"
container: "docker://mskcc/facets-suite:2.2.1"
partition: "i192,i128,i192mem"
mem_mb: 16000



duphold:
Expand Down
1 change: 1 addition & 0 deletions config/global.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ profile_name: "global" # this is over-ridden when profile specific config is in

snv_callers_somatic:
- "senttn"
- "facets"


logs:
Expand Down
1 change: 1 addition & 0 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ include: "rules/deepvariant_1_5.smk"
include: "rules/deepvariant_1_9.smk"
include: "rules/deepvariant_ug.smk"
include: "rules/deepsomatic.smk"
include: "rules/facets_suite.smk"
include: "rules/doppel_mrkdups.smk"
include: "rules/duphold.smk"
include: "rules/dysgu_sv.smk"
Expand Down
74 changes: 74 additions & 0 deletions workflow/rules/facets_suite.smk
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import os
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The os module is imported but never used in this file. This unused import should be removed to keep the code clean.

Suggested change
import os

Copilot uses AI. Check for mistakes.

##### facets-suite somatic variant caller
# ---------------------------

rule facets_suite:
wildcard_constraints:
sample=TUMORS_REGEX
input:
tumor_cram=get_somcall_tumor_cram,
tumor_crai=get_somcall_tumor_crai,
normal_cram=get_somcall_normal_cram,
normal_crai=get_somcall_normal_crai,
ref_fa=lambda wc: config["supporting_files"]["files"]["huref"]["fasta"]["name"],
ref_fai=lambda wc: config["supporting_files"]["files"]["huref"]["fasta"]["name"] + ".fai",
output:
cncf=MDIR + "{sample}/align/{alnr}/snv/facets/{sample}.{alnr}.facets.cncf.txt",
seg=MDIR + "{sample}/align/{alnr}/snv/facets/{sample}.{alnr}.facets.seg",
vcfgz=MDIR + "{sample}/align/{alnr}/snv/facets/{sample}.{alnr}.facets.vcf.gz",
vcftbi=MDIR + "{sample}/align/{alnr}/snv/facets/{sample}.{alnr}.facets.vcf.gz.tbi",
log:
MDIR + "{sample}/align/{alnr}/snv/facets/log/{sample}.{alnr}.facets.log",
threads: config['facets']['threads']
container:
config['facets']['container']
resources:
vcpu=config['facets']['threads'],
threads=config['facets']['threads'],
partition=config['facets']['partition'],
mem_mb=config['facets']['mem_mb'],
params:
cluster_sample=ret_sample,
shell:
r"""
set -euo pipefail
mkdir -p "$(dirname {output.cncf})"

run_facets_wrapper.R \
--tumor {input.tumor_cram} \
--normal {input.normal_cram} \
--reference {input.ref_fa} \
--outdir $(dirname {output.cncf}) \
--name {wildcards.sample}.{wildcards.alnr} \
--vcf {output.vcfgz} \
--cncf {output.cncf} \
--seg {output.seg} >> {log} 2>&1

tabix -f -p vcf {output.vcfgz} >> {log} 2>&1
"""


rule produce_facets_suite_vcf: # Target rule to gather facets outputs
wildcard_constraints:
sample=TUMORS_REGEX
input:
vcftb=expand(
MDIR + "{sample}/align/{alnr}/snv/facets/{sample}.{alnr}.facets.vcf.gz",
sample=TN_TUMOR_SAMPS,
alnr=ALIGNERS,
),
vcftbi=expand(
MDIR + "{sample}/align/{alnr}/snv/facets/{sample}.{alnr}.facets.vcf.gz.tbi",
sample=TN_TUMOR_SAMPS,
alnr=ALIGNERS,
),
output:
"gatheredall.facets",
threads: 1
log:
"gatheredall.facets.log",
params:
cluster_sample=ret_sample,
shell:
"touch {output}"