-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnextflow.config
More file actions
140 lines (126 loc) · 6.06 KB
/
Copy pathnextflow.config
File metadata and controls
140 lines (126 loc) · 6.06 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// ============================================================================
// phinder — phage finder for metagenomic assemblies
// ============================================================================
manifest {
name = 'phinder'
description = 'Phage finder for metagenomic assemblies (geNomad + CheckV + Pharokka + PhaBOX)'
author = 'Andrew Budge'
version = '0.2.0'
defaultBranch = 'main'
nextflowVersion = '>=23.04'
}
params {
// --- Input / output -----------------------------------------------------
input = null // required: combined contig FASTA (.fa/.fa.gz)
outdir = 'results'
// --- Resources ----------------------------------------------------------
// Two ways to size phinder:
// • Convenience (default): use a FRACTION of the detected machine — half
// the cores and RAM. Polite on shared boxes, safe on small ones. Tune
// with --cpu_fraction / --mem_fraction (1.0 = the whole machine).
// • Ultimate control: set an ABSOLUTE budget with --max_cpus (cores) and
// --max_memory (e.g. '64.GB'). When set, these override the fractions.
// If machine auto-detection is wrong, override --avail_cpus / --avail_mem.
// See the README "Performance & resources" section.
cpu_fraction = 0.5
mem_fraction = 0.5
avail_cpus = Runtime.runtime.availableProcessors()
avail_mem = java.lang.management.ManagementFactory.operatingSystemMXBean.totalMemorySize
max_cpus = null // exact core budget; overrides cpu_fraction when set
max_memory = null // exact memory budget, e.g. '64.GB'; overrides mem_fraction
// Effective budget the heavy tier gets: absolute override if given, else a
// fraction of the detected machine. (mem_budget is in bytes.)
cpu_budget = params.max_cpus ? (params.max_cpus as int) : Math.max(1, (params.avail_cpus * params.cpu_fraction) as int)
mem_budget = params.max_memory ? (params.max_memory as nextflow.util.MemoryUnit).toBytes() : (params.avail_mem * params.mem_fraction) as long
// --- Databases ----------------------------------------------------------
genomad_db = null // required
checkv_db = null // required
pharokka_db = null // required
phabox_db = null // required only if phabox2_env is set
// --- Conda env overrides (optional) -------------------------------------
// Point at existing named envs instead of letting Nextflow build new ones.
// Useful when tools have complex or non-standard installations.
genomad_env = null // e.g. ~/miniconda3/envs/genomad
checkv_env = null // e.g. ~/miniconda3/envs/checkv
pharokka_env = null // e.g. ~/miniconda3/envs/pharokka
phabox2_env = null // e.g. ~/miniconda3/envs/phabox2; if unset, PhaBOX steps are skipped
// --- geNomad ------------------------------------------------------------
genomad_splits = 20
// --- geNomad filter thresholds ------------------------------------------
// DTR topology is always kept regardless of virus_score (hallmark of
// complete linear phage genome). Provirus topology is kept only above
// this score.
min_provirus_score = 0.9
// --- CheckV filter thresholds -------------------------------------------
// Keep contigs with CheckV quality in this set, OR with DTR topology
// (DTR contigs under-score on completeness because they lack host flanking).
// Coverage below min_coverage is flagged but NOT dropped — annotation
// stages get the final call.
checkv_quality_keep = 'High-quality,Complete'
min_coverage = 3
// --- Pharokka -----------------------------------------------------------
pharokka_gene_predictor = 'prodigal-gv'
// --- PhaBOX -------------------------------------------------------------
// Skip Phamer (--skip Y) because sequences are already classified viral
// upstream by geNomad + CheckV.
phabox_skip_phamer = true
phabox_votu_mode = 'AAI' // protein-level; phages are too divergent for ANI
phabox_tree_markers = 'terl,portal'
}
profiles {
conda {
conda.enabled = true
}
mamba {
conda.enabled = true
conda.useMamba = true
}
docker {
docker.enabled = true
// Run as the host user so output files aren't owned by root.
docker.runOptions = '-u $(id -u):$(id -g)'
}
singularity {
singularity.enabled = true
singularity.autoMounts = true
}
apptainer {
apptainer.enabled = true
apptainer.autoMounts = true
}
slurm {
process.executor = 'slurm'
}
test {
// Minimal inputs to validate workflow wiring with `-stub-run`.
// The bundled FASTA is real; the db paths are placeholders that the
// stub blocks never read (no databases required).
params.input = "${projectDir}/test/test_contigs.fasta"
params.genomad_db = "${projectDir}/test"
params.checkv_db = "${projectDir}/test"
params.pharokka_db = "${projectDir}/test"
}
}
process {
// Budget = params.cpu_budget / params.mem_budget (absolute --max_* if set,
// else a fraction of the detected machine). No task may exceed it
// (resourceLimits); the heavy tier uses the whole budget, lighter tiers a
// share. With the default (half the machine) requests stay well under what's
// available, so a run never fails with "requirement exceeds available".
resourceLimits = [
cpus : params.cpu_budget,
memory: params.mem_budget as long
]
withLabel: process_low { // seqkit / R / sed glue — tiny
cpus = 1
memory = (params.mem_budget / 4) as long
}
withLabel: process_medium { // pharokka, phabox
cpus = Math.max(1, (params.cpu_budget / 2) as int)
memory = (params.mem_budget / 2) as long
}
withLabel: process_high { // genomad, checkv — the heavy lifters
cpus = params.cpu_budget
memory = params.mem_budget as long
}
}