-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpipeline.bpipe
49 lines (41 loc) · 1.21 KB
/
pipeline.bpipe
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
SCRIPT = "~/projects_backup/INCSeq"
//ALIGNER = "graphmap"
ALIGNER = "blastn"
READ_NUM = 1000
LINE_NUM = READ_NUM * 2
set_global_var = {
doc title: "Set global branch variables"
branch.PREFIX = branch.name
}
split_fasta = {
doc title: "Split the fasta files"
desc: """
Split the fasta file into multiple chunks
"""
output.dir = "tmp_split"
produce("*.fasta"){
exec "split -l ${LINE_NUM} -d -a 8 $input tmp_split/read.split_"
exec """
for file in tmp_split/read.split_*; do mv "$file" "${file}.fasta"; done
"""
}
}
consensus = {
doc title: "Consensus construction"
output.dir = "tmp_consensus"
transform (".fasta") to (".inc-seq.fa", ".inc-seq.log"){
exec "${SCRIPT}/inc-seq.py -i $input.fasta -o $output1 -a ${ALIGNER} --copy_num_thre 4 --length_difference_threshold 0.5 2> $output2", "main"
}
}
merge_fasta = {
doc title: "Merge fasta"
desc:"""
Merge all the consensus fasta files
"""
produce ("${PREFIX}.inc-seq.fasta",
"${PREFIX}.inc-seq.log"){
multi "cat tmp_consensus/*.inc-seq.fa > $output1",
"cat tmp_consensus/*.log > $output2"
}
}
run { "%.fa" * [set_global_var + split_fasta + "read.split_%" * [ consensus ] + merge_fasta ]}