annotate nf/ui.nf @ 6:a7304162d737 draft

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