-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
79 lines (72 loc) · 2.16 KB
/
Snakefile
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
SAMPLES, = glob_wildcards("{sample}.trim.sig.zip")
print(f"found {len(SAMPLES)}")
DB="/group/ctbrowngrp/sourmash-db/gtdb-rs214/gtdb-rs214-k31.zip"
rule all:
input:
expand("{sample}.pygather.csv", sample=SAMPLES),
expand("{sample}.fastgather.csv", sample=SAMPLES),
expand("{sample}.fastmultigather_rocksdb.csv", sample=SAMPLES),
expand("{sample}.fastmultigather.csv", sample=SAMPLES),
rule pygather:
input:
sig = "{sample}.trim.sig.zip",
db=DB,
output:
"{sample}.pygather.csv"
threads: 128
benchmark: "benchmarks/pygather.{sample}.txt"
shell: """
sourmash gather -k 31 --scaled 1000 {input.sig} {input.db} \
-o {output}
"""
rule fastgather:
input:
sig = "{sample}.trim.sig.zip",
db=DB,
output:
"{sample}.fastgather.csv"
threads: 128
benchmark: "benchmarks/fastgather.{sample}.txt"
shell: """
sourmash scripts fastgather -k 31 -s 1000 {input.sig} {input.db} \
-c {threads} -o {output}
"""
rule make_rocksdb:
input:
db=DB,
output:
directory("gtdb-rs214-k31.rocksdb"),
threads: 128
benchmark:
"benchmarks/index.rocksdb.txt",
shell: """
sourmash scripts index -c {threads} -k 31 -s 1000 {input} -o {output}
"""
rule fastmultigather_rocksdb:
input:
sig="{sample}.trim.sig.zip",
db="gtdb-rs214-k31.rocksdb",
output:
"{sample}.fastmultigather_rocksdb.csv",
threads: 128
benchmark: "benchmarks/fastmultigather_rocksdb.{sample}.txt"
shell: """
sourmash scripts fastmultigather -k 31 -s 1000 {input.sig} {input.db} \
-o {output} -c {threads}
"""
rule fastmultigather:
input:
sig="{sample}.trim.sig.zip",
db=DB,
output:
actual="{sample}.gather.csv",
prefetch="{sample}.prefetch.csv",
rename="{sample}.fastmultigather.csv",
threads: 128
benchmark:
"benchmarks/fastmultigather.{sample}.txt",
shell: """
sourmash scripts fastmultigather {input.sig} {input.db} -k 31 -s 1000 \
-c {threads}
cp {output.actual} {output.rename}
"""