Mercurial > repos > fubar > egapx_runner
comparison nf/ui.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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:d9c5c5b87fec |
---|---|
1 #!/usr/bin/env nextflow | |
2 // main nextflow script for EGAPx ui execution | |
3 // prepare data channels and call main subworkflow | |
4 | |
5 nextflow.enable.dsl=2 | |
6 | |
7 include { egapx } from './subworkflows/ncbi/main' | |
8 include { only_gnomon } from './subworkflows/ncbi/only_gnomon' | |
9 | |
10 params.verbose = false | |
11 | |
12 | |
13 process export { | |
14 publishDir "${params.output}", mode: 'copy', saveAs: { fn -> fn.substring(fn.lastIndexOf('/')+1) } | |
15 input: | |
16 path out_files | |
17 path annot_builder_output, stageAs: 'annot_builder_output/*' | |
18 // path locus | |
19 output: | |
20 path "*", includeInputs: true | |
21 script: | |
22 """ | |
23 echo "export script" | |
24 """ | |
25 stub: | |
26 """ | |
27 echo "export stub" | |
28 """ | |
29 } | |
30 | |
31 | |
32 workflow { | |
33 // Parse input parameters | |
34 def input_params = params.get('input', [:]) | |
35 def genome = input_params.get('genome', []) | |
36 def proteins = input_params.get('proteins', []) | |
37 def reads_query = input_params.get('reads_query', []) | |
38 def reads_ids = input_params.get('reads_ids', []) | |
39 def reads = input_params.get('reads', []) | |
40 def reads_metadata = input_params.get('reads_metadata', []) | |
41 def organelles = input_params.get('organelles', []) ?: [] | |
42 def tax_id = input_params.get('taxid', []) | |
43 def hmm_params = input_params.get('hmm', []) ?: [] | |
44 def hmm_taxid = input_params.get('hmm_taxid', []) ?: [] | |
45 def softmask = input_params.get('softmask', []) ?: [] | |
46 def max_intron = input_params.get('max_intron', []) | |
47 def genome_size_threshold = input_params.get('genome_size_threshold', []) | |
48 def rnaseq_alignments = input_params.get('rnaseq_alignments', []) ?: [] | |
49 def protein_alignments = input_params.get('protein_alignments', []) ?: [] | |
50 def task_params = params.get('tasks', [:]) | |
51 def func_name = params.get('func_name', '') | |
52 if (params.verbose) { | |
53 println("input params:\ngenome ${genome}") | |
54 println("proteins ${proteins}") | |
55 println("reads_query ${reads_query}") | |
56 println("reads_ids ${reads_ids}") | |
57 println("reads ${reads}") | |
58 println("reads_metadata ${reads_metadata}") | |
59 println("organelles ${organelles}") | |
60 println("tax_id ${tax_id}") | |
61 println("hmm_params ${hmm_params}") | |
62 println("hmm_taxid ${hmm_taxid}") | |
63 println("softmask ${softmask}") | |
64 println("max_intron ${max_intron}") | |
65 println("genome_size_threshold ${genome_size_threshold}") | |
66 println("rnaseq_alignments ${rnaseq_alignments}") | |
67 println("protein_alignments ${protein_alignments}") | |
68 println("func_name ${func_name}") | |
69 // Keep it last as it is large | |
70 println("task_params ${task_params}") | |
71 } | |
72 | |
73 if(func_name == 'only_gnomon') { | |
74 if (params.verbose) { | |
75 print('in gnomon block') | |
76 } | |
77 only_gnomon(genome, proteins, rnaseq_alignments, protein_alignments, organelles, tax_id, hmm_params, hmm_taxid, softmask, task_params) | |
78 export(only_gnomon.out.out_files, only_gnomon.out.evidence) | |
79 } | |
80 else { | |
81 if (params.verbose) { | |
82 print('in egapx block') | |
83 } | |
84 egapx(genome, proteins, reads_query, reads_ids, reads, reads_metadata, organelles, tax_id, hmm_params, hmm_taxid, softmask, max_intron, genome_size_threshold, task_params) | |
85 // export(egapx.out.out_files, egapx.out.annot_builder_output, egapx.out.locus) | |
86 export(egapx.out.out_files, egapx.out.annot_builder_output) | |
87 } | |
88 } |