同じsnakefileで2つのルール(gatk_Mutect2
とgatk_IndelRealigner
)を実行する必要があります。snakemake:ルールを別のルールで間違ったモードで接続する
これらのルールを別のスニークファイルに入れると、エラーなしで実行できます。
2つの入力関数(get_files_somatic
とget_files
)を使用します。両方とも辞書のキーとしてケース名を使用します。 (それぞれのケースは正常です)。 これらのルールを同じsnakefileに入れると、snakemakeは入力の法線のidをgatk_IndelRealigner
で見つけようとします。
私の質問はどのように2つのルールのあいまいさを管理できますか?私はsnakemakeがこれらの2つのルールを接続しようとしないことを意味します。
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)]
詳細をより明確に説明してください。 – bli
@bli私はsnakemakeパイプラインに問題があります。この場合、2つの異なるsnakemakeファイルでパイプラインをダイビングする必要があります.1つはgat_Indellrealignを実行し、もう1つはMutect2を実行するためです。どのようにsnakemakeを止めることができますこの2つの特定のルールを接続するには? –