SignalP.smk 1.72 KB
Newer Older
Laura Denies's avatar
Laura Denies committed
1
2
3
4
5
6
7
#SignalP

import glob
import os

#Run SignalP on split sequence files
rule signalp:
8
    input:
Laura Denies's avatar
Laura Denies committed
9
        "{datadir}/{project}/renamed/{sample}_ID.faa"        
10
    output:
Laura Denies's avatar
Laura Denies committed
11
12
        SignalP_gramP="{datadir}/{project}/SignalP/{sample}/gramp_summary.signalp5",
        SignalP_gramN="{datadir}/{project}/SignalP/{sample}/gramn_summary.signalp5"
13
    log:
Laura Denies's avatar
Laura Denies committed
14
        "{datadir}/{project}/SignalP/{sample}.log"
15
16
17
    message:
        "Running SignalP analysis on {input} resulting in {output}."
    params:
18
19
20
        outdir="{datadir}",
        runtime=config["pathofact"]["runtime"]["long"],
        mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
21
22
    shell:
        """
Laura Denies's avatar
Laura Denies committed
23
24
25
	export PATH={config[pathofact][signalp]}:$PATH
        signalp -fasta {input} -org gram+ -prefix {wildcards.datadir}/{wildcards.project}/SignalP/{wildcards.sample}/gramp -batch {config[pathofact][size_fasta]}
        signalp -fasta {input} -org gram- -prefix {wildcards.datadir}/{wildcards.project}/SignalP/{wildcards.sample}/gramn -batch {config[pathofact][size_fasta]}
26
27
        """

Laura Denies's avatar
Laura Denies committed
28
rule aggregate_signalP:
29
    input:
Laura Denies's avatar
Laura Denies committed
30
31
        SignalP_gramP="{datadir}/{project}/SignalP/{sample}/gramp_summary.signalp5",
        SignalP_gramN="{datadir}/{project}/SignalP/{sample}/gramn_summary.signalp5"
32
    output:
Laura Denies's avatar
Laura Denies committed
33
        SignalP_report="{datadir}/{project}/SignalP/aggregated/{sample}_SignalP_results.tsv"
34
35
    message:
        "concatenate multiple split signalP files in a single joined file: {output}"
Laura Denies's avatar
Laura Denies committed
36
37
    log:
        "{datadir}/{project}/SignalP/{sample}_SignalP_temp.log"
38
    params:
39
40
41
        outdir="{datadir}",
        runtime=config["pathofact"]["runtime"]["short"],
        mem=config["pathofact"]["mem"]["normal_mem_per_core_gb"]
Laura Denies's avatar
Laura Denies committed
42
43
    conda: "../../envs/R.yaml"    
    script: "../../scripts/SignalP.R"