diff --git a/.gitignore b/.gitignore index c954c79..083c527 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,8 @@ testing* venv/ params*.json sample_manifest* +*.log +tests/sample-data/* +tests/ref/* +!**/.gitkeep +.nf-test/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 494408e..8020507 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,4 +55,9 @@ Initial release of QUANTS, created with the [nf-core](https://nf-co.re/) templat * Ability to extract top 50 library-independent counts as FASTA ## 3.0.0.3 - [24th January 2024] -* Hotfix to force COLLATE_CUTADAPT_JSONS to run on 1 cpu \ No newline at end of file +* Hotfix to force COLLATE_CUTADAPT_JSONS to run on 1 cpu + +## 3.0.0.4 - [7th November 2024] + +* Replace containers which use licensed conda packages +* Remove galaxy depot diff --git a/modules.json b/modules.json index f853343..d996c86 100644 --- a/modules.json +++ b/modules.json @@ -7,14 +7,14 @@ "nf-core": { "fastqc": { "branch": "master", - "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d", + "git_sha": "dc94b6ee04a05ddb9f7ae050712ff30a13149164", "installed_by": [ "modules" ] }, "multiqc": { "branch": "master", - "git_sha": "e937c7950af70930d1f34bb961403d9d2aa81c7d", + "git_sha": "cf17ca47590cc578dfb47db1c2a44ef86f89976d", "installed_by": [ "modules" ] @@ -23,4 +23,4 @@ } } } -} +} \ No newline at end of file diff --git a/modules/local/crispresso2/functions.nf b/modules/local/crispresso2/functions.nf deleted file mode 100644 index da9da09..0000000 --- a/modules/local/crispresso2/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// Utility functions used in nf-core DSL2 module files -// - -// -// Extract name of software tool from process name using $task.process -// -def getSoftwareName(task_process) { - return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() -} - -// -// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules -// -def initOptions(Map args) { - def Map options = [:] - options.args = args.args ?: '' - options.args2 = args.args2 ?: '' - options.args3 = args.args3 ?: '' - options.publish_by_meta = args.publish_by_meta ?: [] - options.publish_dir = args.publish_dir ?: '' - options.publish_files = args.publish_files - options.suffix = args.suffix ?: '' - return options -} - -// -// Tidy up and join elements of a list to return a path string -// -def getPathFromList(path_list) { - def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries - paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes - return paths.join('/') -} - -// -// Function to save/publish module results -// -def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } - } -} diff --git a/modules/local/crispresso2/main.nf b/modules/local/crispresso2/main.nf deleted file mode 100644 index 17b0886..0000000 --- a/modules/local/crispresso2/main.nf +++ /dev/null @@ -1,41 +0,0 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -process CRISPRESSO2 { - tag "$meta.id" - label 'process_medium' - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } conda (params.enable_conda ? "bioconda::crispresso2=2.1.2" : null) - - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/crispresso2:2.1.2--py27heb79e2c_0" - } else { - container "quay.io/biocontainers/crispresso2:2.1.2--py27heb79e2c_0" - } - - input: - tuple val(meta), path(reads) - - output: - tuple val(meta), path("*.merged.*.fastq.gz"), emit: reads - path "*.hist" , emit: hist - path "*.version.txt" , emit: version - - script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - def merged = "-o ${prefix}.merged" - def input_reads = "${reads[0]} ${reads[1]}" - """ - flash2 \\ - $options.args \\ - $merged \\ - -z \\ - $input_reads - echo \$(flash2 --version) > ${software}.version.txt - """ -} diff --git a/modules/local/crispresso2/meta.yml b/modules/local/crispresso2/meta.yml deleted file mode 100644 index 9cf242e..0000000 --- a/modules/local/crispresso2/meta.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: flash2 -description: Perform merging of mate paired-end sequencing reads -keywords: - - sort - - reads merging - - merge mate pairs -tools: - - flash2: - description: | - Merge mates from fragments that are shorter than twice the read length - homepage: https://github.com/dstreett/FLASH2 - documentation: {} - doi: 10.1093/bioinformatics/btr507 - licence: ['GPL v3+'] - -input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - reads: - type: file - description: | - List of input FastQ files of size 2; i.e., paired-end data. - pattern: "*fastq.gz" - -output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - reads: - type: file - description: The merged fastq reads - pattern: "*fastq.gz" - - histogram: - type: file - description: Numeric histogram of merged read lengths - pattern: "*.hist" - - version: - type: file - description: File containing software version - pattern: "*.{version.txt}" - -authors: - - "@Erkison" - - "@vaofford" diff --git a/modules/local/cutadapt/main.nf b/modules/local/cutadapt/main.nf index 0afe801..1c7bda9 100644 --- a/modules/local/cutadapt/main.nf +++ b/modules/local/cutadapt/main.nf @@ -12,11 +12,8 @@ process CUTADAPT { saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } conda (params.enable_conda ? 'bioconda::cutadapt=4.4' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/cutadapt:4.4--py39hf95cd2a_1' - } else { - container 'quay.io/biocontainers/cutadapt:4.4--py39hf95cd2a_1' - } + container 'quay.io/biocontainers/cutadapt:4.4--py39hf95cd2a_1' + input: tuple val(meta), path(reads) diff --git a/modules/local/flash2/main.nf b/modules/local/flash2/main.nf index 815d9f0..03e074f 100644 --- a/modules/local/flash2/main.nf +++ b/modules/local/flash2/main.nf @@ -11,11 +11,7 @@ process FLASH2 { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } conda (params.enable_conda ? "bioconda::flash=2.2.00" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/flash2:2.2.00--h5bf99c6_3" - } else { - container "quay.io/biocontainers/flash2:2.2.00--h5bf99c6_3" - } + container "quay.io/biocontainers/flash2:2.2.00--h5bf99c6_3" input: tuple val(meta), path(reads) diff --git a/modules/local/get_software_versions.nf b/modules/local/get_software_versions.nf index a9681bc..0746683 100644 --- a/modules/local/get_software_versions.nf +++ b/modules/local/get_software_versions.nf @@ -9,11 +9,7 @@ process GET_SOFTWARE_VERSIONS { saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'pipeline_info', meta:[:], publish_by_meta:[]) } conda (params.enable_conda ? "conda-forge::python=3.8.3" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/python:3.8.3" - } else { - container "quay.io/biocontainers/python:3.8.3" - } + container "quay.io/biocontainers/python:3.8.3" cache false diff --git a/modules/local/pyquest/main.nf b/modules/local/pyquest/main.nf index bbb78c8..c468fa5 100644 --- a/modules/local/pyquest/main.nf +++ b/modules/local/pyquest/main.nf @@ -12,11 +12,7 @@ process PYQUEST { // Keep for when container is public /* - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/flash2:2.2.00--h5bf99c6_3" - } else { - container "quay.io/biocontainers/flash2:2.2.00--h5bf99c6_3" - } + container "quay.io/biocontainers/flash2:2.2.00--h5bf99c6_3" */ container "quay.io/wtsicgp/pyquest:1.1.0" diff --git a/modules/local/pyquest_library_converter/main.nf b/modules/local/pyquest_library_converter/main.nf index 293f98c..1af66d5 100644 --- a/modules/local/pyquest_library_converter/main.nf +++ b/modules/local/pyquest_library_converter/main.nf @@ -10,12 +10,8 @@ process TRANSFORM_LIBRARY_FOR_PYQUEST { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'pyquest', meta:meta, publish_by_meta:['id']) } conda (params.enable_conda ? null : null) - conda (params.enable_conda ? "conda-forge::python=3.8.3" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/python:3.8.3" - } else { - container "quay.io/biocontainers/python:3.8.3" - } + conda (params.enable_conda ? "conda-forge::python=3.12.7" : null) + container "docker.io/python:3.12.7" input: path(oligo_library) diff --git a/modules/local/read_modification/main.nf b/modules/local/read_modification/main.nf index fd6717f..3bcccce 100644 --- a/modules/local/read_modification/main.nf +++ b/modules/local/read_modification/main.nf @@ -20,17 +20,27 @@ process APPEND_STRINGS_TO_FQ { script: def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def input = reads def append_start = params.append_start ? params.append_start : "" def append_end = params.append_end ? params.append_end : "" def append_quality_start = params.append_start ? params.append_quality*append_start.length() : "" def append_quality_end = params.append_end ? params.append_quality*append_end.length() : "" def output = "${prefix}.modified.fq.gz" + """ + zcat ${input} | awk -v append_start="${append_start}" -v append_end="${append_end}" -v append_quality_start="${append_quality_start}" -v append_quality_end="${append_quality_end}" ' + NR % 4 == 2 { print append_start \$0 append_end; next } + NR % 4 == 0 { print append_quality_start \$0 append_quality_end; next } + { print \$0 } + ' | gzip > ${output} + """ - $/ - zcat ${input} | \ - sed -e '2~4s/^\(.*\)$/${append_start}\1${append_end}/' -e '4~4s/^\(.*\)$/${append_quality_start}\1${append_quality_end}/' | \ - gzip > ${output} - /$ + + // "zcat ${input} | sed -e '2~4s/^\(.*\)$/${append_start}\1${append_end}/' -e '4~4s/^\(.*\)$/${append_quality_start}\1${append_quality_end}/' | gzip > ${output}' + + // $/ + // zcat ${input} | \ + // sed -e '2~4s/^\(.*\)$/${append_start}\1${append_end}/' -e '4~4s/^\(.*\)$/${append_quality_start}\1${append_quality_end}/' | \ + // gzip > ${output} + // /$ } diff --git a/modules/local/samplesheet_check.nf b/modules/local/samplesheet_check.nf index f1af3cd..662e283 100644 --- a/modules/local/samplesheet_check.nf +++ b/modules/local/samplesheet_check.nf @@ -10,11 +10,7 @@ process SAMPLESHEET_CHECK_FASTQ { saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'pipeline_info', meta:[:], publish_by_meta:[]) } conda (params.enable_conda ? "conda-forge::python=3.8.3" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/python:3.8.3" - } else { - container "quay.io/biocontainers/python:3.8.3" - } + container "quay.io/biocontainers/python:3.8.3" input: path samplesheet @@ -37,11 +33,7 @@ process SAMPLESHEET_CHECK_CRAM { saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'pipeline_info', meta:[:], publish_by_meta:[]) } conda (params.enable_conda ? "conda-forge::python=3.8.3" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/python:3.8.3" - } else { - container "quay.io/biocontainers/python:3.8.3" - } + container "quay.io/biocontainers/python:3.8.3" input: path samplesheet diff --git a/modules/local/samtools/bam2fq/main.nf b/modules/local/samtools/bam2fq/main.nf index 80495b1..51380da 100644 --- a/modules/local/samtools/bam2fq/main.nf +++ b/modules/local/samtools/bam2fq/main.nf @@ -3,9 +3,7 @@ process SAMTOOLS_BAM2FQ { label 'process_low' conda (params.enable_conda ? "bioconda::samtools=1.15" : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : - 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" + container 'quay.io/biocontainers/samtools:1.15--h1170115_1' input: tuple val(meta), path(inputbam) diff --git a/modules/local/seqkit_seq/main.nf b/modules/local/seqkit_seq/main.nf index 5e62142..9616e26 100644 --- a/modules/local/seqkit_seq/main.nf +++ b/modules/local/seqkit_seq/main.nf @@ -13,12 +13,7 @@ process SEQKIT_SEQ { saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process)+'_seq', meta:meta, publish_by_meta:['id']) } conda (params.enable_conda ? "bioconda::seqkit=0.15.0" : null) - - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/seqkit:0.15.0--0" - } else { - container "quay.io/biocontainers/seqkit:0.15.0--0" - } + container "quay.io/biocontainers/seqkit:0.15.0--0" input: tuple val(meta), path(reads) diff --git a/modules/local/seqkit_stats/main.nf b/modules/local/seqkit_stats/main.nf index f6423ea..8b2ef1f 100644 --- a/modules/local/seqkit_stats/main.nf +++ b/modules/local/seqkit_stats/main.nf @@ -13,12 +13,7 @@ process SEQKIT_STATS { saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process)+'_stats', meta:meta, publish_by_meta:['id']) } conda (params.enable_conda ? "bioconda::seqkit=0.15.0" : null) - - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/seqkit:0.15.0--0" - } else { - container "quay.io/biocontainers/seqkit:0.15.0--0" - } + container "quay.io/biocontainers/seqkit:0.15.0--0" input: tuple val(meta), path(reads) diff --git a/modules/local/seqprep/adapter_trimming/main.nf b/modules/local/seqprep/adapter_trimming/main.nf index 5818496..4c09ed1 100644 --- a/modules/local/seqprep/adapter_trimming/main.nf +++ b/modules/local/seqprep/adapter_trimming/main.nf @@ -11,11 +11,7 @@ process SEQPREP { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } conda (params.enable_conda ? "bioconda::seqprep=1.3.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/seqprep:1.3.2--h5bf99c6_5" - } else { - container "quay.io/biocontainers/seqprep:1.3.2--h5bf99c6_5" - } + container "quay.io/biocontainers/seqprep:1.3.2--h5bf99c6_5" input: tuple val(meta), path(reads) diff --git a/modules/local/seqprep/read_merging/main.nf b/modules/local/seqprep/read_merging/main.nf index 964f2fa..c258d96 100644 --- a/modules/local/seqprep/read_merging/main.nf +++ b/modules/local/seqprep/read_merging/main.nf @@ -11,11 +11,7 @@ process SEQPREP { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } conda (params.enable_conda ? "bioconda::seqprep=1.3.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/seqprep:1.3.2--h5bf99c6_5" - } else { - container "quay.io/biocontainers/seqprep:1.3.2--h5bf99c6_5" - } + container "quay.io/biocontainers/seqprep:1.3.2--h5bf99c6_5" input: tuple val(meta), path(reads) diff --git a/modules/nf-core/fastqc/main.nf b/modules/nf-core/fastqc/main.nf index 39c327b..2e8b086 100644 --- a/modules/nf-core/fastqc/main.nf +++ b/modules/nf-core/fastqc/main.nf @@ -11,13 +11,8 @@ process FASTQC { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } - conda (params.enable_conda ? "bioconda::fastqc=0.11.9" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0" - } else { - container "quay.io/biocontainers/fastqc:0.11.9--0" - } - + // conda (params.enable_conda ? "bioconda::fastqc=0.11.9" : null) + container "quay.io/biocontainers/fastqc:0.11.9--0" // conda safe input: tuple val(meta), path(reads) diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index ddd3388..f5a77de 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -10,12 +10,8 @@ process MULTIQC { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:[:], publish_by_meta:[]) } - conda (params.enable_conda ? "bioconda::multiqc=1.14" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/multiqc:1.14--pyhdfd78af_0" - } else { - container "quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0" - } + // conda (params.enable_conda ? "bioconda::multiqc=1.14" : null) + container "quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0" // conda safe input: path multiqc_files diff --git a/nextflow.config b/nextflow.config index 1579aa2..c118dfb 100644 --- a/nextflow.config +++ b/nextflow.config @@ -190,7 +190,7 @@ manifest { description = 'Analysis pipeline for saturation genome editing screens' mainScript = 'main.nf' nextflowVersion = '!>=21.10.6' - version = '3.0.0.3' + version = '3.0.0.4' } // Function to ensure that resource requirements don't go beyond diff --git a/nf-test.config b/nf-test.config new file mode 100644 index 0000000..d52935c --- /dev/null +++ b/nf-test.config @@ -0,0 +1,8 @@ +config { + + testsDir "tests" + workDir System.getenv("NFT_WORKDIR") ?: ".nf-test" + configFile "tests/nextflow.config" + profile "singularity" + +} diff --git a/tests/TESTS.md b/tests/TESTS.md new file mode 100644 index 0000000..1674e3e --- /dev/null +++ b/tests/TESTS.md @@ -0,0 +1,24 @@ +# Test datasets and files + +end-to-end tests for the quants pipeline using the nf-test framework. + +Having retrieved data and placed it in the ref and sample-data folders, tests can be run with `nf-test test tests/test[#].main.nf.test` + +To confirm that you've retrieved the correct data, and named it appropriately if necessary, run `diff -q <(md5sum tests/sample-data/*) tests/sample-data-checksums` and `diff -q <(md5sum tests/ref/*) tests/ref-checksums`. If the commands return nothing (exit code 0), the data is as expected. Note that if you do not run this command from the top level directory of the repo, it will fail, as md5sum will output relative paths along with checksums. + +## Test parameters + +| Test | Source | FASTQ or CRAM | SE or PE| RevComp | Read merging | Adapter trimming | Primer Trimming | Read filtering | Read modification | QC | Quantification | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | +| `test1.main.nf.test` | Trimmed | FASTQ | SE | Y | N | N | N | N | Y | N | Y | +| `test2.main.nf.test` | Trimmed | FASTQ | SE | Y | N | N | N | N | Y | Y | Y | +| `test3.main.nf.test` | Raw | FASTQ | SE | Y | N | Y | Y | N | Y | Y | Y | +| `test4.main.nf.test` | Raw | CRAM | SE | Y | N | Y | Y | N | Y | Y | Y | +| `test5.main.nf.test` | Raw | FASTQ | PE | N | Y (SeqPrep) | Y | Y | N | N | Y | Y | +| `test6.main.nf.test` | Raw | FASTQ | PE | N | Y (Flash2) | Y | Y | Y | N | Y | Y | +| `test7.main.nf.test` | Raw | FASTQ | PE | N | Y (SeqPrep) | Y | Y | Y | N | Y | Y | +| `test8.main.nf.test` | Raw | FASTQ | PE | N | Y (Flash2) | Y | Y | Y | N | Y | Y | +| `test9.main.nf.test` | Raw | FASTQ | PE | N | Y (Flash2) | Y | Y | Y | N | Y | Y | +| `test10.main.nf.test` | Raw | FASTQ | SE | N | N | Y | Y | Y | N | Y | Y | +| `test11.main.nf.test` | Raw | FASTQ | SE | N | N | Y | Y | N | Y | Y | Y | +| `test12.main.nf.test` | Raw | CRAM | SE | N | N | Y | Y | N | Y | Y | Y | diff --git a/tests/manifests/raw-cram-se-noRC.csv b/tests/manifests/raw-cram-se-noRC.csv new file mode 100644 index 0000000..e608ea2 --- /dev/null +++ b/tests/manifests/raw-cram-se-noRC.csv @@ -0,0 +1,2 @@ +sample,cram_file +test_sample,../../../tests/sample-data/1.cram diff --git a/tests/manifests/raw-cram-se.csv b/tests/manifests/raw-cram-se.csv new file mode 100644 index 0000000..bd7cc6b --- /dev/null +++ b/tests/manifests/raw-cram-se.csv @@ -0,0 +1,2 @@ +sample,cram_file +test_sample,../../../tests/sample-data/2.cram diff --git a/tests/manifests/raw-fastq-pe-multiple-samples.csv b/tests/manifests/raw-fastq-pe-multiple-samples.csv new file mode 100644 index 0000000..8d78513 --- /dev/null +++ b/tests/manifests/raw-fastq-pe-multiple-samples.csv @@ -0,0 +1,5 @@ +sample,fastq_1,fastq_2 +lib,../../../tests/sample-data/libR1.fq.gz,../../../tests/sample-data/libR2.fq.gz +u,../../../tests/sample-data/uR1.fq.gz,../../../tests/sample-data/uR2.fq.gz +v,../../../tests/sample-data/vR1.fq.gz,../../../tests/sample-data/vR2.fq.gz +w,../../../tests/sample-data/wR1.fq.gz,../../../tests/sample-data/wR2.fq.gz diff --git a/tests/manifests/raw-fastq-pe.csv b/tests/manifests/raw-fastq-pe.csv new file mode 100644 index 0000000..1c3f654 --- /dev/null +++ b/tests/manifests/raw-fastq-pe.csv @@ -0,0 +1,2 @@ +sample,fastq_1,fastq_2 +test_sample,../../../tests/sample-data/xR1.fq.gz,../../../tests/sample-data/xR2.fq.gz diff --git a/tests/manifests/raw-fastq-se-multiple-samples.csv b/tests/manifests/raw-fastq-se-multiple-samples.csv new file mode 100644 index 0000000..d3322e7 --- /dev/null +++ b/tests/manifests/raw-fastq-se-multiple-samples.csv @@ -0,0 +1,4 @@ +sample,fastq_1,fastq_2 +HG_CH_1_4_A,/lustre/scratch125/casm/team78/quants_test_data/DATA/2.fq.gz, +HG_CH_1_4_B,/lustre/scratch125/casm/team78/quants_test_data/DATA/3.fq.gz, +HG_CH_1_4_C,/lustre/scratch125/casm/team78/quants_test_data/DATA/4.fq.gz, diff --git a/tests/manifests/raw-fastq-se-noRC.csv b/tests/manifests/raw-fastq-se-noRC.csv new file mode 100644 index 0000000..3696604 --- /dev/null +++ b/tests/manifests/raw-fastq-se-noRC.csv @@ -0,0 +1,2 @@ +sample,fastq_1,fastq_2 +test_sample,../../../tests/sample-data/1.fq.gz, diff --git a/tests/manifests/raw-fastq-se.csv b/tests/manifests/raw-fastq-se.csv new file mode 100644 index 0000000..c67e0fd --- /dev/null +++ b/tests/manifests/raw-fastq-se.csv @@ -0,0 +1,2 @@ +sample,fastq_1,fastq_2 +test_sample,../../../tests/sample-data/2.fq.gz, diff --git a/tests/manifests/trimmed-fastq-se.csv b/tests/manifests/trimmed-fastq-se.csv new file mode 100644 index 0000000..f4053bf --- /dev/null +++ b/tests/manifests/trimmed-fastq-se.csv @@ -0,0 +1,2 @@ +sample,fastq_1,fastq_2 +test_sample,../../../tests/sample-data/sge.fq.gz, diff --git a/tests/nextflow.config b/tests/nextflow.config new file mode 100644 index 0000000..c19b1ad --- /dev/null +++ b/tests/nextflow.config @@ -0,0 +1,5 @@ +/* +======================================================================================== + Nextflow config file for running tests +======================================================================================== +*/ diff --git a/tests/ref-checksums b/tests/ref-checksums new file mode 100644 index 0000000..873db81 --- /dev/null +++ b/tests/ref-checksums @@ -0,0 +1,5 @@ +485b9de403b0278ed6684ad1348d37a8 tests/ref/1.csv +3e403419a08708609c9341a07ef7ac98 tests/ref/2.csv +e3c702dee536c45e8eeae36996fcd207 tests/ref/3.tsv +ac0899f173efe28a5b4b9b161f232d93 tests/ref/4.tsv +075cc1feb687db2c899a48fb263076a4 tests/ref/5.tsv diff --git a/tests/ref/.gitkeep b/tests/ref/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/sample-data-checksums b/tests/sample-data-checksums new file mode 100644 index 0000000..c5e69a6 --- /dev/null +++ b/tests/sample-data-checksums @@ -0,0 +1,17 @@ +77d92378b88ed28dd3f7d5d580971a53 tests/sample-data/1.cram +26d427131d4720aa7ed07e8018c526b1 tests/sample-data/1.fq.gz +b822820791a9fb4fde3af96afa9308a5 tests/sample-data/2.cram +023bc001077093ad6586a4c5f601ad37 tests/sample-data/2.fq.gz +0d131b633a2af323b025a756ae933d7b tests/sample-data/3.fq.gz +47201d8a28b69328823c8df973041ec2 tests/sample-data/4.fq.gz +2ab872bb3f7de763c27d8811e3e2c622 tests/sample-data/libR1.fq.gz +65888a8f410e81e0633a814dc77743e5 tests/sample-data/libR2.fq.gz +5bf45c57e729d8629e99df3979d1c97c tests/sample-data/sge.fq.gz +4da5792d1d6a5d998f0ace0870c55f29 tests/sample-data/uR1.fq.gz +2ef7c9ad9eaf02f903fafd340095fbd5 tests/sample-data/uR2.fq.gz +232f948fbbd7bd49f2cf9735c527a744 tests/sample-data/vR1.fq.gz +5dce830523e9927aba8433ff79b56db4 tests/sample-data/vR2.fq.gz +77ffaf4d0dcf665bd9ba31e8da885c16 tests/sample-data/wR1.fq.gz +2777816cca4302e9c042dfaeb17d6dea tests/sample-data/wR2.fq.gz +0aee12c4562d18eba0300ba0a144371a tests/sample-data/xR1.fq.gz +6a789cedb3b9f64479ec6c875eceae1a tests/sample-data/xR2.fq.gz diff --git a/tests/sample-data/.gitkeep b/tests/sample-data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/test1.main.nf.test b/tests/test1.main.nf.test new file mode 100644 index 0000000..0cc6022 --- /dev/null +++ b/tests/test1.main.nf.test @@ -0,0 +1,31 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + + test("Should run without failures") { + + when { + params { + input = "${projectDir}/tests/manifests/trimmed-fastq-se.csv" + single_end = true + input_type = "fastq" + read_modification = true + append_start = "ATTCACGTTATGCTGTCCAATCTCT" + append_end = "GAAATCTAAAATTACCTTCCCAGGG" + append_quality = "?" + read_transform = "reverse_complement" + transform_library = true + pyquest_library_converter_options = "-N 1 -S 24" + quantification = "pyquest" + oligo_library = "${projectDir}/tests/ref/2.csv" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/test10.main.nf.test b/tests/test10.main.nf.test new file mode 100644 index 0000000..ee8ccee --- /dev/null +++ b/tests/test10.main.nf.test @@ -0,0 +1,30 @@ +// TEST BROKEN +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + + test("Should run without failures") { + + when { + params { + input = "${projectDir}/tests/manifests/raw-fastq-se-multiple-samples.csv" + single_end = true + input_type = "fastq" + raw_sequencing_qc = true + adapter_trimming = "cutadapt" + adapter_cutadapt_options = "-a 'AGATCGGAAGAGCGGTTCAGCAGGAATGCCG' -A 'AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT' -m 1" + adapter_trimming_qc = true + primer_trimming = "cutadapt" + primer_cutadapt_options = "-g 'TCTACATTTTATTTGCACTACTTGAAGG...ATACTTTTAAGTTCTGGGGTCATGTG' -G 'CACATGACCCCAGAACTTAAA...AGTGCAAATAAAATGTAGA' -m 1" + primer_trimming_qc = true + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/test11.main.nf.test b/tests/test11.main.nf.test new file mode 100644 index 0000000..cc01fd8 --- /dev/null +++ b/tests/test11.main.nf.test @@ -0,0 +1,37 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + + test("Should run without failures") { + + when { + params { + input = "${projectDir}/tests/manifests/raw-fastq-se-noRC.csv" + single_end = true + input_type = "fastq" + raw_sequencing_qc = true + adapter_trimming = "cutadapt" + adapter_cutadapt_options = "-a AGATCGGAAGAGCACACGTCTGAACTCCAGTCA -m 1" + adapter_trimming_qc = true + primer_trimming = "cutadapt" + primer_cutadapt_options = "-g 'AGCATGTCTAAGGCATATCAGAGCA...TGAGCTGGCAGAGGGGCCATTGTGG' -m 1" + primer_trimming_qc = true + read_modification = true + append_start = "AGCATGTCTAAGGCATATCAGAGCA" + append_end = "TGAGCTGGCAGAGGGGCCATTGTGG" + append_quality = "?" + transform_library = true + pyquest_library_converter_options = "-N 1 -S 24" + quantification = "pyquest" + oligo_library = "${projectDir}/tests/ref/1.csv" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/test12.main.nf.test b/tests/test12.main.nf.test new file mode 100644 index 0000000..917e8da --- /dev/null +++ b/tests/test12.main.nf.test @@ -0,0 +1,37 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + + test("Should run without failures") { + + when { + params { + input = "${projectDir}/tests/manifests/raw-cram-se-noRC.csv" + single_end = true + input_type = "cram" + raw_sequencing_qc = true + adapter_trimming = "cutadapt" + adapter_cutadapt_options = "-a AGATCGGAAGAGCACACGTCTGAACTCCAGTCA -m 1" + adapter_trimming_qc = true + primer_trimming = "cutadapt" + primer_cutadapt_options = "-g 'AGCATGTCTAAGGCATATCAGAGCA...TGAGCTGGCAGAGGGGCCATTGTGG' -m 1" + primer_trimming_qc = true + read_modification = true + append_start = "AGCATGTCTAAGGCATATCAGAGCA" + append_end = "TGAGCTGGCAGAGGGGCCATTGTGG" + append_quality = "?" + transform_library = true + pyquest_library_converter_options = "-N 1 -S 24" + quantification = "pyquest" + oligo_library = "${projectDir}/tests/ref/1.csv" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/test2.main.nf.test b/tests/test2.main.nf.test new file mode 100644 index 0000000..da59458 --- /dev/null +++ b/tests/test2.main.nf.test @@ -0,0 +1,30 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + + test("Should run without failures") { + + when { + params { + input = "${projectDir}/tests/manifests/trimmed-fastq-se.csv" + single_end = true + input_type = "fastq" + raw_sequencing_qc = true + read_modification = true + append_start = "ATTCACGTTATGCTGTCCAATCTCT" + append_end = "GAAATCTAAAATTACCTTCCCAGGG" + append_quality = "?" + read_transform = "reverse_complement" + quantification = "pyquest" + oligo_library = "${projectDir}/tests/ref/3.tsv" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/test3.main.nf.test b/tests/test3.main.nf.test new file mode 100644 index 0000000..6906f70 --- /dev/null +++ b/tests/test3.main.nf.test @@ -0,0 +1,38 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + + test("Should run without failures") { + + when { + params { + input = "${projectDir}/tests/manifests/raw-fastq-se.csv" + single_end = true + input_type = "fastq" + raw_sequencing_qc = true + adapter_trimming = "cutadapt" + adapter_cutadapt_options = "-a AGATCGGAAGAGCACACGTCTGAACTCCAGTCA -m 1" + adapter_trimming_qc = true + primer_trimming = "cutadapt" + primer_cutadapt_options = "-g 'CCCTGGGAAGGTAATTTTAGATTTC...AGAGATTGGACAGCATAACGTGAAT' -m 1" + primer_trimming_qc = true + read_modification = true + append_start = "ATTCACGTTATGCTGTCCAATCTCT" + append_end = "GAAATCTAAAATTACCTTCCCAGGG" + append_quality = "?" + read_transform = "reverse_complement" + transform_library = true + pyquest_library_converter_options = "-N 1 -S 24" + quantification = "pyquest" + oligo_library = "${projectDir}/tests/ref/2.csv" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/test4.main.nf.test b/tests/test4.main.nf.test new file mode 100644 index 0000000..9e6f791 --- /dev/null +++ b/tests/test4.main.nf.test @@ -0,0 +1,38 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + + test("Should run without failures") { + + when { + params { + input = "${projectDir}/tests/manifests/raw-cram-se.csv" + single_end = true + input_type = "cram" + raw_sequencing_qc = true + adapter_trimming = "cutadapt" + adapter_cutadapt_options = "-a AGATCGGAAGAGCACACGTCTGAACTCCAGTCA -m 1" + adapter_trimming_qc = true + primer_trimming = "cutadapt" + primer_cutadapt_options = "-g 'CCCTGGGAAGGTAATTTTAGATTTC...AGAGATTGGACAGCATAACGTGAAT' -m 1" + primer_trimming_qc = true + read_modification = true + append_start = "ATTCACGTTATGCTGTCCAATCTCT" + append_end = "GAAATCTAAAATTACCTTCCCAGGG" + append_quality = "?" + read_transform = "reverse_complement" + transform_library = true + pyquest_library_converter_options = "-N 1 -S 24" + quantification = "pyquest" + oligo_library = "${projectDir}/tests/ref/2.csv" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/test5.main.nf.test b/tests/test5.main.nf.test new file mode 100644 index 0000000..07913e7 --- /dev/null +++ b/tests/test5.main.nf.test @@ -0,0 +1,33 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + + test("Should run without failures") { + + when { + params { + input = "${projectDir}/tests/manifests/raw-fastq-pe.csv" + single_end = false + input_type = "fastq" + raw_sequencing_qc = true + adapter_trimming = "cutadapt" + adapter_cutadapt_options = "-a 'AGATCGGAAGAGCGGTTCAGCAGGAATGCCG' -A 'AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT' -m 1" + adapter_trimming_qc = true + primer_trimming = "cutadapt" + primer_cutadapt_options = "-g 'TCTACATTTTATTTGCACTACTTGAAGG...ATACTTTTAAGTTCTGGGGTCATGTG' -G 'CACATGACCCCAGAACTTAAA...AGTGCAAATAAAATGTAGA' -m 1" + primer_trimming_qc = true + read_merging = "seqprep" + read_merging_qc = true + quantification = "pyquest" + oligo_library = "${projectDir}/tests/ref/4.tsv" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/test6.main.nf.test b/tests/test6.main.nf.test new file mode 100644 index 0000000..0a97825 --- /dev/null +++ b/tests/test6.main.nf.test @@ -0,0 +1,33 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + + test("Should run without failures") { + + when { + params { + input = "${projectDir}/tests/manifests/raw-fastq-pe.csv" + single_end = false + input_type = "fastq" + raw_sequencing_qc = true + adapter_trimming = "cutadapt" + adapter_cutadapt_options = "-a 'AGATCGGAAGAGCGGTTCAGCAGGAATGCCG' -A 'AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT' -m 1" + adapter_trimming_qc = true + primer_trimming = "cutadapt" + primer_cutadapt_options = "-g 'TCTACATTTTATTTGCACTACTTGAAGG...ATACTTTTAAGTTCTGGGGTCATGTG' -G 'CACATGACCCCAGAACTTAAA...AGTGCAAATAAAATGTAGA' -m 1" + primer_trimming_qc = true + read_merging = "flash2" + read_merging_qc = true + quantification = "pyquest" + oligo_library = "${projectDir}/tests/ref/4.tsv" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/test7.main.nf.test b/tests/test7.main.nf.test new file mode 100644 index 0000000..0d14a82 --- /dev/null +++ b/tests/test7.main.nf.test @@ -0,0 +1,35 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + + test("Should run without failures") { + + when { + params { + input = "${projectDir}/tests/manifests/raw-fastq-pe.csv" + single_end = false + input_type = "fastq" + raw_sequencing_qc = true + adapter_trimming = "cutadapt" + adapter_cutadapt_options = "-a 'AGATCGGAAGAGCGGTTCAGCAGGAATGCCG' -A 'AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT' -m 1" + adapter_trimming_qc = true + primer_trimming = "cutadapt" + primer_cutadapt_options = "-g 'TCTACATTTTATTTGCACTACTTGAAGG...ATACTTTTAAGTTCTGGGGTCATGTG' -G 'CACATGACCCCAGAACTTAAA...AGTGCAAATAAAATGTAGA' -m 1" + primer_trimming_qc = true + read_merging = "seqprep" + read_merging_qc = true + read_filtering = "seqkit" + seqkit_seq_options = "-m 100" + quantification = "pyquest" + oligo_library = "${projectDir}/tests/ref/4.tsv" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/test8.main.nf.test b/tests/test8.main.nf.test new file mode 100644 index 0000000..66d521e --- /dev/null +++ b/tests/test8.main.nf.test @@ -0,0 +1,35 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + + test("Should run without failures") { + + when { + params { + input = "${projectDir}/tests/manifests/raw-fastq-pe.csv" + single_end = false + input_type = "fastq" + raw_sequencing_qc = true + adapter_trimming = "cutadapt" + adapter_cutadapt_options = "-a 'AGATCGGAAGAGCGGTTCAGCAGGAATGCCG' -A 'AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT' -m 1" + adapter_trimming_qc = true + primer_trimming = "cutadapt" + primer_cutadapt_options = "-g 'TCTACATTTTATTTGCACTACTTGAAGG...ATACTTTTAAGTTCTGGGGTCATGTG' -G 'CACATGACCCCAGAACTTAAA...AGTGCAAATAAAATGTAGA' -m 1" + primer_trimming_qc = true + read_merging = "flash2" + read_merging_qc = true + read_filtering = "seqkit" + seqkit_seq_options = "-m 100" + quantification = "pyquest" + oligo_library = "${projectDir}/tests/ref/4.tsv" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/test9.main.nf.test b/tests/test9.main.nf.test new file mode 100644 index 0000000..d209a17 --- /dev/null +++ b/tests/test9.main.nf.test @@ -0,0 +1,35 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + + test("Should run without failures") { + + when { + params { + input = "${projectDir}/tests/manifests/raw-fastq-pe-multiple-samples.csv" + single_end = false + input_type = "fastq" + raw_sequencing_qc = true + adapter_trimming = "cutadapt" + adapter_cutadapt_options = "-a 'AGATCGGAAGAGCGGTTCAGCAGGAATGCCG' -A 'AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT' -m 1" + primer_trimming = "cutadapt" + primer_cutadapt_options = "-g 'ACTACTGAGGACCACAAAATGGTA...AGAGCTTAAGTTTCAGCATTCTC' -G 'CAGAATGCTGAAACATAAGCTCTTTA...CTTCTACCATTTTGTGGTCCTCAGTAGT' -m 1" + read_trimming_qc = true + read_merging = "flash2" + read_merging_qc = true + read_filtering = "seqkit_seq" + read_filtering_qc = true + seqkit_seq_options = "--min-len 227" + quantification = "pyquest" + oligo_library = "${projectDir}/tests/ref/5.tsv" + } + } + + then { + assert workflow.success + } + + } + +}