-
Notifications
You must be signed in to change notification settings - Fork 1
/
snakefile
executable file
·75 lines (62 loc) · 2.11 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
import yaml
shell.prefix("set -euo pipefail; ")
#################
## CONFIG files
#################
configfile: "config.yaml"
with open('cluster.yaml', mode='r') as f:
cluster_config = yaml.load(f)
#################
## datai ids, sample ids
#################
TENXSAMPLE = config["sample"]
#################
## rules
#################
include: "modules/findgse.module"
include: "modules/getorganelle_plast.module"
#include: "modules/"
rule all:
input:
expand("out_supernova_{sample}/outs", sample = TENXSAMPLE), ## supernova - de novo assembly module
expand("out_findgse_{sample}/v1.94.est.jellyfish.hist.genome.size.estimated.k21to21.fitted.txt", sample = TENXSAMPLE), ## findgse - genome properties based on k-mer spectrum
expand("out_getorganelle_plast_{sample}", sample = TENXSAMPLE), ## chloroplast genome assembler
expand("out_shasta_{sample}/Assembly.fasta", sample = TENXSAMPLE) ## nanopore assembler - Shasta
rule supernova_assembly:
input:
dir="10x/{sample}",
output:
directory("out_supernova_{sample}/outs")
log:
"logs/supernova/{sample}.log"
singularity:
"docker://nfcore/supernova"
threads: 10
shell:
"(supernova run --id=out_supernova_{wildcards.sample} --fastqs={input.dir} --sample={wildcards.sample} --localmem=600 --localcores={threads} --maxreads='all') 2> {log}"
rule longranger_basic:
input:
dir="10x/{sample}"
output:
"out_lrbasic_{sample}/outs/barcoded.fastq.gz"
log:
"logs/longranger/{sample}.log"
singularity:
"docker://olavurmortensen/longranger"
threads: 10
shell:
"(longranger basic --id=out_lrbasic_{wildcards.sample} --fastqs={input.dir} --sample={wildcards.sample} --localcores={threads} --localmem=50 --maxjobs=20) 2> {log}"
rule shasta:
input:
file="ont_data/{sample}.fastq.gz"
output:
"out_shasta_{sample}/Assembly.fasta"
params:
outdir="out_shasta_{sample}"
log:
"logs/shasta/{sample}.log"
singularity:
"docker://kishwars/shasta"
threads: 10
shell:
"(shasta --input {input.file} --memoryMode anonymous --memoryBacking 4K --Assembly.consensusCaller Bayesian:guppy-3.0.5-a --assemblyDirectory {params.outdir} --threads {threads}) 2> {log}"