comparison thermo_converter.xml @ 8:26c6706bfb07 draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/ThermoRawfileParser commit a502d3fbf1f1ecfca1c9b115beab9d9c0e358fb5"
author galaxyp
date Sat, 25 Jul 2020 16:26:42 -0400
parents 63769c4217a7
children 92ac8e086317
comparison
equal deleted inserted replaced
7:63769c4217a7 8:26c6706bfb07
1 <tool id="thermo_raw_file_converter" name="Thermo" version="1.2.3"> 1 <tool id="thermo_raw_file_converter" name="Thermo" version="1.2.3+galaxy0">
2 <description>RAW file converter</description> 2 <description>RAW file converter</description>
3 <requirements> 3 <requirements>
4 <requirement type="package" version="1.2.3">thermorawfileparser</requirement> 4 <requirement type="package" version="1.2.3">thermorawfileparser</requirement>
5 </requirements> 5 </requirements>
6 <command> 6 <command>
7 <![CDATA[ 7 <![CDATA[
8 #import re 8 #import re
9 9
10 mkdir ./raws_folder && 10 mkdir ./raws_folder &&
11 mkdir ./output_folder && 11 mkdir ./output_folder &&
12 #for $input_raw in $input: 12 #for $input_raw in $input_files:
13 #if len($input) > 1 13 #set $input_name = re.sub('[^\w\-\.]', '_',$input_raw.element_identifier.split('/')[-1].replace(".raw", "") + ".raw")
14 #set $input_name = re.sub('[^\w\-\.]', '_',$input_raw.element_identifier.split('/')[-1].replace(".raw", "") + ".raw") 14 ln -s -f '${input_raw}' './raws_folder/${input_name}' &&
15 ln -s -f '${input_raw}' './raws_folder/${input_name}' &&
16 #else:
17 ln -s -f '${input_raw}' './raws_folder/input.raw' &&
18 #end if
19 #end for 15 #end for
20 16
21 ThermoRawFileParser.sh 17 ThermoRawFileParser.sh
22 -d=./raws_folder 18 -d=./raws_folder
23 -o=./output_folder 19 -o=./output_folder
27 #end if 23 #end if
28 $zlib_boolean 24 $zlib_boolean
29 $peakpicking_boolean 25 $peakpicking_boolean
30 $ignore_instrument_errors_boolean 26 $ignore_instrument_errors_boolean
31 27
32 #if len($input) == 1:
33 #if $output_format == "0":
34 && mv ./output_folder/input.mgf ./output_file.out
35 #else if $output_format == "1":
36 && mv ./output_folder/input.mzML ./output_file.out
37 #else if $output_format == "2":
38 && mv ./output_folder/input.mzML ./output_file.out
39 #end if
40
41 #if $output_metadata_selector != "off":
42 #if $output_metadata_selector == "0":
43 && mv ./output_folder/input-metadata.json ./input-metadata.txt
44 #else if $output_metadata_selector == "1":
45 && mv ./output_folder/input-metadata.txt ./input-metadata.txt
46 #end if
47 #end if
48 #end if
49 ]]> 28 ]]>
50 </command> 29 </command>
51 <inputs> 30 <inputs>
52 <param name="input" type="data" format="thermo.raw" label="Thermo RAW file" help="" multiple="true" 31 <param name="input_files" type="data" format="thermo.raw" label="Thermo RAW file" help="" multiple="true"
53 optional="False" /> 32 optional="False" />
54 33
55 <param name="output_format" type="select" label="Output format"> 34 <param name="output_format" type="select" label="Output format">
56 <option value="0">mgf</option> 35 <option value="0">mgf</option>
57 <option value="1" selected="True">mzml</option> 36 <option value="1" selected="True">mzml</option>
74 </param> 53 </param>
75 54
76 </inputs> 55 </inputs>
77 <outputs> 56 <outputs>
78 57
79 <!-- We use simple data outputs if we just have one file, for backwards compatibility --> 58 <collection name="output_mgf_collection" type="list" label="${tool.name} on ${on_string}: MGF collection">
80
81 <data name="output" format="mzml" from_work_dir="output_file.out" label="${tool.name} on ${on_string}">
82 <filter>(str(input)).count(',') == 0</filter> <!-- funny way of counting the number of input files! -->
83 <change_format>
84 <when input="output_format" value="0" format="mgf" />
85 <when input="output_format" value="2" format="txt" />
86 </change_format>
87 </data>
88
89 <data name="output_metadata" format="txt" label="${tool.name} on ${on_string}: Metadata" from_work_dir="input-metadata.txt">
90 <filter>str(output_metadata_selector) != "off"</filter>
91 <filter>(str(input)).count(',') == 0</filter>
92 <change_format>
93 <when input="output_metadata_selector" value="0" format="json" />
94 </change_format>
95 </data>
96
97 <!-- We use collections if we have multiple input files -->
98
99 <collection name="output_mgf_collection" type="list" label="${tool.name} on ${on_string}: MGF">
100 <filter>output_format == "0"</filter> 59 <filter>output_format == "0"</filter>
101 <filter>(str(input)).count(',') > 0</filter>
102 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.mgf" directory="output_folder" ext="mgf"/> 60 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.mgf" directory="output_folder" ext="mgf"/>
103 </collection> 61 </collection>
104 62
105 <collection name="output_mzml_collection" type="list" label="${tool.name} on ${on_string}: mzML"> 63 <collection name="output_mzml_collection" type="list" label="${tool.name} on ${on_string}: mzML collection">
106 <filter>output_format == "1"</filter> 64 <filter>output_format == "1"</filter>
107 <filter>(str(input)).count(',') > 0</filter>
108 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.mzML" ext="mzml" directory="output_folder"/> 65 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.mzML" ext="mzml" directory="output_folder"/>
109 </collection> 66 </collection>
110 67
111 <collection name="output_indexedmzml_collection" type="list" label="${tool.name} on ${on_string}: Indexed mzML"> 68 <collection name="output_indexedmzml_collection" type="list" label="${tool.name} on ${on_string}: Indexed mzML collection">
112 <filter>output_format == "2"</filter> 69 <filter>output_format == "2"</filter>
113 <filter>(str(input)).count(',') > 0</filter>
114 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.mzML" ext="mzml" directory="output_folder"/> 70 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.mzML" ext="mzml" directory="output_folder"/>
115 </collection> 71 </collection>
116 72
117 <collection name="output_metadata_collection" type="list" label="${tool.name} on ${on_string}: metadata"> 73 <collection name="output_metadata_collection" type="list" label="${tool.name} on ${on_string}: metadata collection">
118 <filter>output_metadata_selector != "off"</filter> 74 <filter>output_metadata_selector != "off"</filter>
119 <filter>(str(input)).count(',') > 0</filter>
120 <discover_datasets pattern="(?P&lt;designation&gt;.+)-metadata.txt" ext="txt" directory="output_folder"/> 75 <discover_datasets pattern="(?P&lt;designation&gt;.+)-metadata.txt" ext="txt" directory="output_folder"/>
121 <discover_datasets pattern="(?P&lt;designation&gt;.+)-metadata.json" ext="json" directory="output_folder"/> 76 <discover_datasets pattern="(?P&lt;designation&gt;.+)-metadata.json" ext="json" directory="output_folder"/>
122 </collection> 77 </collection>
123 78
124 </outputs> 79 </outputs>
125 80
126 <tests> 81 <tests>
127 <!-- Basic test --> 82 <!-- Basic mgf test - 1 file -->
128 <test expect_num_outputs="1"> 83 <test expect_num_outputs="1">
129 <param name="input" value="really_small.raw" ftype="thermo.raw"/> 84 <param name="input_files" value="really_small.raw" ftype="thermo.raw"/>
85 <param name="output_format" value="0"/>
86 <output_collection name="output_mgf_collection" type="list" count="1"/>
87
88 <!--<output name="output" file="really_small.mzml" ftype="mzml" compare="sim_size" delta="3000" />-->
89 </test>
90
91
92 <!-- Basic mzml test - 2 files -->
93 <test expect_num_outputs="1">
94 <param name="input_files" value="really_small.raw,really_small_2.raw" ftype="thermo.raw"/>
130 <param name="output_format" value="1"/> 95 <param name="output_format" value="1"/>
131 <output name="output" file="really_small.mzml" ftype="mzml" compare="sim_size" delta="3000" /> 96 <output_collection name="output_mzml_collection" type="list" count="2"/>
132 </test> 97 </test>
133 98
134 <!-- Testing contents of converted mgf file with txt metadata --> 99 <!-- Testing contents of converted mgf file with txt metadata -->
135 <test expect_num_outputs="2"> 100 <test expect_num_outputs="2">
136 <param name="input" value="really_small.raw" ftype="thermo.raw"/> 101 <param name="input_files" value="really_small.raw" ftype="thermo.raw"/>
137 <param name="output_format" value="0"/> 102 <param name="output_format" value="0"/>
138 <param name="output_metadata_selector" value="1"/> 103 <param name="output_metadata_selector" value="1"/>
139 <output name="output" ftype="mgf"> 104 <output_collection name="output_mgf_collection" type="list" count="1">
140 <assert_contents> 105 <element name="really_small" ftype="mgf">
141 <has_text text="SCANS=36"/> 106 <assert_contents>
142 <has_text text="RTINSECONDS=73.863181104"/> 107 <has_text text="SCANS=36"/>
143 <has_text text="PEPMASS=675.248779296875"/> 108 <has_text text="RTINSECONDS=73.863181104"/>
144 <has_text text="CHARGE=2+"/> 109 <has_text text="PEPMASS=675.248779296875"/>
145 <has_text text="121.3116455 920.2367553711"/> 110 <has_text text="CHARGE=2+"/>
146 <has_text text="229.2241211 1137.6958007813"/> 111 <has_text text="121.3116455 920.2367553711"/>
147 <has_text text="1577.8967285 1487.9519042969"/> 112 <has_text text="229.2241211 1137.6958007813"/>
148 </assert_contents> 113 <has_text text="1577.8967285 1487.9519042969"/>
149 </output> 114 </assert_contents>
150 <output name="output_metadata" ftype="txt"> 115 </element>
151 <assert_contents> 116 </output_collection>
152 <has_text text="Instrument model=[MS, MS:1000494, Thermo Scientific instrument model, Orbitrap Fusion]"/> 117 <output_collection name="output_metadata_collection" type="list">
153 <has_text text="Instrument name=Orbitrap Fusion"/> 118 <element name="really_small" ftype="txt">
154 <has_text text="Instrument serial number=[MS, MS:1000529, instrument serial number, FSN10188]"/> 119 <assert_contents>
155 <has_text text="Software version=[NCIT, NCIT:C111093, Software Version, 3.1.2412.17]"/> 120 <has_text text="Instrument model=[MS, MS:1000494, Thermo Scientific instrument model, Orbitrap Fusion]"/>
156 <has_text text="Mass resolution=[MS, MS:1000011, mass resolution, 0.500]"/> 121 <has_text text="Instrument name=Orbitrap Fusion"/>
157 <has_text text="Number of scans=101"/> 122 <has_text text="Instrument serial number=[MS, MS:1000529, instrument serial number, FSN10188]"/>
158 <has_text text="Scan range=1;101"/> 123 <has_text text="Software version=[NCIT, NCIT:C111093, Software Version, 3.1.2412.17]"/>
159 <has_text text="Scan start time=[MS, MS:1000016, scan start time, 0.89]"/> 124 <has_text text="Mass resolution=[MS, MS:1000011, mass resolution, 0.500]"/>
160 <has_text text="Time range=0.89;1.59"/> 125 <has_text text="Number of scans=101"/>
161 <has_text text="Mass range=120.0000;2000.0000"/> 126 <has_text text="Scan range=1;101"/>
162 </assert_contents> 127 <has_text text="Scan start time=[MS, MS:1000016, scan start time, 0.89]"/>
163 </output> 128 <has_text text="Time range=0.89;1.59"/>
164 129 <has_text text="Mass range=120.0000;2000.0000"/>
165 </test> 130 </assert_contents>
166 131 </element>
167 <!-- Basic mzml collection test --> 132 </output_collection>
168 <test expect_num_outputs="1">
169 <param name="input" value="really_small.raw,really_small_2.raw" ftype="thermo.raw"/>
170 <param name="output_format" value="1"/>
171 <output_collection name="output_mzml_collection" type="list" count="2"/>
172 </test> 133 </test>
173 134
174 <!-- mgf collection test with metadata --> 135 <!-- mgf collection test with metadata -->
175 <test expect_num_outputs="2"> 136 <test expect_num_outputs="2">
176 <param name="input" value="really_small.raw,really_small_2.raw,really_small_3.raw"/> 137 <param name="input_files" value="really_small.raw,really_small_2.raw,really_small_3.raw"/>
177 <param name="output_format" value="0"/> 138 <param name="output_format" value="0"/>
178 <param name="output_metadata_selector" value="0"/> 139 <param name="output_metadata_selector" value="0"/>
179 <output_collection name="output_mgf_collection" type="list" count="3"/> 140 <output_collection name="output_mgf_collection" type="list" count="3"/>
180 <output_collection name="output_metadata_collection" type="list" count="3"/> 141 <output_collection name="output_metadata_collection" type="list" count="3"/>
181 </test> 142 </test>