comparison xcms_merge.xml @ 0:9063eaae5112 draft

planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 481448087f0e09c131b24f7d552db69f3552d371-dirty
author lecorguille
date Wed, 08 Feb 2017 06:27:18 -0500
parents
children 945652915244
comparison
equal deleted inserted replaced
-1:000000000000 0:9063eaae5112
1 <tool id="xcms_merge" name="xcms.xcmsSet Merger" version="1.0.0">
2 <description>Merge xcms.xcmsSet xset in one to be used by group</description>
3
4 <macros>
5 <import>macros.xml</import>
6 </macros>
7
8 <expand macro="requirements_light"/>
9 <expand macro="stdio"/>
10
11 <command><![CDATA[
12 Rscript $script_file
13 ]]></command>
14
15 <configfiles>
16 <configfile name="script_file"><![CDATA[
17 suppressPackageStartupMessages(library(xcms, quietly=TRUE))
18
19 images=c(
20 "${"\",\"".join(map(str, $images))}"
21 )
22
23
24 cat("\tXSET MERGING...\n")
25
26 for(image in images) {
27 load(image)
28 cat(sampleNamesList\$sampleNamesOrigin,"\n")
29 if (!exists("xset_merged")) {
30 xset_merged=xset
31 singlefile_merged=singlefile
32 listOFlistArguments_merged=listOFlistArguments
33 md5sumList_merged=md5sumList
34 sampleNamesList_merged=sampleNamesList
35 } else {
36 xset_merged=c(xset_merged,xset)
37 singlefile_merged=c(singlefile_merged,singlefile)
38 listOFlistArguments_merged=c(listOFlistArguments_merged,listOFlistArguments)
39 md5sumList_merged\$origin=rbind(md5sumList_merged\$origin,md5sumList\$origin)
40 sampleNamesList_merged\$sampleNamesOrigin=c(sampleNamesList_merged\$sampleNamesOrigin,sampleNamesList\$sampleNamesOrigin)
41 sampleNamesList_merged\$sampleNamesMakeNames=c(sampleNamesList_merged\$sampleNamesMakeNames,sampleNamesList\$sampleNamesMakeNames)
42 }
43 }
44 rm(image)
45 xset=xset_merged; rm(xset_merged)
46 singlefile=singlefile_merged; rm(singlefile_merged)
47 listOFlistArguments=listOFlistArguments_merged; rm(listOFlistArguments_merged)
48 md5sumList=md5sumList_merged; rm(md5sumList_merged)
49 sampleNamesList=sampleNamesList_merged; rm(sampleNamesList_merged)
50
51 #if str($sampleMetadata) != 'None':
52 cat("\tXSET PHENODATA SETTING...\n")
53 sampleMetadata=read.table("$sampleMetadata", h=F, sep=";", stringsAsFactors=F)
54 if (ncol(sampleMetadata) < 2) sampleMetadata=read.table("$sampleMetadata", h=F, sep="\t", stringsAsFactors=F)
55 if (ncol(sampleMetadata) < 2) sampleMetadata=read.table("$sampleMetadata", h=F, sep=",", stringsAsFactors=F)
56 if (ncol(sampleMetadata) < 2) {
57 error_message="Your sampleMetadata file seems not well formatted. The column separators accepted are ; , and tabulation"
58 print(error_message)
59 stop(error_message)
60 }
61
62 sampclass(xset)=sampleMetadata\$V2[match(rownames(xset@phenoData),sampleMetadata\$V1)]
63 #end if
64
65
66
67 cat("\tXSET OBJECT INFO\n")
68
69 print(xset@phenoData)
70 print(xset)
71
72 cat("\tSAVE RData\n")
73 save.image("$xsetRData")
74
75 ]]></configfile>
76 </configfiles>
77
78 <inputs>
79 <param name="images" type="data" format="rdata.xcms.raw,rdata" label="xset RData / xcms.xcmsSet file" help="output file from another xcms.xcmsSet" multiple="true" />
80 <param name="sampleMetadata" label="Sample metadata file " format="tabular" type="data" optional="true" help="must contain at least one column with the sample id and one column with the sample class"/>
81 </inputs>
82
83 <outputs>
84 <data name="xsetRData" format="rdata.xcms.raw" label="xset.merged.RData" />
85 </outputs>
86
87 <tests>
88 <test>
89 <param name="images" value="ko15-xset.RData,ko16-xset.RData,wt15-xset.RData,wt16-xset.RData" />
90 <assert_stdout>
91 <has_text text="object with 4 samples" />
92 <has_text text="Time range: 2506.1-4477.9 seconds (41.8-74.6 minutes)" />
93 <has_text text="Mass range: 200.1-600 m/z" />
94 <has_text text="Peaks: 9251 (about 2313 per sample)" />
95 <has_text text="Peak Groups: 0" />
96 <has_text text="Sample classes: ." />
97 </assert_stdout>
98 </test>
99 <test>
100 <param name="images" value="ko15-xset.RData,ko16-xset.RData,wt15-xset.RData,wt16-xset.RData" />
101 <param name="sampleMetadata" value="sampleMetadata.tab" />
102 <assert_stdout>
103 <has_text text="ko15 KO" />
104 <has_text text="ko16 KO" />
105 <has_text text="wt15 WT" />
106 <has_text text="wt16 WT" />
107 <has_text text="object with 4 samples" />
108 <has_text text="Time range: 2506.1-4477.9 seconds (41.8-74.6 minutes)" />
109 <has_text text="Mass range: 200.1-600 m/z" />
110 <has_text text="Peaks: 9251 (about 2313 per sample)" />
111 <has_text text="Peak Groups: 0" />
112 <has_text text="Sample classes: KO, WT" />
113 </assert_stdout>
114 </test>
115 <test>
116 <param name="images" value="MM8-xset.RData,MM14-xset.RData" />
117 <assert_stdout>
118 <has_text text="object with 2 samples" />
119 <has_text text="Time range: 19.7-307.3 seconds (0.3-5.1 minutes)" />
120 <has_text text="Mass range: 117.0357-936.7059 m/z" />
121 <has_text text="Peaks: 236 (about 118 per sample)" />
122 <has_text text="Peak Groups: 0" />
123 <has_text text="Sample classes: ." />
124 </assert_stdout>
125 </test>
126 </tests>
127
128 <help><![CDATA[
129
130 @HELP_AUTHORS@
131
132 ===================
133 Xcms.xcmsSet Merger
134 ===================
135
136 -----------
137 Description
138 -----------
139
140 This tool will allow you to run one xcms.xcmsSet process per sample in parallel and then to merge all RData images in one.
141 The result is then suitable for xcms.group.
142
143 You can provide a sampleMetadata table to attribute phenotypic value to your samples.
144
145
146 -----------------
147 Workflow position
148 -----------------
149
150 **Upstream tools**
151
152 ========================= ================= =================== ==========
153 Name output file format parameter
154 ========================= ================= =================== ==========
155 xcms.xcmsSet xset.RData rdata.xcms.raw RData file
156 ------------------------- ----------------- ------------------- ----------
157 xcms.xcmsSet xset.RData rdata.xcms.raw RData file
158 ------------------------- ----------------- ------------------- ----------
159 xcms.xcmsSet xset.RData rdata.xcms.raw RData file
160 ------------------------- ----------------- ------------------- ----------
161 ... ... ... ...
162 ========================= ================= =================== ==========
163
164
165 **Downstream tools**
166
167 +---------------------------+--------------------+-----------------+
168 | Name | Output file | Format |
169 +===========================+====================+=================+
170 |xcms.group | xset.RData | rdata.xcms.raw |
171 +---------------------------+--------------------+-----------------+
172
173
174 -----------
175 Input files
176 -----------
177
178 +---------------------------+-----------------------+
179 | Parameter : num + label | Format |
180 +===========================+=======================+
181 | 1 : RData file | rdata.xcms.raw |
182 +---------------------------+-----------------------+
183 | 2 : RData file | rdata.xcms.raw |
184 +---------------------------+-----------------------+
185 | N : RData file | rdata.xcms.raw |
186 +---------------------------+-----------------------+
187 | Optional : sampleMetadata | tsv or csv |
188 +---------------------------+-----------------------+
189
190 Example of a sampleMetadata:
191
192 +---------------------------+------------+
193 |HU_neg_028 | bio |
194 +---------------------------+------------+
195 |HU_neg_034 | bio |
196 +---------------------------+------------+
197 |Blanc04 | blank |
198 +---------------------------+------------+
199 |Blanc06 | blank |
200 +---------------------------+------------+
201 |Blanc09 | blank |
202 +---------------------------+------------+
203
204 ------------
205 Output files
206 ------------
207
208 xset.merged.RData: rdata.xcms.raw format
209
210 | Rdata file that is necessary in the next step of the workflow "xcms.group".
211
212 ---------------------------------------------------
213
214 Changelog/News
215 --------------
216
217 **Version 1.0.0 - 03/02/2017**
218
219 - NEW: a new tool to merge individual xcmsSet outputs to be used by xcms.group
220
221 ]]></help>
222
223 <expand macro="citation" />
224 </tool>