diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md old mode 100644 new mode 100755 diff --git a/docs/usage.md b/docs/usage.md index 067a5759..fa94c02f 100755 --- a/docs/usage.md +++ b/docs/usage.md @@ -89,6 +89,8 @@ Now that's all downloaded we need to prep it. At this point it is all still gzip The below code will look through the current folder for files ending with `.fasta.gz` and decompresses it, it will then run our python script, `GA_data_prep.py`. +NOTE: This will soon be superseeded by a rust tools `treeval_utils`, this will replace all of the accessory pythons scripts included in this document. Whilst also adding a program to verify your YAML. + Command: ```bash @@ -234,7 +236,7 @@ If your data isn't already in these formats, then let us know and we'll see how This command iterates through your bam files and converts them to fastq via samtools. -``` +```bash cd { TO FOLDER OF BAM FILES } mkdir fastq for i in *bam @@ -266,6 +268,7 @@ done This simply gzips (compresses) the fasta files. ```bash +cd fasta for i in .fasta; do echo $i gzip $i diff --git a/modules.json b/modules.json index d5fa2f77..5d6662aa 100644 --- a/modules.json +++ b/modules.json @@ -79,7 +79,7 @@ }, "fastk/fastk": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"], "patch": "modules/nf-core/fastk/fastk/fastk-fastk.diff" }, diff --git a/modules/nf-core/fastk/fastk/environment.yml b/modules/nf-core/fastk/fastk/environment.yml index 690a3f7a..14207ff6 100644 --- a/modules/nf-core/fastk/fastk/environment.yml +++ b/modules/nf-core/fastk/fastk/environment.yml @@ -1,4 +1,5 @@ -name: fastk_fastk channels: - conda-forge - bioconda +dependencies: + - bioconda::false_flag # False flag to pass nf-core/lint diff --git a/modules/nf-core/fastk/fastk/fastk-fastk.diff b/modules/nf-core/fastk/fastk/fastk-fastk.diff index 56003656..80906fac 100644 --- a/modules/nf-core/fastk/fastk/fastk-fastk.diff +++ b/modules/nf-core/fastk/fastk/fastk-fastk.diff @@ -1,6 +1,4 @@ Changes in module 'nf-core/fastk/fastk' -'modules/nf-core/fastk/fastk/meta.yml' is unchanged -Changes in 'fastk/fastk/main.nf': --- modules/nf-core/fastk/fastk/main.nf +++ modules/nf-core/fastk/fastk/main.nf @@ -3,7 +3,7 @@ @@ -12,6 +10,21 @@ Changes in 'fastk/fastk/main.nf': input: tuple val(meta), path(reads) +@@ -29,7 +29,6 @@ + FastK \\ + $args \\ + -T$task.cpus \\ +- -M${task.memory.toGiga()} \\ + -N${prefix}_fk \\ + $reads + +@@ -62,7 +61,6 @@ + "FastK \\ + $args \\ + -T$task.cpus \\ +- -M${task.memory.toGiga()} \\ + -N${prefix}_fk \\ + $reads" + -'modules/nf-core/fastk/fastk/environment.yml' is unchanged ************************************************************ diff --git a/modules/nf-core/fastk/fastk/main.nf b/modules/nf-core/fastk/fastk/main.nf old mode 100755 new mode 100644 index 67c2dc7a..256e80de --- a/modules/nf-core/fastk/fastk/main.nf +++ b/modules/nf-core/fastk/fastk/main.nf @@ -29,10 +29,41 @@ process FASTK_FASTK { FastK \\ $args \\ -T$task.cpus \\ - -M${task.memory.toGiga()} \\ -N${prefix}_fk \\ $reads + find . -name '*.ktab*' \\ + | xargs chmod a+r + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastk: $FASTK_VERSION + END_VERSIONS + """ + + stub: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "FASTK_FASTK module does not support Conda. Please use Docker / Singularity / Podman instead." + } + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def FASTK_VERSION = 'f18a4e6d2207539f7b84461daebc54530a9559b0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + + def touch_ktab = args.contains('-t') ? "touch ${prefix}_fk.ktab .${prefix}_fk.ktab.1" : '' + def touch_prof = args.contains('-p') ? "touch ${prefix}_fk.prof .${prefix}_fk.pidx.1" : '' + """ + touch ${prefix}_fk.hist + $touch_ktab + $touch_prof + + echo \\ + "FastK \\ + $args \\ + -T$task.cpus \\ + -N${prefix}_fk \\ + $reads" + cat <<-END_VERSIONS > versions.yml "${task.process}": fastk: $FASTK_VERSION diff --git a/modules/nf-core/fastk/fastk/meta.yml b/modules/nf-core/fastk/fastk/meta.yml index 7c7f4260..4abc1033 100644 --- a/modules/nf-core/fastk/fastk/meta.yml +++ b/modules/nf-core/fastk/fastk/meta.yml @@ -9,41 +9,57 @@ tools: description: "A fast K-mer counter for high-fidelity shotgun datasets" homepage: "https://github.com/thegenemyers/FASTK" tool_dev_url: "https://github.com/thegenemyers/FASTK" - licence: "https://github.com/thegenemyers/FASTK/blob/master/LICENSE" + licence: ["https://github.com/thegenemyers/FASTK/blob/master/LICENSE"] + identifier: "" 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 1 and 2 for single-end and paired-end data, - respectively. + - - 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 1 and 2 for single-end and paired-end data, + respectively. output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - hist: - type: file - description: Histogram of k-mers - pattern: "*.hist" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.hist": + type: file + description: Histogram of k-mers + pattern: "*.hist" - ktab: - type: file - description: A sorted table of all canonical k‑mers along with their counts. - pattern: "*.ktab" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - '*.ktab*", hidden: true': + type: file + description: A sorted table of all canonical k‑mers along with their counts. + pattern: "*.ktab" - prof: - type: file - description: A k‑mer count profile of each sequence in the input data set. - pattern: "*.prof" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - '*.{prof,pidx}*", hidden: true': + type: file + description: A k‑mer count profile of each sequence in the input data set. + pattern: "*.prof" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@mahesh-panchal" maintainers: - "@mahesh-panchal" + - "@gallvp" diff --git a/modules/nf-core/fastk/fastk/tests/main.nf.test b/modules/nf-core/fastk/fastk/tests/main.nf.test new file mode 100644 index 00000000..856c36a8 --- /dev/null +++ b/modules/nf-core/fastk/fastk/tests/main.nf.test @@ -0,0 +1,110 @@ +nextflow_process { + + name "Test Process FASTK_FASTK" + script "../main.nf" + config './nextflow.config' + process "FASTK_FASTK" + + tag "modules" + tag "modules_nfcore" + tag "fastk" + tag "fastk/fastk" + + test("test_fastk_fastk_single_end") { + when { + process { + """ + input[0] = [ + [ id:'test' , single_end: true ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("test_fastk_fastk_paired_end") { + + when { + process { + """ + input[0] = [ + [ id:'test' , single_end: false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("test_fastk_fastk_single_end_stub") { + + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test' , single_end: true ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("test_fastk_fastk_paired_end_stub") { + + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test' , single_end: false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/fastk/fastk/tests/main.nf.test.snap b/modules/nf-core/fastk/fastk/tests/main.nf.test.snap new file mode 100644 index 00000000..1e3fc4da --- /dev/null +++ b/modules/nf-core/fastk/fastk/tests/main.nf.test.snap @@ -0,0 +1,346 @@ +{ + "test_fastk_fastk_single_end_stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test_fk.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.ktab.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.ktab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.pidx.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.prof:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "3": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ], + "hist": [ + [ + { + "id": "test", + "single_end": true + }, + "test_fk.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "ktab": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.ktab.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.ktab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "prof": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.pidx.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.prof:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-18T19:39:28.510263" + }, + "test_fastk_fastk_single_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test_fk.hist:md5,c80e12f7321e62dba4b437d7bff36ec0" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.ktab.1:md5,ceeacd0cb3aa69bf9b2a402830b40e26", + ".test_fk.ktab.2:md5,f2629fd15b285aed3dc2d5fe546edf3f", + "test_fk.ktab:md5,a605a58931a4b5029469e1c2575c8cee" + ] + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.pidx.1:md5,90bc384f61d2ecdb4586ab52ab04fddf", + ".test_fk.prof.1:md5,ebd48923a724cf79934f0b2ed42ba73d", + "test_fk.prof:md5,43d426c95d277b8148406624d513bd40" + ] + ] + ], + "3": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ], + "hist": [ + [ + { + "id": "test", + "single_end": true + }, + "test_fk.hist:md5,c80e12f7321e62dba4b437d7bff36ec0" + ] + ], + "ktab": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.ktab.1:md5,ceeacd0cb3aa69bf9b2a402830b40e26", + ".test_fk.ktab.2:md5,f2629fd15b285aed3dc2d5fe546edf3f", + "test_fk.ktab:md5,a605a58931a4b5029469e1c2575c8cee" + ] + ] + ], + "prof": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.pidx.1:md5,90bc384f61d2ecdb4586ab52ab04fddf", + ".test_fk.prof.1:md5,ebd48923a724cf79934f0b2ed42ba73d", + "test_fk.prof:md5,43d426c95d277b8148406624d513bd40" + ] + ] + ], + "versions": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-18T19:31:31.128388" + }, + "test_fastk_fastk_paired_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_fk.hist:md5,4f75b550d87ed4f26a2b10a05ac7e98c" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.ktab.1:md5,7f28fb44940fda799797e3069f5d7263", + ".test_fk.ktab.2:md5,c14a85c128926ace78372f09029977b1", + "test_fk.ktab:md5,fddd5be0c36ad1d2131b8d8774f7657a" + ] + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.pidx.1:md5,e7e760f714070a4afefb38ffff559684", + ".test_fk.pidx.2:md5,a549612bbdba2506eb3311237638c4b0", + ".test_fk.prof.1:md5,46a5fd9e297262b058f8c1fd062fcf56", + ".test_fk.prof.2:md5,80326a7406f41ccf2e51e341fc804132", + "test_fk.prof:md5,d3c7d8decd4ea6e298291b8be0e2de85" + ] + ] + ], + "3": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ], + "hist": [ + [ + { + "id": "test", + "single_end": false + }, + "test_fk.hist:md5,4f75b550d87ed4f26a2b10a05ac7e98c" + ] + ], + "ktab": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.ktab.1:md5,7f28fb44940fda799797e3069f5d7263", + ".test_fk.ktab.2:md5,c14a85c128926ace78372f09029977b1", + "test_fk.ktab:md5,fddd5be0c36ad1d2131b8d8774f7657a" + ] + ] + ], + "prof": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.pidx.1:md5,e7e760f714070a4afefb38ffff559684", + ".test_fk.pidx.2:md5,a549612bbdba2506eb3311237638c4b0", + ".test_fk.prof.1:md5,46a5fd9e297262b058f8c1fd062fcf56", + ".test_fk.prof.2:md5,80326a7406f41ccf2e51e341fc804132", + "test_fk.prof:md5,d3c7d8decd4ea6e298291b8be0e2de85" + ] + ] + ], + "versions": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-18T19:31:35.565502" + }, + "test_fastk_fastk_paired_end_stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_fk.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.ktab.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.ktab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.pidx.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.prof:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "3": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ], + "hist": [ + [ + { + "id": "test", + "single_end": false + }, + "test_fk.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "ktab": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.ktab.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.ktab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "prof": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.pidx.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.prof:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-18T19:39:32.570957" + } +} \ No newline at end of file diff --git a/modules/nf-core/fastk/fastk/tests/nextflow.config b/modules/nf-core/fastk/fastk/tests/nextflow.config new file mode 100644 index 00000000..c89ce9d5 --- /dev/null +++ b/modules/nf-core/fastk/fastk/tests/nextflow.config @@ -0,0 +1,3 @@ +process { + ext.args = '-t -p' +} diff --git a/modules/nf-core/fastk/fastk/tests/tags.yml b/modules/nf-core/fastk/fastk/tests/tags.yml new file mode 100644 index 00000000..82f9df82 --- /dev/null +++ b/modules/nf-core/fastk/fastk/tests/tags.yml @@ -0,0 +1,2 @@ +fastk/fastk: + - "modules/nf-core/fastk/fastk/**"