Skip to content

Commit ec9570d

Browse files
authored
Merge pull request #68 from Aratz/tool_selector
Add skip tools parameter for tool selection
2 parents 4ed43fb + ad6a2c4 commit ec9570d

File tree

7 files changed

+85
-32
lines changed

7 files changed

+85
-32
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Initial release of nf-core/seqinspector, created with the [nf-core](https://nf-c
99

1010
### `Added`
1111

12+
- [#68](https://github.com/nf-core/seqinspector/pull/68) Add tool selector
1213
- [#20](https://github.com/nf-core/seqinspector/pull/20) Use tags to generate group reports
1314
- [#13](https://github.com/nf-core/seqinspector/pull/13) Generate reports per run, per project and per lane.
1415
- [#49](https://github.com/nf-core/seqinspector/pull/49) Merge with template 3.0.2.

docs/usage.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ Optionally, the `sample_size` parameter allows you to subset a random number of
9898
nextflow run nf-core/seqinspector --input ./samplesheet.csv --outdir ./results --sample_size 1000000 -profile docker
9999
```
100100

101+
### Skipping tools
102+
103+
Some tools might not be compatible with your data. In this case it might be desired to skip some of them. This can be done easily by providing a comma-separated list of tools to be skipped with the `--skip_tools` parameter.
104+
105+
In case you want to make this more permanent, it is recommended to specify this in a params file, or even in your own nextflow configuration file. The nextflow configuration file can also be use to customise tool arguments. See official [nexflow](https://www.nextflow.io/docs/latest/config.html) and [nf-core](https://nf-co.re/docs/usage/configuration#customising-tool-arguments) documentation for further details.
106+
101107
### Updating the pipeline
102108

103109
When you run the above command, Nextflow automatically pulls the pipeline code from GitHub and stores it as a cached version. When running the pipeline after this, it will always use the cached version if available - even if the pipeline has been updated since. To make sure that you're running the latest version of the pipeline, make sure that you regularly update the cached version of the pipeline:

nextflow.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ params {
1313
// Input options
1414
input = null
1515
sample_size = 0
16+
skip_tools = ''
1617
// References
1718
genome = null
1819
fasta = null

nextflow_schema.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
},
2626
"sample_size": {
2727
"type": "integer",
28-
"default": 0,
2928
"description": "Take this number of reads as a subset.",
30-
"help_text": "Choose the size of the subset or 0, if no subsampling shall be performed. Note that it refers to an absolute number."
29+
"help_text": "Choose the size of the subset or 0, if no subsampling shall be performed. Note that it refers to an absolute number.",
30+
"default": 0
3131
},
3232
"outdir": {
3333
"type": "string",
@@ -47,6 +47,11 @@
4747
"type": "string",
4848
"description": "MultiQC report title. Printed as page header, used for filename if not otherwise specified.",
4949
"fa_icon": "fas fa-file-signature"
50+
},
51+
"skip_tools": {
52+
"type": "string",
53+
"description": "Comma-separated string of tools to skip",
54+
"pattern": "^((fastqc|fastqscreen|seqfu_stats|seqtk_sample)?,?)*(?<!,)$"
5055
}
5156
}
5257
},

tests/MiSeq.main.nf.test

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,27 @@ nextflow_pipeline {
2727
)
2828
}
2929
}
30+
31+
test("Miseq data test (skip fastqc)") {
32+
when {
33+
config "./MiSeq.main.nf.test.config"
34+
params {
35+
outdir = "$outputDir"
36+
skip_tools = "fastqc"
37+
}
38+
}
39+
40+
then {
41+
assertAll(
42+
{ assert workflow.success },
43+
{ assert snapshot(
44+
path("$outputDir/multiqc/global_report/multiqc_data/multiqc_citations.txt"),
45+
).match()
46+
},
47+
{
48+
assert !path("$outputDir/multiqc/global_report/multiqc_data/multiqc_fastqc.txt").exists()
49+
}
50+
)
51+
}
52+
}
3053
}

tests/MiSeq.main.nf.test.snap

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010
"nf-test": "0.9.0",
1111
"nextflow": "24.10.2"
1212
},
13-
"timestamp": "2024-12-05T15:15:09.227024034"
13+
"timestamp": "2024-12-13T16:10:21.816261"
14+
},
15+
"Miseq data test (skip fastqc)": {
16+
"content": [
17+
"multiqc_citations.txt:md5,5f52d7a0141e4234c6069df9ef575c9a"
18+
],
19+
"meta": {
20+
"nf-test": "0.9.0",
21+
"nextflow": "24.10.2"
22+
},
23+
"timestamp": "2024-12-13T16:10:53.718831"
1424
}
1525
}

workflows/seqinspector.nf

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ workflow SEQINSPECTOR {
3131
ch_samplesheet // channel: samplesheet read in from --input
3232

3333
main:
34+
skip_tools = params.skip_tools ? params.skip_tools.split(',') : []
3435

3536
ch_versions = Channel.empty()
3637
ch_multiqc_files = Channel.empty()
@@ -40,38 +41,42 @@ workflow SEQINSPECTOR {
4041
//
4142
// MODULE: Run Seqtk sample to perform subsampling
4243
//
43-
if (params.sample_size > 0 ) {
44+
if (!("seqtk_sample" in skip_tools) && params.sample_size > 0) {
4445
ch_sample_sized = SEQTK_SAMPLE(
4546
ch_samplesheet.map {
4647
meta, reads -> [meta, reads, params.sample_size]
4748
}
4849
).reads
4950
ch_versions = ch_versions.mix(SEQTK_SAMPLE.out.versions.first())
5051
} else {
51-
// No do subsample
52+
// No subsampling
5253
ch_sample_sized = ch_samplesheet
5354
}
5455

5556
//
5657
// MODULE: Run FastQC
5758
//
58-
FASTQC (
59-
ch_sample_sized.map {
60-
meta, subsampled -> [meta, subsampled]
61-
}
62-
)
63-
ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip)
64-
ch_versions = ch_versions.mix(FASTQC.out.versions.first())
59+
if (!("fastqc" in skip_tools)) {
60+
FASTQC (
61+
ch_sample_sized.map {
62+
meta, subsampled -> [meta, subsampled]
63+
}
64+
)
65+
ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip)
66+
ch_versions = ch_versions.mix(FASTQC.out.versions.first())
67+
}
6568

6669

6770
//
6871
// Module: Run SeqFu stats
6972
//
70-
SEQFU_STATS (
71-
ch_samplesheet
72-
)
73-
ch_multiqc_files = ch_multiqc_files.mix(SEQFU_STATS.out.multiqc)
74-
ch_versions = ch_versions.mix(SEQFU_STATS.out.versions.first())
73+
if (!("seqfu_stats" in skip_tools)) {
74+
SEQFU_STATS (
75+
ch_samplesheet
76+
)
77+
ch_multiqc_files = ch_multiqc_files.mix(SEQFU_STATS.out.multiqc)
78+
ch_versions = ch_versions.mix(SEQFU_STATS.out.versions.first())
79+
}
7580

7681
//
7782
// MODULE: Run FastQ Screen
@@ -80,21 +85,23 @@ workflow SEQINSPECTOR {
8085
// Parse the reference info needed to create a FastQ Screen config file
8186
// and transpose it into a tuple containing lists for each property
8287

83-
ch_fastqscreen_refs = Channel
84-
.fromList(samplesheetToList(
85-
"${projectDir}/assets/example_fastq_screen_references.csv",
86-
"${projectDir}/assets/schema_fastq_screen_references.json"
87-
))
88-
.toList()
89-
.transpose()
90-
.toList()
91-
92-
FASTQSCREEN_FASTQSCREEN (
93-
ch_samplesheet,
94-
ch_fastqscreen_refs
95-
)
96-
ch_multiqc_files = ch_multiqc_files.mix(FASTQSCREEN_FASTQSCREEN.out.txt)
97-
ch_versions = ch_versions.mix(FASTQSCREEN_FASTQSCREEN.out.versions.first())
88+
if (!("fastqscreen" in skip_tools)) {
89+
ch_fastqscreen_refs = Channel
90+
.fromList(samplesheetToList(
91+
"${projectDir}/assets/example_fastq_screen_references.csv",
92+
"${projectDir}/assets/schema_fastq_screen_references.json"
93+
))
94+
.toList()
95+
.transpose()
96+
.toList()
97+
98+
FASTQSCREEN_FASTQSCREEN (
99+
ch_samplesheet,
100+
ch_fastqscreen_refs
101+
)
102+
ch_multiqc_files = ch_multiqc_files.mix(FASTQSCREEN_FASTQSCREEN.out.txt)
103+
ch_versions = ch_versions.mix(FASTQSCREEN_FASTQSCREEN.out.versions.first())
104+
}
98105

99106
//
100107
// Collate and save software versions

0 commit comments

Comments
 (0)