Commit c179d533 authored by Laura Denies's avatar Laura Denies
Browse files

include messages within rules

parent 07f76d3a
pathofact: pathofact:
sample: ["test_sample"] # requires user input sample: ["test_2"] # requires user input
project: PathoFact_module_test # requires user input project: PathoFact_test_2 # requires user input
datadir: ../test_dataset # requires user input datadir: ../test_dataset # requires user input
workflow: "complete" workflow: "complete"
size_fasta: 10000 size_fasta: 100
scripts: "scripts" scripts: "scripts"
signalp: "/work/projects/ecosystem_biology/local_tools/SignalP/signalp-5.0b/bin" # requires user input signalp: "/work/projects/ecosystem_biology/local_tools/SignalP/signalp-5.0b/bin" # requires user input
deepvirfinder: "submodules/DeepVirFinder/dvf.py" deepvirfinder: "submodules/DeepVirFinder/dvf.py"
......
...@@ -21,7 +21,7 @@ rule run_deepARG: ...@@ -21,7 +21,7 @@ rule run_deepARG:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda: conda:
"../../envs/DeepARG.yaml" "../../envs/DeepARG.yaml"
message: "executing deep-arg on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "executing deep-arg on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"deeparg predict --model LS --model-version v2 --type prot -d {config[pathofact][scripts]}/deeparg_data/deepARG --input {input} --out {wildcards.datadir}/{wildcards.project}/AMR/deepARG_results/{wildcards.sample}/{wildcards.file_i}.out &> {log}" "deeparg predict --model LS --model-version v2 --type prot -d {config[pathofact][scripts]}/deeparg_data/deepARG --input {input} --out {wildcards.datadir}/{wildcards.project}/AMR/deepARG_results/{wildcards.sample}/{wildcards.file_i}.out &> {log}"
...@@ -44,7 +44,7 @@ rule aggregate_deepARG: ...@@ -44,7 +44,7 @@ rule aggregate_deepARG:
outdir="{datadir}", outdir="{datadir}",
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"]
message: "aggregating deep-arg results on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "aggregating deep-arg results on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"cat {input} > {output}" "cat {input} > {output}"
...@@ -62,7 +62,7 @@ rule run_RGI: ...@@ -62,7 +62,7 @@ rule run_RGI:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda: conda:
"../../envs/rgi.yaml" "../../envs/rgi.yaml"
message: "executing RGI on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "executing RGI on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"rgi main --input_sequence {input} --output_file {wildcards.datadir}/{wildcards.project}/AMR/RGI_results/{wildcards.sample}/{wildcards.file_i}.RGI --input_type protein --local --clean &> {log}" "rgi main --input_sequence {input} --output_file {wildcards.datadir}/{wildcards.project}/AMR/RGI_results/{wildcards.sample}/{wildcards.file_i}.RGI --input_type protein --local --clean &> {log}"
...@@ -85,7 +85,7 @@ rule aggregate_RGI: ...@@ -85,7 +85,7 @@ rule aggregate_RGI:
outdir="{datadir}", outdir="{datadir}",
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"]
message: "Aggregate RGI results on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Aggregate RGI results on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"cat {input} > {output}" "cat {input} > {output}"
......
...@@ -65,7 +65,7 @@ rule run_VirFinder: ...@@ -65,7 +65,7 @@ rule run_VirFinder:
"../../envs/DeepVirFinder.yaml" "../../envs/DeepVirFinder.yaml"
threads: threads:
config["pathofact"]["mem"]["big_mem_cores"] config["pathofact"]["mem"]["big_mem_cores"]
message: "Executing Deep-VirFinder with {threads} threads on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Executing Deep-VirFinder with {threads} threads on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"python {config[pathofact][deepvirfinder]} -i {input} -o {wildcards.datadir}/{wildcards.project}/MGE/phage/{wildcards.sample}/virfinder -c {threads} &> {log}" "python {config[pathofact][deepvirfinder]} -i {input} -o {wildcards.datadir}/{wildcards.project}/MGE/phage/{wildcards.sample}/virfinder -c {threads} &> {log}"
...@@ -88,6 +88,6 @@ rule aggregate_VirFinder: ...@@ -88,6 +88,6 @@ rule aggregate_VirFinder:
outdir="{datadir}", outdir="{datadir}",
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"]
message: "Aggregate VirFinder predictions on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Aggregate VirFinder predictions on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"cat {input} >{output}" "cat {input} >{output}"
...@@ -58,7 +58,7 @@ rule run_PLASMID: ...@@ -58,7 +58,7 @@ rule run_PLASMID:
runtime=config["pathofact"]["runtime"]["long"], runtime=config["pathofact"]["runtime"]["long"],
mem=config["pathofact"]["mem"]["big_mem_per_core_gb"], mem=config["pathofact"]["mem"]["big_mem_per_core_gb"],
threshold=config["pathofact"]["plasflow_threshold"] threshold=config["pathofact"]["plasflow_threshold"]
message: "Executing PlasFLow on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Executing PlasFLow on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
""" """
PlasFlow.py --input {input} --output {output} --threshold {params.threshold} &> {log} PlasFlow.py --input {input} --output {output} --threshold {params.threshold} &> {log}
...@@ -83,7 +83,7 @@ rule Plasmid_aggregate: ...@@ -83,7 +83,7 @@ rule Plasmid_aggregate:
outdir="{datadir}", outdir="{datadir}",
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"]
message: "Aggregate PlasFlow results on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Aggregate PlasFlow results on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"cat {input} > {output}" "cat {input} > {output}"
...@@ -114,7 +114,7 @@ rule run_MOBsuite: ...@@ -114,7 +114,7 @@ rule run_MOBsuite:
config["pathofact"]["mem"]["big_mem_cores"] config["pathofact"]["mem"]["big_mem_cores"]
conda: conda:
"../../envs/MOB_suite.yaml" "../../envs/MOB_suite.yaml"
message: "Executing MOB_suite with {threads} threads on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Executing MOB_suite with {threads} threads on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: "mob_typer --multi --infile {input} --out_file {wildcards.datadir}/{wildcards.project}/MGE/plasmid/MOB_suite/{wildcards.sample}/{wildcards.file_i}_MOB_suite_prediction.txt -n {threads}" shell: "mob_typer --multi --infile {input} --out_file {wildcards.datadir}/{wildcards.project}/MGE/plasmid/MOB_suite/{wildcards.sample}/{wildcards.file_i}_MOB_suite_prediction.txt -n {threads}"
def aggregate_MOBsuite(wildcards): def aggregate_MOBsuite(wildcards):
...@@ -135,7 +135,7 @@ rule aggregate_MOBsuite: ...@@ -135,7 +135,7 @@ rule aggregate_MOBsuite:
outdir="{datadir}", outdir="{datadir}",
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"]
message: "Aggregate MOB_suite results on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Aggregate MOB_suite results on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"cat {input} > {output}" "cat {input} > {output}"
...@@ -23,7 +23,7 @@ rule R_script: ...@@ -23,7 +23,7 @@ rule R_script:
outdir="{datadir}", outdir="{datadir}",
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"]
message: "Generate Toxin report on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Generate Toxin report on the following sample(s): {wildcards.project} - {wildcards.sample}"
conda: conda:
"../../envs/R.yaml" "../../envs/R.yaml"
script: script:
......
...@@ -20,7 +20,7 @@ rule run_HMM_tox: ...@@ -20,7 +20,7 @@ rule run_HMM_tox:
"../../envs/HMMER.yaml" "../../envs/HMMER.yaml"
threads: threads:
1 1
message: "Executing toxin prediction with {threads} threads on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Executing toxin prediction with {threads} threads on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
""" """
hmmsearch --cpu {threads} --noali --notextw --tblout {output} {input.hmm} {input.renamed} &> {log} hmmsearch --cpu {threads} --noali --notextw --tblout {output} {input.hmm} {input.renamed} &> {log}
...@@ -61,7 +61,7 @@ rule HMM_correct_format_2: ...@@ -61,7 +61,7 @@ rule HMM_correct_format_2:
outdir="{datadir}", outdir="{datadir}",
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"]
message: "Aggregate toxin prediction of the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Aggregate toxin prediction of the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
""" """
cut -f 1,3,5,6 {input} | uniq > {output} cut -f 1,3,5,6 {input} | uniq > {output}
......
...@@ -17,6 +17,6 @@ rule combine_PathoFact: ...@@ -17,6 +17,6 @@ rule combine_PathoFact:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda: conda:
"../../envs/R.yaml" "../../envs/R.yaml"
message: "Generate PathoFact report on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Generate PathoFact report on the following sample(s): {wildcards.project} - {wildcards.sample}"
script: script:
"../../scripts/PathoFact.R" "../../scripts/PathoFact.R"
...@@ -14,7 +14,7 @@ rule Prodigal: ...@@ -14,7 +14,7 @@ rule Prodigal:
ORF="{datadir}/{project}/Prodigal/{sample}.faa", ORF="{datadir}/{project}/Prodigal/{sample}.faa",
GFF="{datadir}/{project}/Prodigal/{sample}.gff" GFF="{datadir}/{project}/Prodigal/{sample}.gff"
message: message:
"Generates ORFs and gff: {wildcares.project} - {wildcares.sample}" "Generates ORFs and gff: {wildcards.project} - {wildcards.sample}"
params: params:
outdir="{datadir}" outdir="{datadir}"
conda: conda:
......
...@@ -21,6 +21,6 @@ rule merge_SignalPVir: ...@@ -21,6 +21,6 @@ rule merge_SignalPVir:
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"]
conda: "../../envs/R.yaml" conda: "../../envs/R.yaml"
message: "Generate report on predicted virulence factors on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Generate report on predicted virulence factors on the following sample(s): {wildcards.project} - {wildcards.sample}"
script: "../../scripts/Virulence.R" script: "../../scripts/Virulence.R"
...@@ -22,7 +22,7 @@ rule run_HMM_vir: ...@@ -22,7 +22,7 @@ rule run_HMM_vir:
"../../envs/HMMER.yaml" "../../envs/HMMER.yaml"
threads: threads:
12 12
message: "Executing prediction of virulence factors (HMM) with {threads} threads on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Executing prediction of virulence factors (HMM) with {threads} threads on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
""" """
hmmsearch --cpu {threads} --noali --notextw --tblout {output} {input.hmm} {input.renamed} &> {log} hmmsearch --cpu {threads} --noali --notextw --tblout {output} {input.hmm} {input.renamed} &> {log}
...@@ -61,7 +61,7 @@ rule HMM_correct_format_2_vir: ...@@ -61,7 +61,7 @@ rule HMM_correct_format_2_vir:
aggregate_hmm aggregate_hmm
output: output:
"{datadir}/{project}/VIRULENCE/HMM_virulence/{sample}.Input_HMM_R.csv" "{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}",
runtime=config["pathofact"]["runtime"]["short"], runtime=config["pathofact"]["runtime"]["short"],
...@@ -101,7 +101,7 @@ rule HMM_VIR_classification: ...@@ -101,7 +101,7 @@ rule HMM_VIR_classification:
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"]
message: "Classify HMM virulence predictions on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Classify HMM virulence predictions on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
""" """
awk '$2 == "True" && $3 == "False" && $4 == "False"' {input} | awk '$5 = "negative"' | sed 's/ /\\t/g' > {output.non_path} awk '$2 == "True" && $3 == "False" && $4 == "False"' {input} | awk '$5 = "negative"' | sed 's/ /\\t/g' > {output.non_path}
...@@ -151,7 +151,7 @@ rule AAC: ...@@ -151,7 +151,7 @@ rule AAC:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda: conda:
"../../envs/Biopython.yaml" "../../envs/Biopython.yaml"
message: "Identify features (AAC) on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Identify features (AAC) on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"python {config[pathofact][scripts]}/AAC.py --file {input} --out {output} &> {log}" "python {config[pathofact][scripts]}/AAC.py --file {input} --out {output} &> {log}"
...@@ -167,7 +167,7 @@ rule DPC: ...@@ -167,7 +167,7 @@ rule DPC:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda: conda:
"../../envs/Biopython.yaml" "../../envs/Biopython.yaml"
message: "Identify features (DPC) on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Identify features (DPC) on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"python {config[pathofact][scripts]}/DPC.py --file {input} --out {output} &> {log}" "python {config[pathofact][scripts]}/DPC.py --file {input} --out {output} &> {log}"
...@@ -183,7 +183,7 @@ rule CTDC: ...@@ -183,7 +183,7 @@ rule CTDC:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda: conda:
"../../envs/Biopython.yaml" "../../envs/Biopython.yaml"
message: "Identify features (CTDC) on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Identify features (CTDC) on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"python {config[pathofact][scripts]}/CTDC.py --file {input} --out {output} &> {log}" "python {config[pathofact][scripts]}/CTDC.py --file {input} --out {output} &> {log}"
...@@ -199,7 +199,7 @@ rule CTDT: ...@@ -199,7 +199,7 @@ rule CTDT:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda: conda:
"../../envs/Biopython.yaml" "../../envs/Biopython.yaml"
message: "Identify features (CTDT) on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Identify features (CTDT) on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"python {config[pathofact][scripts]}/CTDT.py --file {input} --out {output} &> {log}" "python {config[pathofact][scripts]}/CTDT.py --file {input} --out {output} &> {log}"
...@@ -215,7 +215,7 @@ rule CTDD: ...@@ -215,7 +215,7 @@ rule CTDD:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda: conda:
"../../envs/Biopython.yaml" "../../envs/Biopython.yaml"
message: "Identify features (CTDD) on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Identify features (CTDD) on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"python {config[pathofact][scripts]}/CTDD.py --file {input} --out {output} &> {log}" "python {config[pathofact][scripts]}/CTDD.py --file {input} --out {output} &> {log}"
...@@ -231,7 +231,7 @@ rule join_matrix: ...@@ -231,7 +231,7 @@ rule join_matrix:
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"]
message: "Join feature matrix on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Join feature matrix on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
""" """
xjoin() {{ xjoin() {{
...@@ -266,7 +266,7 @@ rule classifier: ...@@ -266,7 +266,7 @@ rule classifier:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"] mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda: conda:
"../../envs/Biopython.yaml" "../../envs/Biopython.yaml"
message: "Execute classifier for virulence factor prediction on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Execute classifier for virulence factor prediction on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
"python {config[pathofact][scripts]}/virulence_prediction.py {input.input} {output} {input.model} &> {log}" "python {config[pathofact][scripts]}/virulence_prediction.py {input.input} {output} {input.model} &> {log}"
...@@ -288,7 +288,7 @@ rule format_classifier: ...@@ -288,7 +288,7 @@ rule format_classifier:
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"]
message: "Aggregate classifier predictions for virulence factors on the following sample{s}: {wildcards.project} - {wildcards.sample}" message: "Aggregate classifier predictions for virulence factors on the following sample(s): {wildcards.project} - {wildcards.sample}"
shell: shell:
""" """
sed 's/"//g' {input} | cut -f2,3 >{output} sed 's/"//g' {input} | cut -f2,3 >{output}
......
...@@ -27,7 +27,7 @@ Combined$ARG_SNPs <- fct_explicit_na(Combined$ARG_SNPs, na_level = "n/a") ...@@ -27,7 +27,7 @@ Combined$ARG_SNPs <- fct_explicit_na(Combined$ARG_SNPs, na_level = "n/a")
Combined$Best_Hit_ARO <- toupper(Combined$Best_Hit_ARO) Combined$Best_Hit_ARO <- toupper(Combined$Best_Hit_ARO)
Unique <- Combined %>% filter(Combined$DeepARG_ARG == "-" | Combined$Best_Hit_ARO == "-") Unique <- Combined %>% filter(Combined$DeepARG_ARG == "-" | Combined$Best_Hit_ARO == "-")
Unique$compare <- "-" Unique$compare <- factor(rep("-", nrow(Unique)))
Combined <- Combined %>% filter(Combined$DeepARG_ARG != "-" & Combined$Best_Hit_ARO != "-") Combined <- Combined %>% filter(Combined$DeepARG_ARG != "-" & Combined$Best_Hit_ARO != "-")
Combined$compare <- as.character(Combined$DeepARG_ARG) == as.character(Combined$Best_Hit_ARO) Combined$compare <- as.character(Combined$DeepARG_ARG) == as.character(Combined$Best_Hit_ARO)
Combined <- rbind(Combined, Unique) Combined <- rbind(Combined, Unique)
......
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