comparison stacks_cstacks.xml @ 0:e4b371f8a47a draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks2 commit 98327d2948ae1ccb5aef5db9ab88605fd74a0de7-dirty
author matthias
date Thu, 29 Nov 2018 11:41:18 -0500
parents
children d31714d7f03e
comparison
equal deleted inserted replaced
-1:000000000000 0:e4b371f8a47a
1 <tool id="stacks2_cstacks" name="Stacks2: cstacks" version="@WRAPPER_VERSION@">
2 <description>build a catalogue of loci</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="requirements"/>
7 <expand macro="stdio"/>
8 <command><![CDATA[
9 #import re
10
11 mkdir stacks_inputs stacks_outputs
12 &&
13
14 ## for each input collection
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_col
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
36 cstacks
37
38 -p \${GALAXY_SLOTS:-1}
39
40 #if $popmap
41 -P stacks_inputs
42 -M '$popmap'
43 #else
44 $samples
45 -o stacks_outputs
46 #end if
47
48 -n $n
49 ## -c not implemented in Galaxy (appending can be done in Galaxy)
50
51 @GAP_OPTIONS@
52
53 ## Advanced Options
54 #if $k_len:
55 --k_len $k_len
56 #end if
57 $report_mmatches
58 @TEE_APPEND_LOG@
59 @CAT_LOG_TO_STDERR@
60
61 #if $popmap
62 ## When using a popmap, cstacks writes to the input dir
63 && mv stacks_inputs/catalog.*.tsv stacks_outputs/
64 #end if
65
66 ]]></command>
67
68 <inputs>
69 <param name="input_col" format="tabular,txt" type="data_collection" collection_type="list" label="Output from previous Stacks pipeline steps (e.g. denovo_map, refmap, ustacks or pstacks)" />
70
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" />
72
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)"/>
74
75 <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"/>
77 <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"/>
79 </inputs>
80
81 <outputs>
82 <expand macro="out_log"/>
83 <expand macro="cstacks_outputs_macro"/>
84 </outputs>
85
86 <tests>
87 <!-- TODO add test w popmap -->
88 <!-- test w default options -->
89 <test>
90 <param name="input_col">
91 <collection type="list">
92 <element name="PopA_01.alleles.tsv" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" />
93 <element name="PopA_01.snps.tsv" ftype="tabular" value="ustacks/PopA_01.snps.tsv" />
94 <element name="PopA_01.tags.tsv" ftype="tabular" value="ustacks/PopA_01.tags.tsv" />
95 <element name="PopA_02.alleles.tsv" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" />
96 <element name="PopA_02.snps.tsv" ftype="tabular" value="ustacks/PopA_02.snps.tsv" />
97 <element name="PopA_02.tags.tsv" ftype="tabular" value="ustacks/PopA_02.tags.tsv" />
98 </collection>
99 </param>
100 <param name="add_log" value="yes" />
101 <output name="output_log"><assert_contents><has_text text="done." /></assert_contents></output>
102 <output_collection name="catalog" type="list">
103 <element name="catalog.alleles" file="cstacks/catalog.alleles.tsv" ftype="tabular" lines_diff="2"/>
104 <element name="catalog.snps" file="cstacks/catalog.snps.tsv" ftype="tabular" lines_diff="2" />
105 <element name="catalog.tags" file="cstacks/catalog.tags.tsv" ftype="tabular" lines_diff="2" />
106 </output_collection>
107 </test>
108 <!-- test w non default options (wo gapped, because tested already in ustacks) -->
109 <test>
110 <param name="input_col">
111 <collection type="list">
112 <element name="PopA_01.alleles.tsv" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" />
113 <element name="PopA_01.snps.tsv" ftype="tabular" value="ustacks/PopA_01.snps.tsv" />
114 <element name="PopA_01.tags.tsv" ftype="tabular" value="ustacks/PopA_01.tags.tsv" />
115 <element name="PopA_02.alleles.tsv" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" />
116 <element name="PopA_02.snps.tsv" ftype="tabular" value="ustacks/PopA_02.snps.tsv" />
117 <element name="PopA_02.tags.tsv" ftype="tabular" value="ustacks/PopA_02.tags.tsv" />
118 </collection>
119 </param>
120 <param name="n" value="2"/>
121 <param name="k_len" value="23"/>
122 <param name="report_mmatches" value="--report_mmatches" />
123 <assert_command>
124 <has_text text="--k_len 23" />
125 <has_text text="-n 2" />
126 <has_text text="--report_mmatches" />
127 </assert_command>
128 <param name="add_log" value="yes" />
129 <output name="output_log"><assert_contents><has_text text="done." /></assert_contents></output>
130 <output_collection name="catalog" type="list">
131 <element name="catalog.alleles" file="cstacks/catalog.alleles.tsv" ftype="tabular" lines_diff="2"/>
132 <element name="catalog.snps" file="cstacks/catalog.snps.tsv" ftype="tabular" lines_diff="2" />
133 <element name="catalog.tags" file="cstacks/catalog.tags.tsv" ftype="tabular" lines_diff="2" />
134 </output_collection>
135 </test>
136 </tests>
137 <help>
138 <![CDATA[
139 .. class:: infomark
140
141 **What it does**
142
143 A catalog can be built from any set of samples processed by the ustacks or pstacks programs. It will create a set of consensus loci, merging alleles together. In the case of a genetic cross, a catalog would be constructed from the parents of the cross to create a set of all possible alleles expected in the progeny of the cross.
144
145 --------
146
147 **Input files**
148
149 Output from denovo_map, refmap, ustacks or pstacks
150
151 **Output files**
152
153 - XXX.tags.tsv file:
154
155 See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_
156
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.
158
159
160 - XXX.snps.tsv file:
161
162 See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_
163
164 Notes: If a stack has two SNPs called within it, then there will be two lines in this file listing each one.
165
166
167 - XXX.alleles.tsv file:
168
169 See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_
170
171 @STACKS_INFOS@
172 ]]>
173 </help>
174 <expand macro="citation" />
175 </tool>