-
Notifications
You must be signed in to change notification settings - Fork 23
/
.gitlab-ci.yml
253 lines (244 loc) · 14.4 KB
/
.gitlab-ci.yml
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# Include shared CI
include:
- project: "epi2melabs/ci-templates"
file: "wf-containers.yaml"
variables:
# Workflow inputs given to nextflow.
# The workflow should define `--out_dir`, the CI template sets this.
# Only common file inputs and option values need to be given here
# (not things such as -profile)
NF_BEFORE_SCRIPT: mkdir -p ${CI_PROJECT_NAME}/data/ && wget -q -O ${CI_PROJECT_NAME}/data/wf-metagenomics-demo.tar.gz https://ont-exd-int-s3-euwst1-epi2me-labs.s3.amazonaws.com/wf-metagenomics/wf-metagenomics-demo.tar.gz && tar -xzvf ${CI_PROJECT_NAME}/data/wf-metagenomics-demo.tar.gz -C ${CI_PROJECT_NAME}/data/
NF_WORKFLOW_OPTS: "--fastq ${CI_PROJECT_NAME}/data/wf-metagenomics-demo/test_data/ -executor.\\$$local.memory 16GB --database_set Standard-8"
NF_PROCESS_FILES: >
subworkflows/kraken_pipeline.nf
NF_IGNORE_PROCESSES: "rebatchFastq, output_kraken2_read_assignments"
CI_FLAVOUR: "new"
CWG_AWS_ENV_NAME: "stack"
PYTEST_CONTAINER_NAME: "wf-common"
PYTEST_CONTAINER_CONFIG_KEY: "common_sha"
## This test works with Standard-8 GB using a stored copy of Standard-8GB in S3.
aws-run:
variables:
NF_WORKFLOW_OPTS: "--fastq test_data/case01 --store_dir s3://$${XAWS_BUCKET}/${CI_PROJECT_NAME}/store --database_set Standard-8"
NF_IGNORE_PROCESSES: "rebatchFastq"
artifacts:
when: always
paths:
- ${CI_PROJECT_NAME}
- .nextflow.log
exclude: [] # give me everything pal
allow_failure: false
## This test avoids using the Standard-8GB. The use of this database is tested in aws-run
singularity-run:
variables:
NF_WORKFLOW_OPTS: "--fastq test_data/case01 --database_set ncbi_16s_18s"
NF_IGNORE_PROCESSES: "rebatchFastq"
## This test avoids using the Standard-8GB. The use of this database is tested in aws-run
macos-run:
variables:
NF_WORKFLOW_OPTS: "--fastq test_data/case01 --database_set ncbi_16s_18s"
NF_IGNORE_PROCESSES: "rebatchFastq"
docker-run:
# Remove this directive in downstream templates
tags:
- large_ram
# Define a 1D job matrix to inject a variable named MATRIX_NAME into
# the CI environment, we can use the value of MATRIX_NAME to determine
# which options to apply as part of the rules block below
# NOTE There is a slightly cleaner way to define this matrix to include
# the variables, but it is broken when using long strings! See CW-756
parallel:
matrix:
- MATRIX_NAME: [
"kraken2", "minimap2", "minimap2-sample-sheet",
"kraken2-baf", "minimap2-baf", "minimap2-filter",
"kraken2-amr", "minimap2-amr",
"minimap2-exclude-host", "kraken2-exclude-host", "minimap2-exclude-host-bam", "minimap2-exclude-host-empty-barcode",
"kraken2-bam", "minimap2-bam", "minimap2-igv",
"kraken2-real-time", "kraken2-real-time-bam", "amr-real-time",
"minimap2-split-prefix"
]
rules:
- if: ($CI_COMMIT_BRANCH == null || $CI_COMMIT_BRANCH == "dev-template")
when: never
# REGULAR TESTS
## Regular test kraken2
- if: $MATRIX_NAME == "kraken2"
variables:
NF_PROCESS_FILES: >
subworkflows/kraken_pipeline.nf
NF_WORKFLOW_OPTS: "--fastq test_data/case01 --include_read_assignments --abundance_threshold 1 -executor.\\$$local.memory 16GB --database_set ncbi_16s_18s"
NF_IGNORE_PROCESSES: ""
AFTER_NEXTFLOW_CMD: >
grep "Found empty file for sample 'barcode05'" .nextflow.log
# In wf-metagenomics, the wf runs indefinitely if there is no condition to stop it.
# With the read limit we can stop the wf if the limit is reached.
# It creates a STOP.fastq.gz that will be a new input in the wf and make it stop.
# Use the creation of this file to test if watch_path is able to detect new input files.
- if: $MATRIX_NAME == "kraken2-real-time"
variables:
NF_BEFORE_SCRIPT: "REAL_TIME_PORT=$$(shuf -i 8100-8900 -n 1)"
NF_PROCESS_FILES: >
subworkflows/real_time_pipeline.nf
NF_WORKFLOW_OPTS: "--fastq test_data/case01 --real_time --read_limit 3000 --include_read_assignments --batch_size 1000 -executor.\\$$local.memory 16GB --database_set ncbi_16s_18s --port $${REAL_TIME_PORT}"
NF_IGNORE_PROCESSES: ""
## Regular test minimap2 - mapping stats
- if: $MATRIX_NAME == "minimap2"
variables:
NF_PROCESS_FILES: >
subworkflows/minimap_pipeline.nf
lib/common.nf
modules/local/igv_related.nf
NF_WORKFLOW_OPTS: "--fastq test_data/case01 --classifier minimap2 --minimap2_by_reference --database_set ncbi_16s_18s --keep_bam --include_read_assignments"
NF_IGNORE_PROCESSES: "extractMinimap2Reads,configure_igv,filter_references"
# Minimap2 - sample sheet - taxonomic_rank - taxa barplot - abundance_threshold
- if: $MATRIX_NAME == "minimap2-sample-sheet"
variables:
NF_PROCESS_FILES: >
subworkflows/minimap_pipeline.nf
lib/common.nf
modules/local/igv_related.nf
NF_WORKFLOW_OPTS: "--fastq test_data/case02 --classifier minimap2 --database_set ncbi_16s_18s --sample_sheet test_data/case02/sample_sheet.csv --taxonomic_rank G --n_taxa_barplot 10 --abundance_threshold 0.01"
NF_IGNORE_PROCESSES: "extractMinimap2Reads,getAlignmentStats,configure_igv,filter_references"
# BACTERIA-ARCHAEA-EUKARYA
## Bacteria, Archaea, Fungi (BAF) with are supposed to be included in the default database: ncbi_16s_18s.
## It also works as a test for single file - kraken_confidence - include_read_assignments
- if: $MATRIX_NAME == "kraken2-baf"
variables:
NF_PROCESS_FILES: >
subworkflows/kraken_pipeline.nf
NF_WORKFLOW_OPTS: "--fastq test_data/case03_baf/reads_baf.fastq.gz --abundance_threshold 10 --include_read_assignments --sample bacteria_archaea_fungi --database_set ncbi_16s_18s"
NF_IGNORE_PROCESSES: "concatAssignments"
- if: $MATRIX_NAME == "minimap2-baf"
variables:
NF_PROCESS_FILES: >
subworkflows/minimap_pipeline.nf
lib/common.nf
modules/local/igv_related.nf
NF_WORKFLOW_OPTS: "--fastq test_data/case03_baf/reads_baf.fastq.gz --database_set ncbi_16s_18s --classifier minimap2 --keep_bam --minimap2_by_reference --abundance_threshold 10"
NF_IGNORE_PROCESSES: "extractMinimap2Reads,configure_igv,filter_references"
## Exclude Archaea and Eukaryota from extracted reads (remaining reads should be just from Bacteria).
- if: $MATRIX_NAME == "minimap2-filter"
variables:
NF_PROCESS_FILES: >
subworkflows/minimap_pipeline.nf
lib/common.nf
modules/local/igv_related.nf
NF_WORKFLOW_OPTS: "--fastq test_data/case03_baf/reads_baf.fastq.gz --classifier minimap2 --minimap2filter '2157,2759' --minimap2exclude --database_set ncbi_16s_18s --min_percent_identity 97 --min_ref_coverage 95"
NF_IGNORE_PROCESSES: "getAlignmentStats,configure_igv,filter_references"
# AMR TESTS
## AMR tests using isolate test data (need to find better tests)
- if: $MATRIX_NAME == "kraken2-amr"
variables:
NF_PROCESS_FILES: >
subworkflows/kraken_pipeline.nf
NF_WORKFLOW_OPTS: "--fastq s3://ont-exd-int-s3-euwst1-epi2me-labs/wf-bacterial-genomes/test_data/isolates_fastq/barcode08 --amr -executor.\\$$local.memory 16GB --database_set ncbi_16s_18s"
NF_IGNORE_PROCESSES: "output_kraken2_read_assignments"
- if: $MATRIX_NAME == "minimap2-amr"
variables:
NF_PROCESS_FILES: >
subworkflows/minimap_pipeline.nf
lib/common.nf
modules/local/igv_related.nf
NF_WORKFLOW_OPTS: "--fastq s3://ont-exd-int-s3-euwst1-epi2me-labs/wf-bacterial-genomes/test_data/isolates_fastq/barcode08 --classifier minimap2 --amr --database_set ncbi_16s_18s"
NF_IGNORE_PROCESSES: "extractMinimap2Reads,getAlignmentStats,configure_igv,filter_references"
# EXCLUDE HOST
- if: $MATRIX_NAME == "minimap2-exclude-host"
variables:
NF_PROCESS_FILES: >
subworkflows/minimap_pipeline.nf
lib/common.nf
modules/local/igv_related.nf
NF_WORKFLOW_OPTS: "--fastq test_data/case04_exclude_host/case04-1/samples --exclude_host test_data/case04_exclude_host/case04-1/host.fasta.gz --classifier minimap2 --database_set ncbi_16s_18s -executor.\\$$local.memory 16GB"
NF_IGNORE_PROCESSES: "extractMinimap2Reads,getAlignmentStats,configure_igv,filter_references"
AFTER_NEXTFLOW_CMD: >
grep "Found empty file after host depletion for sample: 'barcode02'." .nextflow.log
- if: $MATRIX_NAME == "minimap2-split-prefix"
variables:
NF_BEFORE_SCRIPT: "mkdir -p ${CI_PROJECT_NAME}/data/reference_host && wget -qO ${CI_PROJECT_NAME}/data/reference_host/cw_4388_human_vero.fna.gz ${EPI2ME_ARTIFACT_URL}/data/wf-metagenomics/cw_4388_human_vero.fna.gz && gzip -d ${CI_PROJECT_NAME}/data/reference_host/cw_4388_human_vero.fna.gz"
NF_PROCESS_FILES: >
subworkflows/minimap_pipeline.nf
lib/common.nf
modules/local/igv_related.nf
NF_WORKFLOW_OPTS: "--fastq test_data/case04_exclude_host/case04-2/ --exclude_host ${CI_PROJECT_NAME}/data/reference_host/cw_4388_human_vero.fna --classifier minimap2 --database_set ncbi_16s_18s -executor.\\$$local.memory 24GB"
NF_IGNORE_PROCESSES: "extractMinimap2Reads,getAlignmentStats,configure_igv,filter_references"
- if: $MATRIX_NAME == "minimap2-exclude-host-bam"
variables:
NF_PROCESS_FILES: >
subworkflows/minimap_pipeline.nf
lib/common.nf
modules/local/igv_related.nf
NF_WORKFLOW_OPTS: "--bam test_data/case04_exclude_host_bam/samples --exclude_host test_data/case04_exclude_host_bam/host.fasta.gz --classifier minimap2 --database_set ncbi_16s_18s -executor.\\$$local.memory 16GB"
NF_IGNORE_PROCESSES: "extractMinimap2Reads,getAlignmentStats,configure_igv,filter_references"
- if: $MATRIX_NAME == "kraken2-exclude-host"
variables:
NF_PROCESS_FILES: >
subworkflows/kraken_pipeline.nf
NF_WORKFLOW_OPTS: "--fastq test_data/case04_exclude_host/case04-1/samples --exclude_host test_data/case04_exclude_host/case04-1/host.fasta.gz --database_set ncbi_16s_18s -executor.\\$$local.memory 16GB"
NF_IGNORE_PROCESSES: "output_kraken2_read_assignments"
AFTER_NEXTFLOW_CMD: >
grep "Found empty file after host depletion for sample: 'barcode02'." .nextflow.log
# BAM INGRESS
# Compare counts with case01_no_duplicateIDs, must be the same
- if: $MATRIX_NAME == "kraken2-bam"
variables:
NF_PROCESS_FILES: >
subworkflows/kraken_pipeline.nf
NF_WORKFLOW_OPTS: "--bam test_data/case05_bam --include_read_assignments --abundance_threshold 1 --database_set ncbi_16s_18s"
NF_IGNORE_PROCESSES: ""
# In wf-metagenomics, the wf runs indefinitely if there is no condition to stop it.
# With the read limit we can stop the wf if the limit is reached.
# It creates a STOP.bam that will be a new input in the wf and make it stop.
# Use the creation of this file to test if watch_path is able to detect new input files.
- if: $MATRIX_NAME == "kraken2-real-time-bam"
variables:
NF_BEFORE_SCRIPT: "REAL_TIME_PORT=$$(shuf -i 8100-8900 -n 1)"
NF_PROCESS_FILES: >
subworkflows/real_time_pipeline.nf
NF_WORKFLOW_OPTS: "--bam test_data/case05_bam --real_time --read_limit 6000 -executor.\\$$local.memory 16GB --database_set ncbi_16s_18s --port $${REAL_TIME_PORT}"
NF_IGNORE_PROCESSES: "concatAssignments,rebatchFastq"
## Regular test minimap2 - mapping stats
- if: $MATRIX_NAME == "minimap2-bam"
variables:
NF_PROCESS_FILES: >
subworkflows/minimap_pipeline.nf
lib/common.nf
modules/local/igv_related.nf
NF_WORKFLOW_OPTS: "--bam test_data/case05_bam --classifier minimap2 --minimap2_by_reference --database_set ncbi_16s_18s"
NF_IGNORE_PROCESSES: "extractMinimap2Reads,configure_igv,filter_references"
## Test with IGV and also custom databases in minimap2
- if: $MATRIX_NAME == "minimap2-igv"
variables:
NF_BEFORE_SCRIPT: mkdir -p ${CI_PROJECT_NAME}/data/ && wget -q -O ${CI_PROJECT_NAME}/data/wf-metagenomics-demo.tar.gz https://ont-exd-int-s3-euwst1-epi2me-labs.s3.amazonaws.com/wf-metagenomics/wf-metagenomics-demo.tar.gz && tar -xzvf ${CI_PROJECT_NAME}/data/wf-metagenomics-demo.tar.gz -C ${CI_PROJECT_NAME}/data/
NF_PROCESS_FILES: >
subworkflows/minimap_pipeline.nf
lib/common.nf
modules/local/igv_related.nf
modules/local/databases.nf
NF_WORKFLOW_OPTS: >
--fastq "${CI_PROJECT_NAME}/data/wf-metagenomics-demo/test_data/"
-executor.\$$local.memory 16GB
--classifier minimap2
--minimap2_by_reference
--reference "${CI_PROJECT_NAME}/data/wf-metagenomics-demo/reference/genomes.fna.gz"
--ref2taxid "${CI_PROJECT_NAME}/data/wf-metagenomics-demo/reference/ref2taxid.tsv"
--igv
NF_IGNORE_PROCESSES: "extractMinimap2Reads,download_reference_ref2taxid,prepareSILVA,unpack_download_kraken2_database,determine_bracken_length"
## Test real time simulating new fq files on the fly
- if: $MATRIX_NAME == "amr-real-time"
variables:
# simulate_samples.sh create the samples on the fly
NF_BEFORE_SCRIPT: "mkdir -p ${CI_PROJECT_NAME}/data/ && bash util/simulate_sample.sh ${CI_PROJECT_NAME}/data/ test_data/case06_amr/reads.fq &> ${CI_PROJECT_NAME}/data/simulate_realtime.log &"
NF_PROCESS_FILES: >
subworkflows/real_time_pipeline.nf
lib/common.nf
modules/local/databases.nf
NF_WORKFLOW_OPTS: >
-c test_data/case06_amr/nextflow_custom.config
--fastq="$CI_PROJECT_NAME/data/test_data/"
-executor.\$$local.memory 16GB
--amr true
--real_time true
--database_set "ncbi_16s_18s"
--read_limit 10000
NF_IGNORE_PROCESSES: "concatAssignments,rebatchFastq,download_reference_ref2taxid,prepareSILVA,check_reference_ref2taxid,configure_igv"