From 3dcc801eab8e9930c9733afc3f7d3ba25f8263b5 Mon Sep 17 00:00:00 2001 From: Toni Hermoso Pulido Date: Wed, 27 Nov 2024 17:02:27 +0100 Subject: [PATCH] Handling extraexons --- modules/local/exorthist/generate_annotations.nf | 3 +-- nextflow_schema.json | 2 +- subworkflows/local/exorthist/prepare.nf | 14 ++++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/local/exorthist/generate_annotations.nf b/modules/local/exorthist/generate_annotations.nf index b014615..94af79e 100644 --- a/modules/local/exorthist/generate_annotations.nf +++ b/modules/local/exorthist/generate_annotations.nf @@ -4,8 +4,7 @@ process GENERATE_ANNOTATIONS { label 'publish' input: - tuple val(genomeid), path(genome), path(annotation) - path extraexons + tuple val(genomeid), path(genome), path(annotation), path(extraexons) output: tuple val(genomeid), path("${genomeid}"), emit: idfolders diff --git a/nextflow_schema.json b/nextflow_schema.json index 861af83..9c8899d 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -132,7 +132,7 @@ "extraexons": { "type": "string", "description": "Extra exons (e.g. from VastDB)", - "format": "file-path" + "format": "file-path-pattern" }, "bonafide_pairs": { "type": "string", diff --git a/subworkflows/local/exorthist/prepare.nf b/subworkflows/local/exorthist/prepare.nf index 5197a27..b98e9c3 100644 --- a/subworkflows/local/exorthist/prepare.nf +++ b/subworkflows/local/exorthist/prepare.nf @@ -56,14 +56,20 @@ workflow PREPARE { // We join channels. If no extraexons, then it's empty, so no problem data_to_annotation = genomes.join(annotations) - // TODO: To check what's goiing on here - check extraexons_ch - // data_to_annotation = data_to_annotation.join(extraexons_ch, remainder: true) + + // print("EXTRAEXONS") if (extraexons) { - GENERATE_ANNOTATIONS(data_to_annotation, extraexons_ch) + data_to_annotation = data_to_annotation.join(extraexons_ch, remainder: true) + // data_to_annotation.view() + GENERATE_ANNOTATIONS(data_to_annotation) } else { // Sic: https://nextflow-io.github.io/patterns/optional-input/ - GENERATE_ANNOTATIONS(data_to_annotation, Channel.fromPath("/path/to/NO_FILE").collect()) + data_to_annotation.map { entry -> + entry.add(['/path/to/NO_FILE']) + } + data_to_annotation.view() + GENERATE_ANNOTATIONS(data_to_annotation) } clusters_split_ch = GENERATE_ANNOTATIONS.out.idfolders.toList().map{ [it, it].combinations().findAll{ a, b -> a[0] < b[0]} }