comparison stacks_cstacks.xml @ 4:924e7889aa05 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks2 commit 4e87a14a5479800df9675c1cbcdbe1b11f63653b-dirty
author matthias
date Wed, 27 Feb 2019 09:51:06 -0500
parents 61afc5a3cd8e
children
comparison
equal deleted inserted replaced
3:61afc5a3cd8e 4:924e7889aa05
1 <tool id="stacks2_cstacks" name="Stacks2: cstacks" version="@STACKS_VERSION@+galaxy@WRAPPER_VERSION@"> 1 <tool id="stacks2_cstacks" name="Stacks2: cstacks" profile="@PROFILE@" version="@STACKS_VERSION@+galaxy@WRAPPER_VERSION@">
2 <description>build a catalogue of loci</description> 2 <description>Generate catalog of loci</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 </macros> 5 </macros>
6 <expand macro="requirements"/> 6 <expand macro="requirements"/>
7 <expand macro="stdio"/> 7 <expand macro="version_cmd"/>
8 <command><![CDATA[ 8 <command detect_errors="aggressive"><![CDATA[
9 #import re 9 #import re
10 10
11 mkdir stacks_inputs stacks_outputs 11 mkdir stacks_inputs stacks_outputs
12 && 12 &&
13 13
14 ## for each input collection 14 @LINK_STACKS_INPUT@
15 ## - create links all tsv files that are not catalog
16 ## (ustacks produces ony tags, alleles, snps, ie eventually
17 ## present catalogs are ignored)
18 ## link name is element_identifier(.tsv)
19 ## - create -s sample1prefix -s sample2prefix ..
20
21 #set $samples = ""
22 #for $input_file in $input_cat
23 #set $filename = str($input_file.element_identifier)
24 #if not filename.endswith('.tsv')
25 #set $filename = $filename + ".tsv"
26 #end if
27 #if not re.search('catalog\.[a-z]+(\.tsv)?$', $filename)
28 ln -s '${input_file}' 'stacks_inputs/$filename' &&
29
30 #if $filename.endswith('.tags.tsv')
31 #set samples += " -s 'stacks_inputs/" + $filename[:-9] + "'"
32 #end if
33 #end if
34 #end for
35 15
36 cstacks 16 cstacks
37 17
38 -p \${GALAXY_SLOTS:-1} 18 -p \${GALAXY_SLOTS:-1}
39 19
40 #if $popmap 20 #if $popmap
41 -P stacks_inputs 21 -P stacks_inputs
42 -M '$popmap' 22 -M '$popmap'
43 #else 23 #else
44 $samples 24 #for $sample in $samples
25 -s 'stacks_inputs/$sample'
26 #end for
45 -o stacks_outputs 27 -o stacks_outputs
46 #end if 28 #end if
47 29
48 -n $n 30 -n $n
49 ## -c not implemented in Galaxy (appending can be done in Galaxy) 31 ## -c not implemented in Galaxy (appending can be done in Galaxy)
53 ## Advanced Options 35 ## Advanced Options
54 #if $k_len: 36 #if $k_len:
55 --k_len $k_len 37 --k_len $k_len
56 #end if 38 #end if
57 $report_mmatches 39 $report_mmatches
58 @TEE_APPEND_LOG@ 40 @TEE_APPEND_LOG@
59 @CAT_LOG_TO_STDERR@ 41 @CAT_LOG_TO_STDERR@
60 42
61 #if $popmap 43 #if $popmap
62 ## When using a popmap, cstacks writes to the input dir 44 ## When using a popmap, cstacks writes to the input dir
63 && mv stacks_inputs/catalog.*.tsv stacks_outputs/ 45 && mv stacks_inputs/catalog.*.tsv stacks_outputs/
64 #end if 46 #end if
65 47
66 ]]></command> 48 ]]></command>
67 49
68 <inputs> 50 <inputs>
69 <expand macro="input_cat_macro"/> 51 <expand macro="input_stacks_macro"/>
70 52
71 <param name="popmap" type="data" format="tabular,txt" label="Population map" help="If set, the catalog will be built from samples listed in this file" optional="true" argument="-M" /> 53 <param name="popmap" type="data" format="tabular,txt" label="Population map" help="If set, the catalog will be built from samples listed in this file" optional="true" argument="-M" />
72 54
73 <param argument="-n" type="integer" value="1" label="Number of mismatches allowed between sample loci when building the catalog" help="(default 1; suggested: set to ustacks -M)"/> 55 <param argument="-n" type="integer" value="1" label="Number of mismatches allowed between sample loci when building the catalog" help="(default 1; suggested: set to ustacks -M)"/>
74 56
75 <expand macro="gap_options"/> 57 <expand macro="gap_options"/>
76 <param argument="--k_len" type="integer" min="5" max="31" value="" optional="true" label="k-mer size for matching between between catalog loci" help="default: automatic"/> 58 <param argument="--k_len" type="integer" min="5" max="31" value="" optional="true" label="K-mer size for matching between between catalog loci" help="default: automatic"/>
77 <param argument="--report_mmatches" type="boolean" checked="false" truevalue="--report_mmatches" falsevalue="" label="report query loci that match more than one catalog locus" /> 59 <param argument="--report_mmatches" type="boolean" checked="false" truevalue="--report_mmatches" falsevalue="" label="Report query loci that match more than one catalog locus" />
78 <expand macro="in_log"/> 60 <expand macro="in_log"/>
79 </inputs> 61 </inputs>
80 62
81 <outputs> 63 <outputs>
82 <expand macro="out_log"/> 64 <expand macro="out_log"/>
83 <expand macro="cstacks_outputs_macro"/> 65 <expand macro="cstacks_outputs_macro"/>
84 </outputs> 66 </outputs>
85 67
86 <tests> 68 <tests>
87 <!-- TODO add test w popmap --> 69 <!-- test w default options + popmap -->
70 <test>
71 <param name="input_stacks">
72 <collection type="list">
73 <element name="PopA_01.alleles" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" />
74 <element name="PopA_01.snps" ftype="tabular" value="ustacks/PopA_01.snps.tsv" />
75 <element name="PopA_01.tags" ftype="tabular" value="ustacks/PopA_01.tags.tsv" />
76 <element name="PopA_02.alleles" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" />
77 <element name="PopA_02.snps" ftype="tabular" value="ustacks/PopA_02.snps.tsv" />
78 <element name="PopA_02.tags" ftype="tabular" value="ustacks/PopA_02.tags.tsv" />
79 </collection>
80 </param>
81 <param name="popmap" ftype="tabular" value="denovo_map/popmap_cstacks.tsv" />
82 <param name="add_log" value="yes" />
83 <output name="output_log" ftype="txt" file="cstacks/cstacks.log"/>
84 <output_collection name="catalog" type="list">
85 <element name="catalog.alleles" file="cstacks/catalog.alleles.tsv" ftype="tabular" lines_diff="2"/>
86 <element name="catalog.snps" file="cstacks/catalog.snps.tsv" ftype="tabular" lines_diff="2" />
87 <element name="catalog.tags" file="cstacks/catalog.tags.tsv" ftype="tabular" lines_diff="2" />
88 </output_collection>
89 </test>
88 <!-- test w default options --> 90 <!-- test w default options -->
89 <test> 91 <test>
90 <param name="input_cat"> 92 <param name="input_stacks">
91 <collection type="list"> 93 <collection type="list">
92 <element name="PopA_01.alleles.tsv" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" /> 94 <element name="PopA_01.alleles" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" />
93 <element name="PopA_01.snps.tsv" ftype="tabular" value="ustacks/PopA_01.snps.tsv" /> 95 <element name="PopA_01.snps" ftype="tabular" value="ustacks/PopA_01.snps.tsv" />
94 <element name="PopA_01.tags.tsv" ftype="tabular" value="ustacks/PopA_01.tags.tsv" /> 96 <element name="PopA_01.tags" ftype="tabular" value="ustacks/PopA_01.tags.tsv" />
95 <element name="PopA_02.alleles.tsv" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" /> 97 <element name="PopA_02.alleles" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" />
96 <element name="PopA_02.snps.tsv" ftype="tabular" value="ustacks/PopA_02.snps.tsv" /> 98 <element name="PopA_02.snps" ftype="tabular" value="ustacks/PopA_02.snps.tsv" />
97 <element name="PopA_02.tags.tsv" ftype="tabular" value="ustacks/PopA_02.tags.tsv" /> 99 <element name="PopA_02.tags" ftype="tabular" value="ustacks/PopA_02.tags.tsv" />
98 </collection> 100 </collection>
99 </param> 101 </param>
100 <param name="add_log" value="yes" /> 102 <param name="add_log" value="yes" />
101 <output name="output_log"><assert_contents><has_text text="done." /></assert_contents></output> 103 <output name="output_log"><assert_contents><has_text text="done." /></assert_contents></output>
102 <output_collection name="catalog" type="list"> 104 <output_collection name="catalog" type="list">
105 <element name="catalog.tags" file="cstacks/catalog.tags.tsv" ftype="tabular" lines_diff="2" /> 107 <element name="catalog.tags" file="cstacks/catalog.tags.tsv" ftype="tabular" lines_diff="2" />
106 </output_collection> 108 </output_collection>
107 </test> 109 </test>
108 <!-- test w non default options (wo gapped, because tested already in ustacks) --> 110 <!-- test w non default options (wo gapped, because tested already in ustacks) -->
109 <test> 111 <test>
110 <param name="input_cat"> 112 <param name="input_stacks">
111 <collection type="list"> 113 <collection type="list">
112 <element name="PopA_01.alleles.tsv" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" /> 114 <element name="PopA_01.alleles" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" />
113 <element name="PopA_01.snps.tsv" ftype="tabular" value="ustacks/PopA_01.snps.tsv" /> 115 <element name="PopA_01.snps" ftype="tabular" value="ustacks/PopA_01.snps.tsv" />
114 <element name="PopA_01.tags.tsv" ftype="tabular" value="ustacks/PopA_01.tags.tsv" /> 116 <element name="PopA_01.tags" ftype="tabular" value="ustacks/PopA_01.tags.tsv" />
115 <element name="PopA_02.alleles.tsv" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" /> 117 <element name="PopA_02.alleles" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" />
116 <element name="PopA_02.snps.tsv" ftype="tabular" value="ustacks/PopA_02.snps.tsv" /> 118 <element name="PopA_02.snps" ftype="tabular" value="ustacks/PopA_02.snps.tsv" />
117 <element name="PopA_02.tags.tsv" ftype="tabular" value="ustacks/PopA_02.tags.tsv" /> 119 <element name="PopA_02.tags" ftype="tabular" value="ustacks/PopA_02.tags.tsv" />
118 </collection> 120 </collection>
119 </param> 121 </param>
120 <param name="n" value="2"/> 122 <param name="n" value="2"/>
121 <param name="k_len" value="23"/> 123 <param name="k_len" value="23"/>
122 <param name="report_mmatches" value="--report_mmatches" /> 124 <param name="report_mmatches" value="--report_mmatches" />
144 146
145 -------- 147 --------
146 148
147 **Input files** 149 **Input files**
148 150
149 Output from denovo_map, refmap, or ustacks 151 Output from denovo_map or ustacks
150 152
151 **Output files** 153 **Output files**
152 154
153 - XXX.tags.tsv file: 155 - catalog.tags file:
154 156
155 See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_ 157 See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_
156 158
157 Notes: For the tags file, each stack will start in the file with a consensus sequence for the entire stack followed by the flags for that stack. Then, each individual read that was merged into that stack will follow. The next stack will start with another consensus sequence. 159 Notes: For the tags file, each stack will start in the file with a consensus sequence for the entire stack followed by the flags for that stack. Then, each individual read that was merged into that stack will follow. The next stack will start with another consensus sequence.
158 160
159 161
160 - XXX.snps.tsv file: 162 - catalog.snps file:
161 163
162 See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_ 164 See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_
163 165
164 Notes: If a stack has two SNPs called within it, then there will be two lines in this file listing each one. 166 Notes: If a stack has two SNPs called within it, then there will be two lines in this file listing each one.
165 167
166 168
167 - XXX.alleles.tsv file: 169 - catalog.alleles file:
168 170
169 See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_ 171 See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_
170 172
171 @STACKS_INFOS@ 173 @STACKS_INFOS@
172 ]]> 174 ]]>