Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add skip tools parameter for tool selection #68

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Initial release of nf-core/seqinspector, created with the [nf-core](https://nf-c

### `Added`

- [#68](https://github.com/nf-core/seqinspector/pull/68) Add tool selector
- [#20](https://github.com/nf-core/seqinspector/pull/20) Use tags to generate group reports
- [#13](https://github.com/nf-core/seqinspector/pull/13) Generate reports per run, per project and per lane.
- [#49](https://github.com/nf-core/seqinspector/pull/49) Merge with template 3.0.2.
Expand Down
6 changes: 6 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ Optionally, the `sample_size` parameter allows you to subset a random number of
nextflow run nf-core/seqinspector --input ./samplesheet.csv --outdir ./results --sample_size 1000000 -profile docker
```

### Skipping tools

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.

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) documentation for further details.
Aratz marked this conversation as resolved.
Show resolved Hide resolved

### Updating the pipeline

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:
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ params {
// Input options
input = null
sample_size = 0
skip_tools = ''
// References
genome = null
fasta = null
Expand Down
5 changes: 5 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
"type": "string",
"description": "MultiQC report title. Printed as page header, used for filename if not otherwise specified.",
"fa_icon": "fas fa-file-signature"
},
"skip_tools": {
"type": "string",
"description": "Comma-separated string of tools to skip",
"pattern": "^(fastqc|seqfu_stats)(,(fastqc|seqfu_stats))*$$"
Aratz marked this conversation as resolved.
Show resolved Hide resolved
}
}
},
Expand Down
23 changes: 23 additions & 0 deletions tests/MiSeq.main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,27 @@ nextflow_pipeline {
)
}
}

test("Miseq data test (skip fastqc)") {
when {
config "./MiSeq.main.nf.test.config"
params {
outdir = "$outputDir"
skip_tools = "fastqc"
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(
path("$outputDir/multiqc/global_report/multiqc_data/multiqc_citations.txt"),
).match()
},
{
assert !path("$outputDir/multiqc/global_report/multiqc_data/multiqc_fastqc.txt").exists()
}
)
}
}
}
10 changes: 10 additions & 0 deletions tests/MiSeq.main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,15 @@
"nextflow": "24.04.4"
},
"timestamp": "2024-10-30T09:08:29.692511055"
},
"Miseq data test (skip fastqc)": {
"content": [
"multiqc_citations.txt:md5,4c806e63a283ec1b7e78cdae3a923d4f"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.1"
},
"timestamp": "2024-11-22T13:31:45.958932"
}
}
29 changes: 17 additions & 12 deletions workflows/seqinspector.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ workflow SEQINSPECTOR {
take:
ch_samplesheet // channel: samplesheet read in from --input
main:
skip_tools = params.skip_tools ? params.skip_tools.split(',') : []

ch_versions = Channel.empty()
ch_multiqc_files = Channel.empty()
Expand All @@ -51,23 +52,27 @@ workflow SEQINSPECTOR {
//
// MODULE: Run FastQC
//
FASTQC (
ch_sample_sized.map {
meta, subsampled -> [meta, subsampled]
}
)
ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip)
ch_versions = ch_versions.mix(FASTQC.out.versions.first())
if (!("fastqc" in skip_tools)) {
FASTQC (
ch_sample_sized.map {
meta, subsampled -> [meta, subsampled]
}
)
ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip)
ch_versions = ch_versions.mix(FASTQC.out.versions.first())
}


//
// Module: Run SeqFu stats
//
SEQFU_STATS (
ch_samplesheet
)
ch_multiqc_files = ch_multiqc_files.mix(SEQFU_STATS.out.multiqc)
ch_versions = ch_versions.mix(SEQFU_STATS.out.versions.first())
if (!("seqfu_stats" in skip_tools)) {
SEQFU_STATS (
ch_samplesheet
)
ch_multiqc_files = ch_multiqc_files.mix(SEQFU_STATS.out.multiqc)
ch_versions = ch_versions.mix(SEQFU_STATS.out.versions.first())
}

//
// Collate and save software versions
Expand Down
Loading