-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmask_ref.nf
More file actions
89 lines (69 loc) · 1.84 KB
/
mask_ref.nf
File metadata and controls
89 lines (69 loc) · 1.84 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
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env nextflow
def helpMessage() {
log.info"""
=========================================
MMM Compass Compact
Generate Masked Reference
=========================================
Usage:
nextflow run mask_ref.nf --help
nextflow run mask_ref.nf --test -profile test_docker
nextflow run mask_ref.nf \
--output_dir tests/data/output_dir \
--ref tests/data/reference/NC_000962_2.fasta \
--mask true \
-profile test_docker
Mandatory arguments:
--ref FILE reference genome
Optional arguments:
--mask Boolean use self-blast to mask repeated region, default true
""".stripIndent()
}
params.help = false
params.test = false
params.mask = true
// Show help emssage
if (params.help){
helpMessage()
exit 0
}
if (params.test){
params.ref = "tests/data/reference/NC_000962_3.fasta"
params.output_dir = "tests/data/output_dir"
}else{
params.ref = ""
}
ref = file(params.ref)
ref_folder = ref.getParent()
ref_name = ref.getBaseName()
if (params.mask == true)
{
process generatemaskarray {
echo true
scratch true
publishDir "${params.output_dir}/ref_mask/${ref.getBaseName()}", mode: "copy" , pattern: "*"
tag {ref}
input:
file ref
output:
file("*") into mask_ref
"""
python ${COMPASS_ROOT}/nf_ref_index.py -r ${ref}
"""
}
}
else{
process generatenomaskarray {
echo true
scratch true
publishDir "${params.output_dir}/ref_mask/", mode: "copy"
tag {ref}
input:
file ref
output:
file("${ref_name}_repmask.array") into mask_ref
"""
python3 ${COMPASS_ROOT}/nf_ref_nomask.py -r ${ref}
"""
}
}