我需要在同一个蛇文件中运行两个规则(gatk_Mutect2
和)。gatk_IndelRealigner
如果将这些规则放在不同的蛇文件中,我可以毫无错误地运行它们。
我使用两个输入函数(get_files_somatic
和get_files
)。两者都使用案例名称作为字典键。(每个案例都有一个正常的)。当我将这些规则放在同一个蛇文件中时,snakemake 会尝试在gatk_IndelRealigner
.
我的问题是:如何管理两条规则的歧义?我的意思是我希望snakemake 不要试图将这两个规则联系起来。
def get_files_somatic(wildcards):
case = wildcards.case
control = aCondition[case][0]
return ["{}.sorted.dup.reca.cleaned.bam".format(case),"{}.sorted.dup.reca.cleaned.bam".format(control)]
rule all:
input: expand("{sample}.sorted.dup.reca.cleaned.bam",sample=create_tumor()),
expand("Results/vcf/{case}.vcf",case=create_tumor()),
include_prefix="rules"
include:
include_prefix + "/gatk2.rules"
include:
include_prefix + "/mutec2.rules"
rule gatk_Mutect2:
input: get_files_somatic,
output: "Results/vcf/{case}.vcf",
params:
log: "logs/{case}.mutect2.log"
threads: 8
shell:
rule gatk_IndelRealigner:
input:
get_files,
output:
"{case}.sorted.dup.reca.cleaned.bam",
"{case}.sorted.dup.reca.cleaned.bai",
params:
log:
"mapped_reads/merged_samples/logs/{case}_indel_realign_2.log"
threads: 8
shell:
def get_files(wildcards):
case = wildcards.case
control = aCondition[case][0]
wildcards.control = control
return ["mapped_reads/merged_samples/{}.sorted.dup.reca.bam".format(case), "mapped_reads/merged_samples/{}.sorted.dup.reca.bam".format(control),"mapped_reads/merged_samples/operation/{}_{}.realign.intervals".format(case,control)]