diff --git a/project/workflow/envs/yourenv.yaml b/project/workflow/envs/yourenv.yaml index d3378468940ece5c50a88fae85ec31565f6e0eb1..ccc3e2b95f0f6835687243bed9c22652a5dbdf91 100644 --- a/project/workflow/envs/yourenv.yaml +++ b/project/workflow/envs/yourenv.yaml @@ -19,4 +19,5 @@ dependencies: - snakemake-wrapper-utils=0.3 - kmc=3.2.1 - Trimmomatic=0.32 + - kraken2=2.1.2 prefix: /buffer/ag_bsc/pmsb_workflows_2022/virus/anna-swp-workflows/project/workflow/envs/yourenv.yaml diff --git a/project/workflow/rules/IVA.smk b/project/workflow/rules/IVA.smk index 27fcd9711d3c2ed5c8dc69d879d2676a9414b8bd..46fa4829ef9baaf068f0f3763cbea12dc5c5ce8c 100644 --- a/project/workflow/rules/IVA.smk +++ b/project/workflow/rules/IVA.smk @@ -1,14 +1,15 @@ rule IVA: input: - "results/unmapped_fastq/ERR4082860_1_unmapped.fastq", - "results/unmapped_fastq/ERR4082860_2_unmapped.fastq" + "results/unmapped_fastq/{sample}_1_unmapped.fastq", + "results/unmapped_fastq/{sample}_2_unmapped.fastq" output: - "results/IVA/ERR4082860.trim.good.iva" + "results/IVA/{sample}.trim.good.iva" log: - "workflow/report/IVA/ERR4082860.log" - threads:4 + "workflow/report/IVA/{sample}.log" + threads:20 conda: "../envs/yourenv.yaml" shell: "iva --threads {threads} -f {input[0]} -r {input[1]} {output} 2> {log}" + \ No newline at end of file diff --git a/project/workflow/rules/kraken.smk b/project/workflow/rules/kraken.smk index e01aa280948aeec707c3fa3f219741600a361991..d6bb7acefc882fe8376b46d6f5fb9e4458f3c22d 100644 --- a/project/workflow/rules/kraken.smk +++ b/project/workflow/rules/kraken.smk @@ -1,14 +1,13 @@ rule build: input: - "results/fastp/trimmed/ERR4082860.1.fastq" + sample=["results/fastp/trimmed/ERR4082860.1.fastq", "results/fastp/trimmed/ERR4082860.2.fastq"] output: "results/krakendb/db" threads:4 conda: "../envs/yourenv.yaml" shell: - "kraken2-build --standard --threads {threads} --db db" - + "kraken2-build --standard --threads {threads} --db {output}" rule report: input: @@ -19,6 +18,6 @@ rule report: conda: "../envs/yourenv.yaml" log: - "workflow/report/kraken/{sample}.log" + "workflow/report/kraken_report/{sample}.log" shell: "kraken2 --report --db {input.db} {input.sample} > {output} 2> {log}" \ No newline at end of file diff --git a/project/workflow/snakefile b/project/workflow/snakefile index 7e56cb36ffd7d5035b03f2dd33bca5b40ad93989..9ba3b7d5b363a1a5bad9de9d7e5d9e273ddfada7 100644 --- a/project/workflow/snakefile +++ b/project/workflow/snakefile @@ -5,14 +5,13 @@ samples = pd.read_table(config["samples"], index_col="sample") rule all: input: - "results/IVA/ERR4082860.trim.good.iva", - "ERR4082860_report.txt" + expand("results/IVA/{sample}.trim.good.iva", sample=samples.index) include: "rules/fastp.smk" include: "rules/bowtie2.smk" include: "rules/samtools.smk" include: "rules/IVA.smk" -include: "rules/kraken.smk" +#include: "rules/kraken.smk"