diff nf/subworkflows/ncbi/default/annotwriter/main.nf @ 0:d9c5c5b87fec draft

planemo upload for repository https://github.com/ncbi/egapx commit 8173d01b08d9a91c9ec5f6cb50af346edc8020c4
author fubar
date Sat, 03 Aug 2024 11:16:53 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nf/subworkflows/ncbi/default/annotwriter/main.nf	Sat Aug 03 11:16:53 2024 +0000
@@ -0,0 +1,37 @@
+#!/usr/bin/env nextflow
+nextflow.enable.dsl=2
+
+
+workflow annotwriter {
+    take:
+        accept_asn_file  // Channel: accept.asn file
+        parameters     // Map : extra parameter and parameter update
+    main:
+        c =  run_annotwriter(accept_asn_file)
+    emit:
+        annoted_file = c
+}
+
+
+process run_annotwriter {
+    input:
+        path accept_asn_file
+    output:
+        path ('output/accept.gff'), emit: 'annoted_file'
+
+    script:
+    """
+    mkdir -p output
+    if [ -s ${accept_asn_file} ]; then
+        annotwriter -i ${accept_asn_file} -nogenbank -format gff3 -o output/accept.gff
+    else
+        touch output/accept.gff
+    fi
+    """
+
+    stub:
+    """
+    mkdir -p output
+    echo "1"  > output/accept.gff
+    """
+}