Commit 037108b1 authored by Laura Denies's avatar Laura Denies
Browse files

limit nr. of files

parent c179d533
pathofact: pathofact:
sample: ["test_2"] # requires user input sample: ["test_2"] # requires user input
project: PathoFact_test_2 # requires user input project: Lim_PathoFact # requires user input
datadir: ../test_dataset # requires user input datadir: ../test_dataset # requires user input
workflow: "complete" workflow: "complete"
size_fasta: 100 size_fasta: 100
......
...@@ -14,7 +14,7 @@ rule run_deepARG: ...@@ -14,7 +14,7 @@ rule run_deepARG:
output: output:
temp("{datadir}/{project}/AMR/deepARG_results/{sample}/{file_i}.out.mapping.ARG") temp("{datadir}/{project}/AMR/deepARG_results/{sample}/{file_i}.out.mapping.ARG")
log: log:
"{datadir}/{project}/AMR/deepARG_results/{sample}/{file_i}.out.mapping.ARG.log" "{datadir}/{project}/AMR/logs/{sample}/{file_i}.out.mapping.ARG.log"
params: params:
outdir="{datadir}", outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["medium"], runtime=config["pathofact"]["runtime"]["medium"],
...@@ -55,7 +55,7 @@ rule run_RGI: ...@@ -55,7 +55,7 @@ rule run_RGI:
output: output:
temp("{datadir}/{project}/AMR/RGI_results/{sample}/{file_i}.RGI.txt") temp("{datadir}/{project}/AMR/RGI_results/{sample}/{file_i}.RGI.txt")
log: log:
"{datadir}/{project}/AMR/RGI_results/{sample}/{file_i}.RGI.log" "{datadir}/{project}/logs/{sample}/{file_i}.RGI.log"
params: params:
outdir="{datadir}", outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["medium"], runtime=config["pathofact"]["runtime"]["medium"],
...@@ -99,7 +99,7 @@ rule combine_AMR: ...@@ -99,7 +99,7 @@ rule combine_AMR:
output: output:
AMR_combined="{datadir}/{project}/AMR/{sample}_AMR_prediction.tsv" AMR_combined="{datadir}/{project}/AMR/{sample}_AMR_prediction.tsv"
log: log:
"{datadir}/{project}/AMR/{sample}_combine_AMR_temp.log" "{datadir}/{project}/logs/{sample}_combine_AMR_temp.log"
params: params:
outdir="{datadir}", outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"], runtime=config["pathofact"]["runtime"]["short"],
......
...@@ -21,7 +21,7 @@ rule combine_AMR_plasmid: ...@@ -21,7 +21,7 @@ rule combine_AMR_plasmid:
Report_1="{datadir}/{project}/AMR/{sample}_AMR_MGE_prediction_detailed.tsv", Report_1="{datadir}/{project}/AMR/{sample}_AMR_MGE_prediction_detailed.tsv",
Report_2="{datadir}/{project}/AMR_MGE_prediction_{sample}_report.tsv" Report_2="{datadir}/{project}/AMR_MGE_prediction_{sample}_report.tsv"
log: log:
"{datadir}/{project}/AMR/{sample}_MGE_AMR_prediction_detail_temp.log" "{datadir}/{project}/logs/{sample}_MGE_AMR_prediction_detail_temp.log"
params: params:
outdir="{datadir}", outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["medium"], runtime=config["pathofact"]["runtime"]["medium"],
......
...@@ -13,9 +13,9 @@ rule run_VirSorter: ...@@ -13,9 +13,9 @@ rule run_VirSorter:
input: input:
"{datadir}/{project}/renamed/{sample}_Contig_ID.fna" "{datadir}/{project}/renamed/{sample}_Contig_ID.fna"
output: output:
"{datadir}/{project}/MGE/phage/{sample}/virsorter/VIRSorter_global-phage-signal.csv" temp("{datadir}/{project}/MGE/phage/{sample}/virsorter/VIRSorter_global-phage-signal.csv")
log: log:
"{datadir}/{project}/MGE/phage/{sample}/virsorter/VIRSorter_global-phage-signal.log" "{datadir}/{project}/logs/{sample}/VIRSorter_global-phage-signal.log"
params: params:
outdir="{datadir}", outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["long"], runtime=config["pathofact"]["runtime"]["long"],
...@@ -54,9 +54,9 @@ rule run_VirFinder: ...@@ -54,9 +54,9 @@ rule run_VirFinder:
input: input:
"{datadir}/{project}/contig_splitted/{sample}/{file_i}.fasta" "{datadir}/{project}/contig_splitted/{sample}/{file_i}.fasta"
output: output:
"{datadir}/{project}/MGE/phage/{sample}/virfinder/{file_i}.fasta_gt1bp_dvfpred.txt" temp("{datadir}/{project}/MGE/phage/{sample}/virfinder/{file_i}.fasta_gt1bp_dvfpred.txt")
log: log:
"{datadir}/{project}/MGE/phage/{sample}/virfinder/{file_i}.fasta_gt1bp_dvfpred.log" "{datadir}/{project}/logs/{sample}/{file_i}.fasta_gt1bp_dvfpred.log"
params: params:
outdir="{datadir}", outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["long"], runtime=config["pathofact"]["runtime"]["long"],
......
...@@ -12,9 +12,9 @@ rule filter_seq: ...@@ -12,9 +12,9 @@ rule filter_seq:
input: input:
"{datadir}/{project}/renamed/{sample}_Contig_ID.fna" "{datadir}/{project}/renamed/{sample}_Contig_ID.fna"
output: output:
"{datadir}/{project}/{sample}_filtered.fna" temp("{datadir}/{project}/plasmid/{sample}_filtered.fna")
log: log:
"{datadir}/{project}/{sample}_filtered.log" "{datadir}/{project}/logs/{sample}_filtered.log"
conda: conda:
"../../envs/Biopython.yaml" "../../envs/Biopython.yaml"
params: params:
...@@ -28,7 +28,7 @@ rule filter_seq: ...@@ -28,7 +28,7 @@ rule filter_seq:
checkpoint splitplasmid: checkpoint splitplasmid:
input: input:
"{datadir}/{project}/{sample}_filtered.fna" "{datadir}/{project}/plasmid/{sample}_filtered.fna"
output: output:
split=directory("{datadir}/{project}/MGE/plasmid_splitted/{sample}/") split=directory("{datadir}/{project}/MGE/plasmid_splitted/{sample}/")
params: params:
...@@ -50,7 +50,7 @@ rule run_PLASMID: ...@@ -50,7 +50,7 @@ rule run_PLASMID:
output: output:
temp("{datadir}/{project}/MGE/plasmid/PlasFlow/{sample}/{file_i}_plasflow_prediction.tsv") temp("{datadir}/{project}/MGE/plasmid/PlasFlow/{sample}/{file_i}_plasflow_prediction.tsv")
log: log:
"{datadir}/{project}/MGE/plasmid/PlasFlow/{sample}/{file_i}_plasflow_prediction.log" "{datadir}/{project}/logs/{sample}/{file_i}_plasflow_prediction.log"
conda: conda:
"../../envs/PlasFlow.yaml" "../../envs/PlasFlow.yaml"
params: params:
...@@ -78,7 +78,7 @@ rule Plasmid_aggregate: ...@@ -78,7 +78,7 @@ rule Plasmid_aggregate:
input: input:
aggregate_plasmid_input aggregate_plasmid_input
output: output:
"{datadir}/{project}/MGE/plasmid/PlasFlow/{sample}_plasflow_aggregated.tsv" temp("{datadir}/{project}/MGE/plasmid/PlasFlow/{sample}_plasflow_aggregated.tsv")
params: params:
outdir="{datadir}", outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"], runtime=config["pathofact"]["runtime"]["short"],
...@@ -106,7 +106,7 @@ rule run_MOBsuite: ...@@ -106,7 +106,7 @@ rule run_MOBsuite:
output: output:
temp("{datadir}/{project}/MGE/plasmid/MOB_suite/{sample}/{file_i}_MOB_suite_prediction.txt") temp("{datadir}/{project}/MGE/plasmid/MOB_suite/{sample}/{file_i}_MOB_suite_prediction.txt")
log: log:
"{datadir}/{project}/MGE/plasmid/PlasFlow/{sample}/{file_i}_MOB_suite_prediction.log" "{datadir}/{project}/logs/{sample}/{file_i}_MOB_suite_prediction.log"
params: params:
outdir="{datadir}", outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["long"] runtime=config["pathofact"]["runtime"]["long"]
......
...@@ -18,7 +18,7 @@ rule R_script: ...@@ -18,7 +18,7 @@ rule R_script:
gene_library="{datadir}/{project}/Toxin_gene_library_{sample}_report.tsv", gene_library="{datadir}/{project}/Toxin_gene_library_{sample}_report.tsv",
gene_toxic="{datadir}/{project}/Toxin_prediction_{sample}_report.tsv" gene_toxic="{datadir}/{project}/Toxin_prediction_{sample}_report.tsv"
log: log:
"{datadir}/{project}/TOXIN/R_output/{sample}_gene_table_library.log" "{datadir}/{project}/logs/{sample}_gene_table_library.log"
params: params:
outdir="{datadir}", outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"], runtime=config["pathofact"]["runtime"]["short"],
......
...@@ -11,7 +11,7 @@ rule run_HMM_tox: ...@@ -11,7 +11,7 @@ rule run_HMM_tox:
output: output:
temp("{datadir}/{project}/TOXIN/HMM_toxin/{sample}/{file_i}.hmmscan") temp("{datadir}/{project}/TOXIN/HMM_toxin/{sample}/{file_i}.hmmscan")
log: log:
"{datadir}/{project}/TOXIN/HMM_toxin/{sample}/{file_i}.log" "{datadir}/{project}/logs/{sample}/{file_i}.log"
params: params:
outdir="{datadir}", outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["long"], runtime=config["pathofact"]["runtime"]["long"],
...@@ -71,7 +71,7 @@ rule HMM_correct_format_3: ...@@ -71,7 +71,7 @@ rule HMM_correct_format_3:
input: input:
"{datadir}/{project}/TOXIN/HMM_toxin/{sample}.Input_HMM_R_temp.csv" "{datadir}/{project}/TOXIN/HMM_toxin/{sample}.Input_HMM_R_temp.csv"
output: output:
"{datadir}/{project}/TOXIN/HMM_toxin/{sample}.Input_HMM_R.csv" temp("{datadir}/{project}/TOXIN/HMM_toxin/{sample}.Input_HMM_R.csv")
params: params:
outdir="{datadir}", outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"], runtime=config["pathofact"]["runtime"]["short"],
......
...@@ -18,7 +18,7 @@ rule R_script: ...@@ -18,7 +18,7 @@ rule R_script:
gene_library="{datadir}/{project}/Toxin_gene_library_{sample}_report.tsv", gene_library="{datadir}/{project}/Toxin_gene_library_{sample}_report.tsv",
gene_toxic="{datadir}/{project}/Toxin_prediction_{sample}_report.tsv" gene_toxic="{datadir}/{project}/Toxin_prediction_{sample}_report.tsv"
log: log:
"{datadir}/{project}/TOXIN/R_output/{sample}_gene_table_library.log" "{datadir}/{project}/logs/{sample}_gene_table_library.log"
message: message:
"Run external R script to join SignalP and ToxinHMM and create Toxin report (incl. confidence levels)" "Run external R script to join SignalP and ToxinHMM and create Toxin report (incl. confidence levels)"
params: params:
......
...@@ -19,9 +19,11 @@ rule Prodigal: ...@@ -19,9 +19,11 @@ rule Prodigal:
outdir="{datadir}" outdir="{datadir}"
conda: conda:
"../../envs/Prodigal.yaml" "../../envs/Prodigal.yaml"
log:
"{datadir}/{project}/logs/Prodigal_{sample}.log"
shell: shell:
""" """
prodigal -i {input} -o {output.GFF} -a {output.ORF} -f gff -p meta prodigal -i {input} -o {output.GFF} -a {output.ORF} -f gff -p meta &> {log}
sed -i 's/[^>]*ID=//;s/;.*//;s/*//' {output.ORF} sed -i 's/[^>]*ID=//;s/;.*//;s/*//' {output.ORF}
""" """
...@@ -92,7 +94,7 @@ checkpoint splitting: ...@@ -92,7 +94,7 @@ checkpoint splitting:
output: output:
splits=directory("{datadir}/{project}/splitted/{sample}/") splits=directory("{datadir}/{project}/splitted/{sample}/")
log: log:
"{datadir}/{project}/splitted/{sample}.log" "{datadir}/{project}/logs/split_ORF_{sample}.log"
params: params:
outdir="{datadir}", outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"], runtime=config["pathofact"]["runtime"]["short"],
...@@ -102,5 +104,5 @@ checkpoint splitting: ...@@ -102,5 +104,5 @@ checkpoint splitting:
"../../envs/Biopython.yaml" "../../envs/Biopython.yaml"
shell: shell:
""" """
python {config[pathofact][scripts]}/split.py {input} {params.split} {wildcards.datadir}/{wildcards.project}/splitted/{wildcards.sample} python {config[pathofact][scripts]}/split.py {input} {params.split} {wildcards.datadir}/{wildcards.project}/splitted/{wildcards.sample} &> {log}
""" """
...@@ -54,9 +54,11 @@ checkpoint splitcontig: ...@@ -54,9 +54,11 @@ checkpoint splitcontig:
split=config["pathofact"]["size_fasta"] split=config["pathofact"]["size_fasta"]
conda: conda:
"../../envs/Biopython.yaml" "../../envs/Biopython.yaml"
log:
"{datadir}/{project}/logs/split_contig_{sample}.log"
shell: shell:
""" """
python {config[pathofact][scripts]}/split.py {input} {params.split} {wildcards.datadir}/{wildcards.project}/contig_splitted/{wildcards.sample} python {config[pathofact][scripts]}/split.py {input} {params.split} {wildcards.datadir}/{wildcards.project}/contig_splitted/{wildcards.sample} &> {log}
""" """
...@@ -16,7 +16,7 @@ rule merge_SignalPVir: ...@@ -16,7 +16,7 @@ rule merge_SignalPVir:
output: output:
Virulence_report="{datadir}/{project}/Virulence_prediction_{sample}_report.tsv" Virulence_report="{datadir}/{project}/Virulence_prediction_{sample}_report.tsv"
log: log:
"{datadir}/{project}/VIRULENCE//{sample}.combine_virulence_results.log" "{datadir}/{project}/logs/{sample}.combine_virulence_results.log"
params: params:
runtime=config["pathofact"]["runtime"]["short"], runtime=config["pathofact"]["runtime"]["short"],
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
......
...@@ -11,7 +11,7 @@ rule run_HMM_vir: ...@@ -11,7 +11,7 @@ rule run_HMM_vir:
output: output:
temp("{datadir}/{project}/VIRULENCE/HMM_virulence/{sample}/{file_i}.hmmscan") temp("{datadir}/{project}/VIRULENCE/HMM_virulence/{sample}/{file_i}.hmmscan")
log: log:
"{datadir}/{project}/VIRULENCE/HMM_virulence/{sample}/{file_i}.log" "{datadir}/{project}/logs/{sample}/{file_i}.log"
message: message:
"Run HMM scan on {input.renamed} to generate {output}" "Run HMM scan on {input.renamed} to generate {output}"
params: params:
...@@ -60,7 +60,7 @@ rule HMM_correct_format_2_vir: ...@@ -60,7 +60,7 @@ rule HMM_correct_format_2_vir:
input: input:
aggregate_hmm aggregate_hmm
output: output:
"{datadir}/{project}/VIRULENCE/HMM_virulence/{sample}.Input_HMM_R.csv" temp("{datadir}/{project}/VIRULENCE/HMM_virulence/{sample}.Input_HMM_R.csv")
message: "Aggregate virulence factor prediction (HMM) on the following sample(s): {wildcards.project} - {wildcards.sample}" message: "Aggregate virulence factor prediction (HMM) on the following sample(s): {wildcards.project} - {wildcards.sample}"
params: params:
outdir="{datadir}", outdir="{datadir}",
...@@ -81,7 +81,7 @@ rule HMM_R_VIR: ...@@ -81,7 +81,7 @@ rule HMM_R_VIR:
output: output:
temp("{datadir}/{project}/VIRULENCE/HMM_virulence/{sample}.hmm_results.csv") temp("{datadir}/{project}/VIRULENCE/HMM_virulence/{sample}.hmm_results.csv")
log: log:
"{datadir}/{project}/VIRULENCE/HMM_virulence/{sample}.hmm_results.log" "{datadir}/{project}/logs/{sample}.hmm_results.log"
params: params:
runtime=config["pathofact"]["runtime"]["medium"], runtime=config["pathofact"]["runtime"]["medium"],
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
...@@ -145,7 +145,7 @@ rule AAC: ...@@ -145,7 +145,7 @@ rule AAC:
output: output:
temp("{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_AAC.txt") temp("{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_AAC.txt")
log: log:
"{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_AAC.log" "{datadir}/{project}/logs/{sample}/{file_i}_AAC.log"
params: params:
runtime=config["pathofact"]["runtime"]["medium"], runtime=config["pathofact"]["runtime"]["medium"],
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
...@@ -161,7 +161,7 @@ rule DPC: ...@@ -161,7 +161,7 @@ rule DPC:
output: output:
temp("{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_DPC.txt") temp("{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_DPC.txt")
log: log:
"{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_DPC.log" "{datadir}/{project}/logs/{sample}/{file_i}_DPC.log"
params: params:
runtime=config["pathofact"]["runtime"]["medium"], runtime=config["pathofact"]["runtime"]["medium"],
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
...@@ -177,7 +177,7 @@ rule CTDC: ...@@ -177,7 +177,7 @@ rule CTDC:
output: output:
temp("{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_CTDC.txt") temp("{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_CTDC.txt")
log: log:
"{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_CTDC.log" "{datadir}/{project}/logs/{sample}/{file_i}_CTDC.log"
params: params:
runtime=config["pathofact"]["runtime"]["medium"], runtime=config["pathofact"]["runtime"]["medium"],
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
...@@ -193,7 +193,7 @@ rule CTDT: ...@@ -193,7 +193,7 @@ rule CTDT:
output: output:
temp("{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_CTDT.txt") temp("{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_CTDT.txt")
log: log:
"{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_CTDT.log" "{datadir}/{project}/logs/{sample}/{file_i}_CTDT.log"
params: params:
runtime=config["pathofact"]["runtime"]["medium"], runtime=config["pathofact"]["runtime"]["medium"],
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
...@@ -209,7 +209,7 @@ rule CTDD: ...@@ -209,7 +209,7 @@ rule CTDD:
output: output:
temp("{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_CTDD.txt") temp("{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_CTDD.txt")
log: log:
"{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_CTDD.log" "{datadir}/{project}/logs/{sample}/{file_i}_CTDD.log"
params: params:
runtime=config["pathofact"]["runtime"]["medium"], runtime=config["pathofact"]["runtime"]["medium"],
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
...@@ -260,7 +260,7 @@ rule classifier: ...@@ -260,7 +260,7 @@ rule classifier:
output: output:
temp("{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_classifier_prediction.tsv") temp("{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_classifier_prediction.tsv")
log: log:
"{datadir}/{project}/VIRULENCE/classifier_virulence/{sample}/{file_i}_classifier_prediction.log" "{datadir}/{project}/logs/{sample}/{file_i}_classifier_prediction.log"
params: params:
runtime=config["pathofact"]["runtime"]["medium"], runtime=config["pathofact"]["runtime"]["medium"],
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment