diff --git a/modules.json b/modules.json index fe8f75cc..c0c4132a 100644 --- a/modules.json +++ b/modules.json @@ -42,7 +42,7 @@ }, "custom/shortenfastaids": { "branch": "main", - "git_sha": "e226301053a2b0f9a6af514b454b3ae7c91daa80", + "git_sha": "e9ec2e4c48ead3d760c8e13950c568c19ae86b8b", "installed_by": ["fasta_ltrretriever_lai"] }, "gffread": { @@ -121,7 +121,7 @@ }, "fasta_ltrretriever_lai": { "branch": "main", - "git_sha": "734297c99ae8b13ed73e3ff9a8f1215e1ca05ecd", + "git_sha": "e9ec2e4c48ead3d760c8e13950c568c19ae86b8b", "installed_by": ["subworkflows"] }, "fastq_bwa_mem_samblaster": { diff --git a/modules/pfr/custom/shortenfastaids/main.nf b/modules/pfr/custom/shortenfastaids/main.nf index cef0796c..3cdaa07c 100644 --- a/modules/pfr/custom/shortenfastaids/main.nf +++ b/modules/pfr/custom/shortenfastaids/main.nf @@ -25,7 +25,10 @@ process CUSTOM_SHORTENFASTAIDS { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch "${meta.id}.short.ids.tsv" + echo \\ + 'IDs have acceptable length and character. No change required.' \\ + > ${meta.id}.short.ids.tsv + cat <<-END_VERSIONS > versions.yml "${task.process}": python: \$(python --version | cut -d' ' -f2) diff --git a/modules/pfr/custom/shortenfastaids/tests/main.nf.test.snap b/modules/pfr/custom/shortenfastaids/tests/main.nf.test.snap index 49fa2afb..2506ebd6 100644 --- a/modules/pfr/custom/shortenfastaids/tests/main.nf.test.snap +++ b/modules/pfr/custom/shortenfastaids/tests/main.nf.test.snap @@ -59,7 +59,7 @@ { "id": "test" }, - "test.short.ids.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.short.ids.tsv:md5,fcf920d9a7b57a1e3c29a9e88673330f" ] ], "2": [ @@ -73,7 +73,7 @@ { "id": "test" }, - "test.short.ids.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.short.ids.tsv:md5,fcf920d9a7b57a1e3c29a9e88673330f" ] ], "versions": [ @@ -83,9 +83,9 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.04.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-06-02T20:54:36.815875" + "timestamp": "2024-06-04T13:58:30.161542" }, "homo_sapiens-genome_fasta-no_change": { "content": [ diff --git a/subworkflows/pfr/fasta_ltrretriever_lai/main.nf b/subworkflows/pfr/fasta_ltrretriever_lai/main.nf index b63f8ea1..3820e69c 100644 --- a/subworkflows/pfr/fasta_ltrretriever_lai/main.nf +++ b/subworkflows/pfr/fasta_ltrretriever_lai/main.nf @@ -174,23 +174,23 @@ workflow FASTA_LTRRETRIEVER_LAI { def map_monoploid_seqs_to_new_ids(id, short_ids_tsv, monoploid_seqs) { - def short_ids_head = short_ids_tsv.text.split('\n')[0] + def short_ids_head = short_ids_tsv.text.tokenize('\n')[0] if (short_ids_head == "IDs have acceptable length and character. No change required.") { - return [ "${id}.mapped.monoploid.seqs.txt" ] + monoploid_seqs.text.split('\n') + return [ "${id}.mapped.monoploid.seqs.txt" ] + monoploid_seqs.text.tokenize('\n') } def orig_to_new_ids = [:] short_ids_tsv.text.eachLine { line -> - def (original_id, renamed_id) = line.split('\t') + def (original_id, renamed_id) = line.tokenize('\t') orig_to_new_ids[original_id] = renamed_id } def mapped_ids = [] monoploid_seqs.text.eachLine { original_id -> if (!orig_to_new_ids[original_id]) { - error "Faild to find $original_id in ${monoploid_seqs}" + - "The monoploid_seqs file is malformed!" + error "Faild to find $original_id in ${short_ids_tsv}" + + "\nThe short_ids_tsv file is malformed!" } mapped_ids.add(orig_to_new_ids[original_id]) diff --git a/subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test b/subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test index 192ccef6..a7fc65eb 100644 --- a/subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test +++ b/subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test @@ -135,9 +135,9 @@ nextflow_workflow { workflow { """ def monoploid_seqs = new File('test.mono.seq.txt') - monoploid_seqs.write("chr_xxxxxxxxxxxxxxx_1") + monoploid_seqs.write("chr1") - input[0] = Channel.empty() + input[0] = GUNZIP.out.gunzip input[1] = Channel.of( [ [ id:'test' ], monoploid_seqs.toPath() ] ) input[2] = false """ diff --git a/subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test.snap b/subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test.snap index 4ce42ec1..e827219f 100644 --- a/subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test.snap +++ b/subworkflows/pfr/fasta_ltrretriever_lai/tests/main.nf.test.snap @@ -56,41 +56,91 @@ "content": [ { "0": [ - + [ + { + "id": "test" + }, + "test.LTRlib.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "1": [ - + [ + { + "id": "test" + }, + "test.out.gff3:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "2": [ - + [ + { + "id": "test" + }, + "test.LAI.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "3": [ - + [ + { + "id": "test" + }, + "test.LAI.out:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "4": [ - + "versions.yml:md5,05a74dacbcd6c5906faeca3206f6563f", + "versions.yml:md5,52a98b45c3cf73f9314dbe9b34eca9d8", + "versions.yml:md5,5d86cda262f5c21e43738433a2781ebc", + "versions.yml:md5,608d746d45680f025562c4be455db461", + "versions.yml:md5,8468404805dddec679524e75b4fa51e8", + "versions.yml:md5,fb42c6cc5c28b6f9d3384171c7b6b143" ], "annotation_gff": [ - + [ + { + "id": "test" + }, + "test.out.gff3:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "lai_log": [ - + [ + { + "id": "test" + }, + "test.LAI.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "lai_out": [ - + [ + { + "id": "test" + }, + "test.LAI.out:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "ltrlib": [ - + [ + { + "id": "test" + }, + "test.LTRlib.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "versions": [ - + "versions.yml:md5,05a74dacbcd6c5906faeca3206f6563f", + "versions.yml:md5,52a98b45c3cf73f9314dbe9b34eca9d8", + "versions.yml:md5,5d86cda262f5c21e43738433a2781ebc", + "versions.yml:md5,608d746d45680f025562c4be455db461", + "versions.yml:md5,8468404805dddec679524e75b4fa51e8", + "versions.yml:md5,fb42c6cc5c28b6f9d3384171c7b6b143" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.04.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-06-02T20:35:25.114358" + "timestamp": "2024-06-04T13:50:48.75158" } -} +} \ No newline at end of file