Mercurial > repos > jjohnson > peptideshaker
comparison searchgui.xml @ 0:8b99cb00e1c4 draft
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/peptideshaker commit 3c83b8f8ca60d6399bc5dd7096b830ca1f1c457e-dirty
author | jjohnson |
---|---|
date | Tue, 15 May 2018 14:50:35 -0400 |
parents | |
children | fa76abf69433 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:8b99cb00e1c4 |
---|---|
1 <tool id="search_gui" name="Search GUI" version="@SEARCHGUI_VERSION@.0"> | |
2 <description> | |
3 Perform protein identification using various search engines and prepare results for input to Peptide Shaker | |
4 </description> | |
5 <macros> | |
6 <import>macros_basic.xml</import> | |
7 </macros> | |
8 <requirements> | |
9 <requirement type="package" version="@SEARCHGUI_VERSION@">searchgui</requirement> | |
10 <requirement type="package" version="3.0">zip</requirement> | |
11 <requirement type="package">JQ</requirement> | |
12 </requirements> | |
13 <expand macro="stdio" /> | |
14 <command> | |
15 <![CDATA[ | |
16 #from datetime import datetime | |
17 #import json | |
18 #import os; | |
19 #set $exp_str = "Galaxy_Experiment_%s" % datetime.now().strftime("%Y%m%d%H%M%s") | |
20 #set $samp_str = "Sample_%s" % datetime.now().strftime("%Y%m%d%H%M%s") | |
21 #set $temp_stderr = "searchgui_stderr" | |
22 #set $bin_dir = "bin" | |
23 | |
24 mkdir output; | |
25 mkdir output_reports; | |
26 cwd=`pwd`; | |
27 export HOME=\$cwd; | |
28 | |
29 ## echo the search engines to run | |
30 echo "$search_engines_options.engines"; | |
31 | |
32 ##Create a searchgui.properties file for the version, which will be added to the searchgui_results if not already present | |
33 echo "searchgui.version=@SEARCHGUI_VERSION@" >> searchgui.properties; | |
34 | |
35 #for $mgf in $peak_lists: | |
36 #set $input_name = $mgf.display_name.split('/')[-1].replace(".mgf", "") + ".mgf" | |
37 ln -s -f '${mgf}' '${input_name}'; | |
38 #set $encoded_id = $__app__.security.encode_id($mgf.id) | |
39 echo "Spectrums:${mgf.display_name}(API:${encoded_id}) "; | |
40 #end for | |
41 | |
42 | |
43 | |
44 ## Necessary for executing tests. The FASTA file has to be manually copied from the test-data folder to the working directory in order it can be found when using the PAR file. | |
45 cp '$__tool_directory__/test-data/searchgui_tinydb1_concatenated_target_decoy.fasta' "\$cwd/searchgui_tinydb1_concatenated_target_decoy.fasta"; | |
46 | |
47 | |
48 | |
49 ## copy the input .par file to the working folder | |
50 cp "${input_par}" "\$cwd/SEARCHGUI_IdentificationParameters.par"; | |
51 echo "-.par source file:"; | |
52 echo "${input_par}"; | |
53 | |
54 ## (local) PAR file points to a FASTA file with .dat extension, which gives problems with many search engines. We should rename it to a .fasta file before passing it to SearchGUI | |
55 #set $par_target_path = "$cwd/SEARCHGUI_IdentificationParameters.par"; | |
56 echo "-.par target file:"; | |
57 echo $par_target_path; | |
58 | |
59 ## reading from the original .par file the path of the source .dat (fasta) file to be used | |
60 content_par_target_path=`cat $par_target_path`; | |
61 dat_path=`jq -r '.searchParameters.fastaFile.path' <<< "\$content_par_target_path"`; | |
62 echo "-.dat file path from target .par: "; | |
63 echo "\$dat_path"; | |
64 | |
65 ## copy original .data fasta file to a local .fasta file | |
66 new_fasta_file_path="\$cwd/input_database.fasta"; | |
67 cp "\$dat_path" "\$new_fasta_file_path"; | |
68 echo "-new .fasta file path copied from source .dat file: "; | |
69 echo "\$new_fasta_file_path"; | |
70 | |
71 ## modifying the .par file!! | |
72 ## First we establish the new content for the path: .searchParameters.fastaFile.path | |
73 new_content_par_target_path=`jq '.searchParameters.fastaFile.path = \$newVal' --arg newVal "\$new_fasta_file_path" <<< "\$content_par_target_path"`; | |
74 ## Secondly, for .proteinInferencePreferences.proteinSequenceDatabase.path | |
75 new_content_par_target_path=`jq '.proteinInferencePreferences.proteinSequenceDatabase.path = \$newVal' --arg newVal "\$new_fasta_file_path" <<< "\$new_content_par_target_path"`; | |
76 | |
77 ## we generate a new .par file filled with the new fasta path. | |
78 #set $new_par_target_path = "$cwd/SEARCHGUI_IdentificationParameters_new.par"; | |
79 echo "\$new_content_par_target_path" >> $new_par_target_path; | |
80 echo "-new par target path: "; | |
81 echo $new_par_target_path; | |
82 | |
83 ## As PeptideShaker waits for "SEARCHGUI_IdentificationParameters.par" name, we overwrite the original file with the "_new" file | |
84 ##mv "\$cwd/SEARCHGUI_IdentificationParameters_new.par" "\$cwd/SEARCHGUI_IdentificationParameters.par" | |
85 rm $par_target_path; | |
86 mv $new_par_target_path $par_target_path; | |
87 | |
88 | |
89 ################ | |
90 ## Search CLI ## | |
91 ################ | |
92 (searchgui -Djava.awt.headless=true eu.isas.searchgui.cmd.SearchCLI | |
93 --exec_dir="\$cwd/${bin_dir}" | |
94 -temp_folder `pwd` | |
95 -spectrum_files \$cwd | |
96 -output_folder \$cwd/output | |
97 -id_params $par_target_path | |
98 | |
99 -threads "\${GALAXY_SLOTS:-12}" | |
100 | |
101 #if $searchgui_advanced.searchgui_advanced_selector == 'advanced' | |
102 -correct_titles "${searchgui_advanced.correct_titles}" | |
103 $searchgui_advanced.missing_titles | |
104 -mgf_splitting "${searchgui_advanced.mgf_splitting}" | |
105 -mgf_spectrum_count "${searchgui_advanced.mgf_spectrum_count}" | |
106 #end if | |
107 | |
108 ## Turn of the protein tree generation as it can produce errors if the search is finished before the tree is created | |
109 ## the tree is generated afterwards in PeptideShaker | |
110 ## -protein_index 0 | |
111 | |
112 ##-makeblastdb_folder \$BLAST_ROOT_DIR | |
113 | |
114 #set $engines_list = str($search_engines_options.engines).split(',') | |
115 #if 'X!Tandem' in $engines_list: | |
116 -xtandem 1 | |
117 #else | |
118 -xtandem 0 | |
119 #end if | |
120 | |
121 #if 'MyriMatch' in $engines_list: | |
122 -myrimatch 1 | |
123 #else | |
124 -myrimatch 0 | |
125 #end if | |
126 | |
127 #if 'MSGF' in $engines_list: | |
128 -msgf 1 | |
129 #else | |
130 -msgf 0 | |
131 #end if | |
132 | |
133 #if 'OMSSA' in $engines_list: | |
134 -omssa 1 | |
135 #else | |
136 -omssa 0 | |
137 #end if | |
138 | |
139 #if 'Comet' in $engines_list: | |
140 -comet 1 | |
141 #else | |
142 -comet 0 | |
143 #end if | |
144 | |
145 #if 'Tide' in $engines_list: | |
146 -tide 1 | |
147 #else | |
148 -tide 0 | |
149 #end if | |
150 | |
151 #if 'MS_Amanda' in $engines_list: | |
152 -ms_amanda 1 | |
153 #else | |
154 -ms_amanda 0 | |
155 #end if | |
156 | |
157 #if 'Andromeda' in $engines_list: | |
158 -andromeda 1 | |
159 #else | |
160 -andromeda 0 | |
161 #end if | |
162 | |
163 #if 'Novor' in $engines_list: | |
164 -novor 1 | |
165 #else | |
166 -novor 0 | |
167 #end if | |
168 | |
169 #if 'DirecTag' in $engines_list: | |
170 -directag 1 | |
171 #else | |
172 -directag 0 | |
173 #end if | |
174 | |
175 ## single zip file | |
176 -output_option 0 | |
177 | |
178 ## mgf and database in output | |
179 -output_data 1 | |
180 | |
181 2>> $temp_stderr) | |
182 | |
183 && | |
184 | |
185 (mv output/searchgui_out.zip searchgui_out.zip 2>> $temp_stderr) | |
186 | |
187 && | |
188 | |
189 (zip -u searchgui_out.zip searchgui.properties 2>> $temp_stderr); | |
190 | |
191 exit_code_for_galaxy=\$?; | |
192 cat $temp_stderr 2>&1; | |
193 (exit \$exit_code_for_galaxy) | |
194 ]]> | |
195 </command> | |
196 <inputs> | |
197 <param format="par" name="input_par" type="data" label="Identification Parameters file" | |
198 help="Select PAR file from history"/> | |
199 | |
200 <param name="peak_lists" format="mgf" type="data" multiple="true" label="Input Peak Lists (mgf)" | |
201 help="Select appropriate MGF dataset(s) from history" /> | |
202 | |
203 <!-- Search Engine Selection --> | |
204 <section name="search_engines_options" expanded="true" title="Search Engine Options"> | |
205 <param name="engines" type="select" display="checkboxes" multiple="True" label="DB-Search Engines"> | |
206 <help>Comet and Tide shouldn't both be selected since they use a similar algoritm.</help> | |
207 <option value="X!Tandem" selected="True">X!Tandem</option> | |
208 <option value="MSGF" selected="True">MS-GF+</option> | |
209 <option value="OMSSA" selected="True">OMSSA</option> | |
210 <option value="Comet">Comet</option> | |
211 <option value="Tide">Tide</option> | |
212 <option value="MyriMatch">MyriMatch</option> | |
213 <option value="MS_Amanda">MS_Amanda</option> | |
214 <!-- Windows only | |
215 <option value="Andromeda">Andromeda</option> | |
216 --> | |
217 <!-- New with version 3.0 | |
218 --> | |
219 <!--working in tests | |
220 --> | |
221 <option value="DirecTag">DirecTag</option> | |
222 <option value="Novor">Novor (Select for non-commercial use only)</option> | |
223 <validator type="no_options" message="Please select at least one output file" /> | |
224 </param> | |
225 </section> | |
226 | |
227 <conditional name="searchgui_advanced"> | |
228 <param name="searchgui_advanced_selector" type="select" label="SearchGUI Options"> | |
229 <option value="basic" selected="True">Default</option> | |
230 <option value="advanced">Advanced</option> | |
231 </param> | |
232 <when value="basic" /> | |
233 <when value="advanced"> | |
234 <param name="correct_titles" type="select" label="How should PeptideShaker deal with duplicate spectra?" | |
235 help="Unless you suspect some input files to be genuine duplicates then rename spectra is the safest option"> | |
236 <option value="0">no correction</option> | |
237 <option value="1" selected="True">rename spectra</option> | |
238 <option value="2">delete spectra</option> | |
239 </param> | |
240 | |
241 <param name="missing_titles" type="boolean" checked="false" truevalue="-missing_titles 1" falsevalue="-missing_titles 0" | |
242 label="Add missing spectrum titles" help="(-missing_titles)"/> | |
243 | |
244 <param name="mgf_splitting" type="integer" value="1000" label="The maximum mgf file size in MB before splitting the mgf" | |
245 help="Choose a smaller value if you are running on a machine with limited memory"/> | |
246 | |
247 <param name="mgf_spectrum_count" type="integer" value="25000" label="The maximum number of spectra per mgf file when splitting" | |
248 help="Choose a smaller value if you are running on a machine with limited memory"/> | |
249 </when> | |
250 </conditional> | |
251 | |
252 </inputs> | |
253 <outputs> | |
254 <data name="searchgui_results" format="searchgui_archive" from_work_dir="searchgui_out.zip" label="${tool.name} on ${on_string}" /> | |
255 </outputs> | |
256 <tests> | |
257 | |
258 <!-- Test that specifying non-default search engines works --> | |
259 <test> | |
260 <param name="peak_lists" value="searchgui_tinyspectra1.mgf"/> | |
261 <param name="input_par" value="Identification_Parameters_specific.par"/> | |
262 <param name="engines" value="X!Tandem,MSGF,MyriMatch,OMSSA,Comet"/> | |
263 <output name="output" file="tiny_searchgui_result1.zip" ftype="searchgui_archive" compare="sim_size" delta="30000" /> | |
264 </test> | |
265 <!-- Test that search works with MSAmanda --> | |
266 <test> | |
267 <param name="peak_lists" value="searchgui_smallspectra.mgf"/> | |
268 <param name="input_par" value="Identification_Parameters_default.par"/> | |
269 <param name="engines" value="MS_Amanda"/> | |
270 <output name="output" file="smallsearch_result_amandaonly.zip" ftype="searchgui_archive" compare="sim_size" delta="5000" /> | |
271 </test> | |
272 | |
273 </tests> | |
274 <help> | |
275 **What it does** | |
276 | |
277 Runs multiple search engines on any number of MGF peak lists using the SearchGUI. | |
278 | |
279 Default: X! Tandem, OMSSA and MS-GF+ are executed. | |
280 | |
281 Optional: MyriMatch, MS-Amanda, Comet and Tide can be executed. | |
282 | |
283 </help> | |
284 <expand macro="citations" /> | |
285 </tool> |