Gitlab is now using https://gitlab.lcsb.uni.lu as it's primary address. Please update your bookmarks. FAQ.

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

include messages within rules

parent 07f76d3a
pathofact:
sample: ["test_sample"] # requires user input
project: PathoFact_module_test # requires user input
sample: ["test_2"] # requires user input
project: PathoFact_test_2 # requires user input
datadir: ../test_dataset # requires user input
workflow: "complete"
size_fasta: 10000
size_fasta: 100
scripts: "scripts"
signalp: "/work/projects/ecosystem_biology/local_tools/SignalP/signalp-5.0b/bin" # requires user input
deepvirfinder: "submodules/DeepVirFinder/dvf.py"
......
......@@ -21,7 +21,7 @@ rule run_deepARG:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda:
"../../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:
"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:
outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"],
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:
"cat {input} > {output}"
......@@ -62,7 +62,7 @@ rule run_RGI:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda:
"../../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:
"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:
outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"],
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:
"cat {input} > {output}"
......
......@@ -65,7 +65,7 @@ rule run_VirFinder:
"../../envs/DeepVirFinder.yaml"
threads:
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:
"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:
outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"],
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:
"cat {input} >{output}"
......@@ -58,7 +58,7 @@ rule run_PLASMID:
runtime=config["pathofact"]["runtime"]["long"],
mem=config["pathofact"]["mem"]["big_mem_per_core_gb"],
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:
"""
PlasFlow.py --input {input} --output {output} --threshold {params.threshold} &> {log}
......@@ -83,7 +83,7 @@ rule Plasmid_aggregate:
outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"],
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:
"cat {input} > {output}"
......@@ -114,7 +114,7 @@ rule run_MOBsuite:
config["pathofact"]["mem"]["big_mem_cores"]
conda:
"../../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}"
def aggregate_MOBsuite(wildcards):
......@@ -135,7 +135,7 @@ rule aggregate_MOBsuite:
outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"],
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:
"cat {input} > {output}"
......@@ -23,7 +23,7 @@ rule R_script:
outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"],
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:
"../../envs/R.yaml"
script:
......
......@@ -20,7 +20,7 @@ rule run_HMM_tox:
"../../envs/HMMER.yaml"
threads:
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:
"""
hmmsearch --cpu {threads} --noali --notextw --tblout {output} {input.hmm} {input.renamed} &> {log}
......@@ -61,7 +61,7 @@ rule HMM_correct_format_2:
outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"],
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:
"""
cut -f 1,3,5,6 {input} | uniq > {output}
......
......@@ -17,6 +17,6 @@ rule combine_PathoFact:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda:
"../../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:
"../../scripts/PathoFact.R"
......@@ -14,7 +14,7 @@ rule Prodigal:
ORF="{datadir}/{project}/Prodigal/{sample}.faa",
GFF="{datadir}/{project}/Prodigal/{sample}.gff"
message:
"Generates ORFs and gff: {wildcares.project} - {wildcares.sample}"
"Generates ORFs and gff: {wildcards.project} - {wildcards.sample}"
params:
outdir="{datadir}"
conda:
......
......@@ -21,6 +21,6 @@ rule merge_SignalPVir:
runtime=config["pathofact"]["runtime"]["short"],
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
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"
......@@ -22,7 +22,7 @@ rule run_HMM_vir:
"../../envs/HMMER.yaml"
threads:
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:
"""
hmmsearch --cpu {threads} --noali --notextw --tblout {output} {input.hmm} {input.renamed} &> {log}
......@@ -61,7 +61,7 @@ rule HMM_correct_format_2_vir:
aggregate_hmm
output:
"{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:
outdir="{datadir}",
runtime=config["pathofact"]["runtime"]["short"],
......@@ -101,7 +101,7 @@ rule HMM_VIR_classification:
params:
runtime=config["pathofact"]["runtime"]["short"],
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:
"""
awk '$2 == "True" && $3 == "False" && $4 == "False"' {input} | awk '$5 = "negative"' | sed 's/ /\\t/g' > {output.non_path}
......@@ -151,7 +151,7 @@ rule AAC:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda:
"../../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:
"python {config[pathofact][scripts]}/AAC.py --file {input} --out {output} &> {log}"
......@@ -167,7 +167,7 @@ rule DPC:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda:
"../../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:
"python {config[pathofact][scripts]}/DPC.py --file {input} --out {output} &> {log}"
......@@ -183,7 +183,7 @@ rule CTDC:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda:
"../../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:
"python {config[pathofact][scripts]}/CTDC.py --file {input} --out {output} &> {log}"
......@@ -199,7 +199,7 @@ rule CTDT:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda:
"../../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:
"python {config[pathofact][scripts]}/CTDT.py --file {input} --out {output} &> {log}"
......@@ -215,7 +215,7 @@ rule CTDD:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda:
"../../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:
"python {config[pathofact][scripts]}/CTDD.py --file {input} --out {output} &> {log}"
......@@ -231,7 +231,7 @@ rule join_matrix:
params:
runtime=config["pathofact"]["runtime"]["short"],
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:
"""
xjoin() {{
......@@ -266,7 +266,7 @@ rule classifier:
mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
conda:
"../../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:
"python {config[pathofact][scripts]}/virulence_prediction.py {input.input} {output} {input.model} &> {log}"
......@@ -288,7 +288,7 @@ rule format_classifier:
params:
runtime=config["pathofact"]["runtime"]["short"],
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:
"""
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")
Combined$Best_Hit_ARO <- toupper(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$compare <- as.character(Combined$DeepARG_ARG) == as.character(Combined$Best_Hit_ARO)
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