-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSnakefile
More file actions
83 lines (60 loc) · 2.14 KB
/
Copy pathSnakefile
File metadata and controls
83 lines (60 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import os
import dotenv
import glob
#################################################################################
# FUNCTIONS #
#################################################################################
def OPJ(*args):
path = os.path.join(*args)
return os.path.normpath(path)
#################################################################################
# GLOBALS #
#################################################################################
PROJECT_NAME = 'sequann'
PROJECT_DIR = OPJ(workflow.basedir)
# dotenv project variables
dotenv_path = OPJ(PROJECT_DIR, ".env")
dotenv.load_dotenv(dotenv_path)
FASTADIR=os.environ.get('SQANFASTADIR')
DATADIR=os.environ.get('SQANDATA')
DBDIR=os.environ.get('DBDIR')
#################################################################################
# RULES #
#################################################################################
#FASTAFILES = glob.glob(FASTADIR + '/*.fasta')
rule all:
input:
#DATADIR + "staramr/load_pointfinder.SUCCESS",
DATADIR + "staramr/load_resfinder.SUCCESS"
rule staramr:
output:
DATADIR + "staramr/pointfinder.tsv",
DATADIR + "staramr/resfinder.tsv"
params:
outdir=DATADIR + "staramr/",
fastaglob='*.fasta',
fastadir=FASTADIR
shell:
"""
cd {params.fastadir}
rm -rf {params.outdir}
staramr search -o {params.outdir} --pointfinder-organism salmonella {params.fastaglob}
"""
rule load_resfinder:
input:
DATADIR + "staramr/resfinder.tsv"
output:
DATADIR + "staramr/load_resfinder.SUCCESS"
params:
analysis="resfinder"
script:
"src/loader.py"
# rule load_pointfinder:
# input:
# DATADIR + "staramr/pointfinder.tsv"
# output:
# DATADIR + "staramr/load_pointfinder.SUCCESS"
# params:
# analysis="pointfinder"
# script:
# "src/loader.py"