Skip to content

Commit 299844a

Browse files
committed
add a test workflow
1 parent 2230caa commit 299844a

27 files changed

+2431
-3
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ jobs:
5151
run: make install
5252

5353
- name: Test
54-
run: nextflow run nf-bactopia-test/ -plugins nf-bactopia@0.1.0
54+
run: nextflow run nf-bactopia-test/ -plugins nf-bactopia@0.1.0 --help

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,18 @@ conda create -y -n nf-bactopia \
3131
conda activate nf-bactopia
3232
```
3333

34-
### Build the plugin
34+
### Build the plugin and install
3535

3636
```{bash}
3737
make assemble
38+
make install
3839
```
3940

4041
### Use the plugin
4142

43+
The `make install` should put the plugin in your `~/.nextflow/plugins` directory. So it should
44+
just work!
45+
4246
```{bash}
43-
NXF_VER=25.06.0-edge NXF_PLUGINS_DIR=/path/to/build/plugins nextflow run ...
47+
NXF_VER=25.06.0-edge nextflow run ...
4448
```

nf-bactopia-test/conf/base.config

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
process {
2+
// Defaults
3+
container = "bactopia/bactopia:${params.bactopia_version}"
4+
errorStrategy = 'retry'
5+
maxRetries = params.max_retry
6+
7+
// Resource Limits
8+
resourceLimits = [
9+
cpus: params.max_cpus,
10+
memory: params.max_memory,
11+
time: params.max_time
12+
]
13+
14+
// Resources
15+
cpus = { 1 * task.attempt }
16+
memory = { 4.GB * task.attempt }
17+
time = { 1.h * task.attempt }
18+
19+
// Modules imported from nf-core
20+
withLabel: process_single {
21+
cpus = { 1 }
22+
memory = { 4.GB * task.attempt }
23+
time = { 2.h * task.attempt }
24+
}
25+
withLabel: process_low {
26+
cpus = { 4 * task.attempt }
27+
memory = { 8.GB * task.attempt }
28+
time = { 4.h * task.attempt }
29+
}
30+
withLabel: process_medium {
31+
cpus = { 8 * task.attempt }
32+
memory = { 32.GB * task.attempt }
33+
time = { 12.h * task.attempt }
34+
}
35+
withLabel: process_high {
36+
cpus = { 12 * task.attempt }
37+
memory = { 64.GB * task.attempt }
38+
time = { 24.h * task.attempt }
39+
}
40+
withLabel: process_long {
41+
time = { 96.h * task.attempt }
42+
}
43+
withLabel: process_high_memory {
44+
memory = { 128.GB * task.attempt }
45+
}
46+
withLabel: error_ignore {
47+
errorStrategy = 'ignore'
48+
}
49+
withLabel: error_retry {
50+
errorStrategy = 'retry'
51+
maxRetries = 2
52+
}
53+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Used to set the output directory of modules
2+
params {
3+
publish_dir {
4+
annotate_genome = "annotation"
5+
antimicrobial_resistance = "antimicrobial-resistance"
6+
assemble_genome = "assembly"
7+
assembly_qc = "assembly"
8+
blast = "blast"
9+
call_variants = "variants"
10+
count_31mers = "minmers"
11+
12+
mapping_query = "mapping"
13+
minmer_query = "minmers"
14+
minmer_sketch = "minmers"
15+
qc_reads = "quality-control"
16+
sequence_type = "mlst"
17+
18+
// These produce *-error.txt that should go to the root
19+
gather_samples = ""
20+
}
21+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
This file includes default values for shared parameters.
3+
*/
4+
5+
params {
6+
wf = "bactopia"
7+
list_wfs = false
8+
bactopia = null
9+
outdir = params.bactopia ? params.bactopia : "bactopia"
10+
run_name = "${params.wf}"
11+
rundir = null
12+
skip_compression = false
13+
keep_all_files = false
14+
merge_folder = "merged-results"
15+
16+
//nf-core
17+
schema_ignore_params = 'rundir,mix_downloads,no_check_certificate,run_name,prokka_debug,is_ci,sourmash_url,mash_url,mlst_url,amrfinder_url,merge_folder,wf_has_subdir,build_all,use_mamba,empty_proteins,empty_tf,empty_adapters,empty_phix,help_all,include_tools,publish_dir,silent,test_data,test_data_dir,verbose,schema_inputs,empty_extra,empty_r2,empty_r1,workflows,available_workflows,is_subworkflow,enable_conda,force_rebuild,config_profile_url,config_profile_contact,config_profile_description,config_profile_name'
18+
schema_inputs = ['fastqs', 'r1,r2,se,sample,hybrid', 'r1,r2,sample', 'se,sample', 'assembly,sample', 'accessions', 'accession']
19+
20+
// Max Job Request Parameters
21+
max_retry = 3
22+
max_time = 240.h
23+
max_memory = 128.GB
24+
max_cpus = 4
25+
max_downloads = 3
26+
27+
// Nextflow Configuration Parameters
28+
/* Nextflow config files
29+
nfconfig - allows you to provide your own config file to Nextflow
30+
31+
What this means is you can adjust process rules such as max runtimes, cpu and
32+
memory usage, etc...
33+
34+
Most importantly, this means you can create a profile that allows you to better
35+
use Bactopia in your environment. This will allow you to create a profile
36+
for things such as Sun Grid Engine, SLURM, AWS, etc...
37+
38+
If you provide a config, its loaded after the default configs. So any changes
39+
to the defaults in your config will be reflected.
40+
41+
Links to Nextflow Docs:
42+
Nextflow Docs: https://www.nextflow.io/docs/latest/config.html#scope-process
43+
Nextflow Docs: https://www.nextflow.io/docs/latest/config.html#config-profiles
44+
Nextflow Executors: https://www.nextflow.io/docs/latest/executor.html
45+
*/
46+
nfconfig = null
47+
publish_dir_mode = 'copy'
48+
force = false
49+
cleanup_workdir = false
50+
51+
// Nextflow Profile Parameters
52+
condadir = "${params.bactopia_cache}/conda"
53+
singularity_cache = "${params.bactopia_cache}/singularity"
54+
singularity_pull_docker_container = false
55+
force_rebuild = false
56+
container_opts = ""
57+
registry = "quay.io"
58+
59+
// Generic Parameters
60+
help = null
61+
help_all = false
62+
sleep_time = 5
63+
validate_params = true
64+
65+
//nf-core
66+
monochrome_logs = false
67+
enable_conda = false
68+
show_hidden_params = false
69+
70+
// Parameters to ignore
71+
build_all = false
72+
include_tools = null
73+
verbose = null
74+
silent = null
75+
no_check_certificate = false
76+
77+
// Datasets Parameters
78+
datasets_cache = "${params.bactopia_cache}/datasets"
79+
amrfinder_url = "https://datasets.bactopia.com/datasets/v${params.bactopia_version}/amrfinderplus.tar.gz"
80+
mlst_url = "https://datasets.bactopia.com/datasets/v${params.bactopia_version}/mlst.tar.gz"
81+
mash_url = "https://datasets.bactopia.com/datasets/mash-refseq88.k21.msh.xz"
82+
sourmash_url = "https://datasets.bactopia.com/datasets/gtdb-rs207.genomic-reps.dna.k31.lca.json.gz"
83+
84+
// Testing
85+
test_data_dir = 'https://raw.githubusercontent.com/bactopia/bactopia-tests/main/data'
86+
is_ci = false
87+
88+
// Config options
89+
config_profile_name = null
90+
config_profile_description = null
91+
custom_config_version = 'master'
92+
custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}"
93+
config_profile_contact = null
94+
config_profile_url = null
95+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
This file includes default values for shared parameters.
3+
*/
4+
5+
params {
6+
is_subworkflow = true
7+
8+
// Bactopia Tools
9+
include = null
10+
exclude = null
11+
12+
// Mix downloads with local samples
13+
mix_downloads = true
14+
}
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
profiles {
2+
standard {
3+
conda.enabled = true
4+
conda.cacheDir = "${params.condadir}"
5+
conda.channels = ['conda-forge', 'bioconda']
6+
7+
// disable alternative executors
8+
apptainer.enabled = false
9+
charliecloud.enabled = false
10+
docker.enabled = false
11+
podman.enabled = false
12+
shifter.enabled = false
13+
singularity.enabled = false
14+
}
15+
16+
conda {
17+
conda.enabled = true
18+
conda.cacheDir = "${params.condadir}"
19+
conda.channels = ['conda-forge', 'bioconda']
20+
21+
// disable alternative executors
22+
apptainer.enabled = false
23+
charliecloud.enabled = false
24+
docker.enabled = false
25+
podman.enabled = false
26+
shifter.enabled = false
27+
singularity.enabled = false
28+
}
29+
30+
mamba {
31+
conda.enabled = true
32+
conda.useMamba = true
33+
conda.cacheDir = "${params.condadir}"
34+
conda.channels = ['conda-forge', 'bioconda']
35+
36+
// disable alternative executors
37+
apptainer.enabled = false
38+
charliecloud.enabled = false
39+
docker.enabled = false
40+
podman.enabled = false
41+
shifter.enabled = false
42+
singularity.enabled = false
43+
}
44+
45+
apptainer {
46+
apptainer.enabled = true
47+
apptainer.autoMounts = true
48+
apptainer.cacheDir = "${params.singularity_cache}"
49+
apptainer.registry = params.registry ?: 'quay.io'
50+
apptainer.runOptions = "${params.container_opts}"
51+
52+
// disable alternative executors
53+
charliecloud.enabled = false
54+
conda.enabled = false
55+
docker.enabled = false
56+
podman.enabled = false
57+
singularity.enabled = false
58+
shifter.enabled = false
59+
}
60+
61+
charliecloud {
62+
charliecloud.enabled = true
63+
charliecloud.registry = params.registry ?: 'quay.io'
64+
65+
// disable alternative executors
66+
apptainer.enabled = false
67+
conda.enabled = false
68+
docker.enabled = false
69+
podman.enabled = false
70+
shifter.enabled = false
71+
singularity.enabled = false
72+
}
73+
74+
docker {
75+
docker.enabled = true
76+
docker.registry = params.registry ?: 'quay.io'
77+
docker.runOptions = '-u $(id -u):$(id -g) -v ${HOME}/.cache:/.cache -v ${HOME}/.config:/.config -v ${PWD}:/.medaka'
78+
79+
// disable alternative executors
80+
apptainer.enabled = false
81+
charliecloud.enabled = false
82+
conda.enabled = false
83+
podman.enabled = false
84+
singularity.enabled = false
85+
shifter.enabled = false
86+
}
87+
88+
arm {
89+
docker.enabled = true
90+
docker.registry = params.registry ?: 'quay.io'
91+
docker.runOptions = '-u $(id -u):$(id -g) -v ${HOME}/.cache:/.cache -v ${HOME}/.config:/.config -v ${PWD}:/.medaka --platform=linux/amd64'
92+
93+
// disable alternative executors
94+
apptainer.enabled = false
95+
charliecloud.enabled = false
96+
conda.enabled = false
97+
podman.enabled = false
98+
singularity.enabled = false
99+
shifter.enabled = false
100+
}
101+
102+
gitpod {
103+
executor.name = 'local'
104+
executor.cpus = 4
105+
executor.memory = 8.GB
106+
}
107+
108+
podman {
109+
podman.enabled = true
110+
podman.registry = params.registry ?: 'quay.io'
111+
112+
// disable alternative executors
113+
apptainer.enabled = false
114+
charliecloud.enabled = false
115+
conda.enabled = false
116+
docker.enabled = false
117+
shifter.enabled = false
118+
singularity.enabled = false
119+
}
120+
121+
shifter {
122+
shifter.enabled = true
123+
124+
// disable alternative executors
125+
apptainer.enabled = false
126+
conda.enabled = false
127+
docker.enabled = false
128+
podman.enabled = false
129+
charliecloud.enabled = false
130+
singularity.enabled = false
131+
}
132+
133+
singularity {
134+
singularity.enabled = true
135+
singularity.autoMounts = true
136+
singularity.cacheDir = "${params.singularity_cache}"
137+
singularity.registry = params.registry ?: 'quay.io'
138+
singularity.runOptions = "${params.container_opts}"
139+
140+
// disable alternative executors
141+
apptainer.enabled = false
142+
charliecloud.enabled = false
143+
conda.enabled = false
144+
docker.enabled = false
145+
podman.enabled = false
146+
shifter.enabled = false
147+
}
148+
149+
wave {
150+
apptainer.ociAutoPull = true
151+
singularity.ociAutoPull = true
152+
wave.enabled = true
153+
wave.freeze = true
154+
wave.strategy = 'conda,container'
155+
}
156+
157+
test { includeConfig './test.config' }
158+
}

0 commit comments

Comments
 (0)