Mercurial > repos > fubar > egapx_runner
comparison nf/subworkflows/ncbi/gnomon/locus_link/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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:d9c5c5b87fec |
---|---|
1 #!/usr/bin/env nextflow | |
2 nextflow.enable.dsl=2 | |
3 | |
4 include { merge_params } from '../../utilities' | |
5 | |
6 workflow locus_link { | |
7 take: | |
8 best_refseq_prot_hit | |
9 orthologs | |
10 annotation | |
11 gencoll_asn | |
12 gnomon_lds2_source | |
13 best_prot_hit | |
14 track_loci | |
15 comparisons | |
16 curr_prev_compare | |
17 gnomon_biotypes | |
18 lxr_data | |
19 proteins_asn | |
20 name_from_ortholog | |
21 parameters // Map : extra parameter and parameter update | |
22 main: | |
23 default_params = "" | |
24 effective_params = merge_params(default_params, parameters, 'locus_link') | |
25 run_locus_link(best_refseq_prot_hit, orthologs, annotation, | |
26 gencoll_asn, gnomon_lds2_source, best_prot_hit, track_loci, comparisons, curr_prev_compare, | |
27 gnomon_biotypes, lxr_data, proteins_asn, name_from_ortholog, default_params) | |
28 emit: | |
29 best_gnomon_prot_hit = run_locus_link.out.best_gnomon_prot_hit | |
30 best_refseq_prot_hit = run_locus_link.out.best_refseq_prot_hit | |
31 locustypes = run_locus_link.out.locustypes | |
32 locus = run_locus_link.out.locus | |
33 stats = run_locus_link.out.stats | |
34 all = run_locus_link.out.all | |
35 } | |
36 | |
37 | |
38 | |
39 process run_locus_link { | |
40 input: | |
41 path best_refseq_prot_hit | |
42 path orthologs | |
43 path annotation | |
44 path gencoll_asn | |
45 path gnomon_lds2_source, stageAs: 'genome/*' | |
46 path best_prot_hit | |
47 path track_loci | |
48 path comparisons | |
49 path curr_prev_compare | |
50 path gnomon_biotypes | |
51 path lxr_data | |
52 path proteins_asn | |
53 path name_from_ortholog | |
54 val parameters | |
55 output: | |
56 path ('output/best_gnomon_prot_hit.tsv'), emit: 'best_gnomon_prot_hit' | |
57 path ('output/best_refseq_prot_hit.tsv'), emit: 'best_refseq_prot_hit' | |
58 path ('output/locustypes.tsv'), emit: 'locustypes' | |
59 path ('output/locus.lnk'), emit: 'locus' | |
60 path ('output/stats.xml'), emit: 'stats' | |
61 path ('output/*'), emit: 'all' | |
62 script: | |
63 """ | |
64 mkdir -p output | |
65 mkdir -p ./asncache/ | |
66 prime_cache -cache ./asncache/ -ifmt asnb-seq-entry -i $proteins_asn -oseq-ids /dev/null -split-sequences | |
67 | |
68 lds2_indexer -source genome/ -db LDS2 | |
69 echo "${best_prot_hit.join('\n')}" > best_prot_hit.mft | |
70 extract_prot_names -alns best_prot_hit.mft -nogenbank -o output/best_gnomon_prot_hit.tsv -asn-cache ./asncache/ -lds2 LDS2 | |
71 echo "${best_refseq_prot_hit.join('\n')}" > best_refseq_prot_hit.mft | |
72 extract_prot_names -alns best_refseq_prot_hit.mft -nogenbank -o output/best_refseq_prot_hit.tsv -asn-cache ./asncache/ -lds2 LDS2 | |
73 echo "${annotation.join('\n')}" > annotation.mft | |
74 echo "${curr_prev_compare.join('\n')}" > curr_prev_compare.mft | |
75 echo "${comparisons.join('\n')}" > comparisons.mft | |
76 str="" | |
77 if [ ! -z "$orthologs" ] | |
78 then | |
79 str="\$str -orthologs $orthologs" | |
80 fi | |
81 if [ ! -z "$lxr_data" ] | |
82 then | |
83 str="\$str -lxr $lxr_data" | |
84 else | |
85 touch lxr_data | |
86 str="\$str -lxr lxr_data" | |
87 fi | |
88 | |
89 if [ ! -z "$track_loci" ] | |
90 then | |
91 str="\$str -locus_track $track_loci" | |
92 else | |
93 touch track_loci | |
94 str="\$str -locus_track track_loci" | |
95 fi | |
96 if [ ! -z "$name_from_ortholog" ] | |
97 then | |
98 str="\$str -name_from_ortholog_rpt $name_from_ortholog" | |
99 else | |
100 touch name_from_ortholog | |
101 str="\$str -name_from_ortholog_rpt name_from_ortholog" | |
102 fi | |
103 | |
104 locus_type -no_acc_reserve -annots annotation.mft -gc $gencoll_asn -gnomon_biotype $gnomon_biotypes -o_stats output/stats.xml -o_locustypes output/locustypes.tsv -o_locus_lnk output/locus.lnk -annotcmp comparisons.mft -annotcmp_pb curr_prev_compare.mft \$str | |
105 """ | |
106 stub: | |
107 """ | |
108 mkdir -p output | |
109 touch output/best_gnomon_prot_hit.tsv | |
110 touch output/best_refseq_prot_hit.tsv | |
111 touch output/locustypes.tsv | |
112 touch output/locus.lnk | |
113 touch output/stats.xml | |
114 """ | |
115 } | |
116 |