Mercurial > repos > fubar > microsatbed
comparison microsatbed.xml @ 11:a633c1c45da3 draft
Uploaded
author | fubar |
---|---|
date | Sun, 14 Jul 2024 23:33:49 +0000 |
parents | |
children | ed885140970f |
comparison
equal
deleted
inserted
replaced
10:281592957c73 | 11:a633c1c45da3 |
---|---|
1 <tool name="STR to bed" id="microsatbed" version="1.3.0" profile="22.05"> | |
2 <description>Short Tandem Repeats to bed features from fasta</description> | |
3 <requirements> | |
4 <requirement version="3.12.3" type="package">python</requirement> | |
5 <requirement version="2.1.0" type="package">pyfastx</requirement> | |
6 <requirement version="1.3.0" type="package">pytrf</requirement> | |
7 </requirements> | |
8 <required_files> | |
9 <include path="find_str.py"/> | |
10 </required_files> | |
11 <version_command><![CDATA[python -c "import pytrf; from importlib.metadata import version; print(version('pytrf'))"]]></version_command> | |
12 <command><![CDATA[ | |
13 #if $mode_cond.mode == "NATIVE": | |
14 #if $reference_genome.genome_type_select == "history": | |
15 pytrf findstr -f '$mode_cond.outformat' -o $bed -r $mode_cond.monomin $mode_cond.dimin $mode_cond.trimin $mode_cond.tetramin $mode_cond.pentamin $mode_cond.hexamin '${reference_genome.fasta}' | |
16 #else: | |
17 pytrf findstr -f '$mode_cond.outformat' -o $bed -r $mode_cond.monomin $mode_cond.dimin $mode_cond.trimin $mode_cond.tetramin $mode_cond.pentamin $mode_cond.hexamin '${reference_genome.fasta.fields.path}' | |
18 #end if | |
19 #else: | |
20 python '${__tool_directory__}/find_str.py' | |
21 #if $reference_genome.genome_type_select == "history": | |
22 --fasta '${reference_genome.fasta}' | |
23 #else: | |
24 --fasta '${reference_genome.fasta.fields.path}' | |
25 #end if | |
26 --bed '$bed' | |
27 #if $mode_cond.mode == "SPECIFIC": | |
28 --specific '$mode_cond.specific' | |
29 --minreps '$mode_cond.minreps' | |
30 #else: | |
31 #if "MONO" in $mode_cond.subset: | |
32 --mono | |
33 #end if | |
34 #if "DI" in $mode_cond.subset: | |
35 --di | |
36 #end if | |
37 #if "TRI" in $mode_cond.subset: | |
38 --tri | |
39 #end if | |
40 #if "TETRA" in $mode_cond.subset: | |
41 --tetra | |
42 #end if | |
43 #if "PENTA" in $mode_cond.subset: | |
44 --penta | |
45 #end if | |
46 #if "HEXA" in $mode_cond.subset: | |
47 --hexa | |
48 #end if | |
49 --monomin '$mode_cond.monomin' | |
50 --dimin '$mode_cond.dimin' | |
51 --trimin '$mode_cond.trimin' | |
52 --tetramin '$mode_cond.tetramin' | |
53 --pentamin '$mode_cond.pentamin' | |
54 --hexamin '$mode_cond.hexamin' | |
55 #end if | |
56 #end if | |
57 ]]></command> | |
58 <inputs> | |
59 <conditional name="reference_genome"> | |
60 <param name="genome_type_select" type="select" label="Select a source for fasta sequences to be searched for STRs" help="Options are to choose a built-in genome, or choose any history fasta file"> | |
61 <option value="indexed">Use a Galaxy server built-in reference genome fasta</option> | |
62 <option value="history" selected="True">Use any fasta file from the current history</option> | |
63 </param> | |
64 <when value="indexed"> | |
65 <param name="fasta" type="select" multiple="false" label="Choose a built-in genome" | |
66 help="If the genome you need is not on the list, upload it and select it as a current history fasta"> | |
67 <options from_data_table="all_fasta"/> | |
68 </param> | |
69 </when> | |
70 <when value="history"> | |
71 <param name="fasta" type="data" format="fasta,fasta.gz" optional="false" multiple="false" label="Choose a fasta file from the current history"/> | |
72 </when> | |
73 </conditional> | |
74 <conditional name="mode_cond"> | |
75 <param name="mode" type="select" label="Select patterns by motif length; or provide a specific motif pattern to report?" help="Choose *By length:* or *By pattern:* to configure STR selection mode"> | |
76 <option selected="True" value="ALL">By length: Report all motifs of one or more specified lengths (1-6nt) as bed features</option> | |
77 <option value="SPECIFIC">By motif: Report one or more specific motifs (such as TCA,GC) as bed features</option> | |
78 <option value="NATIVE">All exact STR: use the pytrf findstr native command to a create csv, tsv or gtf output</option> | |
79 </param> | |
80 <when value="ALL"> | |
81 <param name="subset" type="select" multiple="true" optional="false" label="Select at least 1 specific motif length to report" | |
82 help="Bed features will be output for every motif of the selected length(s) with the minimum required repeats or more"> | |
83 <option value="DI" selected="true">All dimers (AC,AG,AT,...)</option> | |
84 <option value="TRI">All trimers (ACG,..)</option> | |
85 <option value="TETRA">All tetramers (ACGT,..)</option> | |
86 <option value="PENTA">All pentamers (ACGTC,..)</option> | |
87 <option value="HEXA">All hexamers (ACGTCG,..)</option> | |
88 <option value="MONO">All monomers (A,C...). Warning! Can produce overwhelming numbers of bed features</option> | |
89 </param> | |
90 <param name="dimin" type="integer" value="2" min="1" label="Minimum number of repeats for dimers"/> | |
91 <param name="trimin" type="integer" value="2" min="2" label="Minimum number of repeats for trimers"/> | |
92 <param name="tetramin" type="integer" value="2" min="2" label="Minimum number of repeats for tetramers"/> | |
93 <param name="pentamin" type="integer" value="2" min="2" label="Minimum number of repeats for pentamers"/> | |
94 <param name="hexamin" type="integer" value="2" min="2" label="Minimum number of repeats for hexamers"/> | |
95 <param name="monomin" type="integer" value="2" min="2" label="Minimum number of repeats for monomers"/> | |
96 </when> | |
97 <when value="SPECIFIC"> | |
98 <param name="specific" type="text" label="Supply a specific motif pattern. Separate multiple patterns with commas such as GA,GC" | |
99 help="Make bed features only for the nominated specific motifs." optional="false"/> | |
100 <param name="minreps" type="integer" value="2" min="2" label="Minimum number of repeats of each of these motifs to report" | |
101 help="Short tandem repeats require 2 or more consecutive motifs by definition. WARNING: If monomers are included, every single matching base will be reported as a STR if minimum repeats = 1!" | |
102 optional="false"/> | |
103 </when> | |
104 <when value="NATIVE"> | |
105 <param name="outformat" type="select" optional="false" label="Select the required output format" | |
106 help="Pytrf can create GFF, CSV or TSV output files. Documentation is linked in the help section below"> | |
107 <option value="gff" >GFF</option> | |
108 <option value="csv">Comma separated values</option> | |
109 <option value="tsv" selected="true">Tab separated values</option> | |
110 </param> | |
111 <param name="monomin" type="integer" value="2" min="2" label="Minimum number of repeats for monomers"/> | |
112 <param name="dimin" type="integer" value="2" min="1" label="Minimum number of repeats for dimers"/> | |
113 <param name="trimin" type="integer" value="2" min="2" label="Minimum number of repeats for trimers"/> | |
114 <param name="tetramin" type="integer" value="2" min="2" label="Minimum number of repeats for tetramers"/> | |
115 <param name="pentamin" type="integer" value="2" min="2" label="Minimum number of repeats for pentamers"/> | |
116 <param name="hexamin" type="integer" value="2" min="2" label="Minimum number of repeats for hexamers"/> | |
117 </when> | |
118 </conditional> | |
119 </inputs> | |
120 <outputs> | |
121 <data name="bed" format="bed" label="STR from $fasta.element_identifier" hidden="false"> | |
122 <change_format> | |
123 <when input="mode_cond.outformat" value="gff" format="gff" /> | |
124 <when input="mode_cond.outformat" value="csv" format="csv" /> | |
125 <when input="mode_cond.outformat" value="tsv" format="tabular" /> | |
126 </change_format> | |
127 </data> | |
128 </outputs> | |
129 <tests> | |
130 <test expect_num_outputs="1"> | |
131 <conditional name="reference_genome"> | |
132 <param name="genome_type_select" value="history"/> | |
133 <param name="fasta" value="humsamp.fa"/> | |
134 </conditional> | |
135 <conditional name="mode_cond"> | |
136 <param name="mode" value="ALL"/> | |
137 <param name="subset" value="DI,TRI,TETRA,PENTA,HEXA"/> | |
138 <param name="dimin" value="2"/> | |
139 <param name="trimin" value="2"/> | |
140 <param name="tetramin" value="2"/> | |
141 <param name="pentamin" value="2"/> | |
142 <param name="hexamin" value="2"/> | |
143 </conditional> | |
144 <output name="bed" value="bed_sample" compare="diff" lines_diff="0"/> | |
145 </test> | |
146 <test expect_num_outputs="1"> | |
147 <conditional name="reference_genome"> | |
148 <param name="genome_type_select" value="history"/> | |
149 <param name="fasta" value="humsamp.fa"/> | |
150 </conditional> | |
151 <conditional name="mode_cond"> | |
152 <param name="mode" value="SPECIFIC"/> | |
153 <param name="specific" value="GC"/> | |
154 <param name="minreps" value="2"/> | |
155 </conditional> | |
156 <output name="bed" value="dibed_sample" compare="diff" lines_diff="0"/> | |
157 </test> | |
158 <test expect_num_outputs="1"> | |
159 <conditional name="reference_genome"> | |
160 <param name="genome_type_select" value="history"/> | |
161 <param name="fasta" value="mouse.fa"/> | |
162 </conditional> | |
163 <conditional name="mode_cond"> | |
164 <param name="mode" value="NATIVE"/> | |
165 <param name="outformat" value="gff"/> | |
166 <param name="monomin" value="20"/> | |
167 <param name="dimin" value="10"/> | |
168 <param name="trimin" value="5"/> | |
169 <param name="tetramin" value="4"/> | |
170 <param name="pentamin" value="4"/> | |
171 <param name="hexamin" value="2"/> | |
172 </conditional> | |
173 <output name="bed" value="nativegff_sample" compare="diff" lines_diff="0"/> | |
174 </test> | |
175 </tests> | |
176 <help><![CDATA[ | |
177 | |
178 **Convert short repetitive sequences to bed features** | |
179 | |
180 Microsatellites are usually defined as repeated short DNA patterns in an unbroken sequence. | |
181 A microsatellite pattern or *motif* can be any combination nucleotides, typically from 1 to 6nt in length. | |
182 | |
183 This tool allows microsatellite and related features to be selected from a fasta sequence input file, and output into a single bed track, suitable for viewing in a genome browser such as JBrowse2. | |
184 | |
185 All motifs of selected lengths can be reported as individual features in the output bed file, or specific motifs can be provided and all | |
186 others will be ignored. In all cases, a minimum required number of repeats can be specified. For example, requiring 2 or more repeats of the trimer *ACG* will report | |
187 every sequence of *ACGACG* or *ACGACGACG* or *ACGACGACGACG* and so on, as individual bed features. Similarly, requiring 3 repeats of any trimer will | |
188 report every distinct 3 nucleotide pattern, including *ACGACGACG* as well as every other unique 3 nucleotide pattern with 3 sequential repeats or more such, as "CTCCTCCTC*. | |
189 | |
190 For other output formats, the pytrf native command line *findstr* can be used to produce a gff, csv or tsv output containing all exact short tandem repeats, as | |
191 described at the end of https://pytrf.readthedocs.io/en/latest | |
192 | |
193 A fasta file must be supplied for processing. A built in genome can be selected, or a fasta file of any kind can be selected from the current history. Note that all | |
194 symbols are treated as valid nucleotides by pytrf, so extraneous characters such as *-* or *N* in the input fasta may appear as unexpected bed features. Lower case fasta symbols will be converted | |
195 to uppercase, to prevent them being reported as distinct motifs. | |
196 | |
197 | |
198 **Select motifs by length** | |
199 | |
200 The default tool form setting is to select all dimer motif patterns. | |
201 | |
202 Additional motif lengths from 1 to 6nt can be selected in the multiple-select drop-down list. All features will be returned in a single bed file. For each selected motif length, | |
203 the minimum number of repeats required for reporting can be adjusted. **Tandem repeats** are defined as at least 2 of any pattern. This tool allows singleton motifs to be reported, | |
204 so is not restricted to short tandem repeats (STR) | |
205 | |
206 **Select motifs by pattern** | |
207 | |
208 This option allows a motif pattern to be specified as a text string such as *CG* or *ATC*. Multiple motifs can be specified as a comma separated string such as *CG,ATC*. | |
209 All features will be returned as a single bed file. | |
210 | |
211 The minimum number of repeats for all motifs can be set to match specific requirements. | |
212 | |
213 For example, technical sequencing read bias may be influenced by the density of specific dimers, whether they are repeated or not | |
214 such as in https://github.com/arangrhie/T2T-Polish/tree/master/pattern | |
215 | |
216 **Select all perfect STR using pytrf findstr in csv, tsv or gff output format** | |
217 | |
218 This selection runs the pytrf *findstr* option to create gff/csv/tsv outputs as described at the end of https://pytrf.readthedocs.io/en/latest/. | |
219 | |
220 Quoted here: | |
221 | |
222 *A Tandem repeat (TR) in genomic sequence is a set of adjacent short DNA sequence repeated consecutively. The core sequence or repeat unit is generally called motif. | |
223 According to the motif length, tandem repeats can be classified as microsatellites and minisatellites. Microsatellites are also known as simple sequence repeats (SSRs) | |
224 or short tandem repeats (STRs) with motif length of 1-6 bp. Minisatellites are also sometimes referred to as variable number of tandem repeats (VNTRs) has longer motif length than microsatellites. | |
225 Pytrf is a lightweight Python C extension for identification of tandem repeats. The pytrf enables to fastly identify both exact or perfect SSRs. | |
226 It also can find generic tandem repeats with any size of motif, such as with maximum motif length of 100 bp. Additionally, it has capability of finding approximate or imperfect tandem repeats* | |
227 | |
228 ]]></help> | |
229 <citations> | |
230 <citation type="bibtex">@misc{pytrf, | |
231 title = {{pytrf} Short tandem repeat finder, Accessed on July 10 2024}, | |
232 howpublished = {\url{https://github.com/lmdu/pytrf}}, | |
233 note = {Accessed on July 10 2024} | |
234 }</citation> | |
235 </citations> | |
236 </tool> | |
237 |