comparison combine.xml @ 9:7e18fcb92a6a draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit 6e8b69ee3aff3c93f745a5de11cc9169130f2e5e"
author galaxyp
date Thu, 24 Sep 2020 11:38:29 +0000
parents 525f201b86c1
children 5f066029763e
comparison
equal deleted inserted replaced
8:525f201b86c1 9:7e18fcb92a6a
1 <tool id="cardinal_combine" name="MSI combine" version="@VERSION@.1"> 1 <tool id="cardinal_combine" name="MSI combine" version="@VERSION@.0">
2 <description> 2 <description>
3 combine several mass spectrometry imaging datasets into one 3 combine several mass spectrometry imaging datasets into one
4 </description> 4 </description>
5 <macros> 5 <macros>
6 <import>macros.xml</import> 6 <import>macros.xml</import>
7 </macros> 7 </macros>
8 <expand macro="requirements"> 8 <expand macro="requirements">
9 <requirement type="package" version="3.2.1">r-ggplot2</requirement> 9 <requirement type="package" version="3.3.2">r-ggplot2</requirement>
10 <requirement type="package" version="0.12">r-maldiquantforeign</requirement> 10 <requirement type="package" version="0.12">r-maldiquantforeign</requirement>
11 <requirement type="package" version="1.19.3">r-maldiquant</requirement> 11 <requirement type="package" version="1.19.3">r-maldiquant</requirement>
12 </expand> 12 </expand>
13 <command detect_errors="exit_code"> 13 <command detect_errors="exit_code">
14 <![CDATA[ 14 <![CDATA[
108 msidata_$i\$column2 = NULL 108 msidata_$i\$column2 = NULL
109 msidata_$i\$column3 = NULL 109 msidata_$i\$column3 = NULL
110 msidata_$i\$column4 = NULL 110 msidata_$i\$column4 = NULL
111 msidata_$i\$column5 = NULL 111 msidata_$i\$column5 = NULL
112 msidata_$i\$combined_sample = NULL 112 msidata_$i\$combined_sample = NULL
113 msidata_$i <- as(msidata_$i, "MSImagingExperiment")
113 #end if 114 #end if
114
115 ## coercion into MSImageSet
116 msidata_$i = as(msidata_$i, "MSImageSet")
117 115
118 ## remove duplicated coordinates, otherwise combine will fail 116 ## remove duplicated coordinates, otherwise combine will fail
119 print(paste0(sum(duplicated(coord(msidata_$i))), " duplicated coordinates were removed from input file")) 117 print(paste0(sum(duplicated(coord(msidata_$i))), " duplicated coordinates were removed from input file"))
120 msidata_${i} <- msidata_${i}[,!duplicated(coord(msidata_${i}))] 118 msidata_${i} <- msidata_${i}[,!duplicated(coord(msidata_${i}))]
121 119
122 ## same name for MSI data files necessary to combine data into one single coordinate system 120 ## same name for MSI data files necessary to combine data into one single coordinate system
123 sampleNames(msidata_$i) = "msidata" 121 run(msidata_$i) = "msidata"
124 122
125 ############ 3) Read and process annotation tabular files ###################### 123 ############ 3) Read and process annotation tabular files ######################
126 124
127 #if str($annotation_cond.annotation_tabular) == 'annotation' 125 #if str($annotation_cond.annotation_tabular) == 'annotation'
128 print("annotations") 126 print("annotations")
250 248
251 #if not $processed_true: 249 #if not $processed_true:
252 ## combine only valid datasets 250 ## combine only valid datasets
253 251
254 valid_data = list(#echo ','.join($msidata)#)[valid_dataset] 252 valid_data = list(#echo ','.join($msidata)#)[valid_dataset]
255 msidata = do.call(combine, valid_data) 253 msidata = do.call(cbind, valid_data)
256 print("Valid datasets in order of input bottom to top:") 254 print("Valid datasets in order of input bottom to top:")
257 print(valid_dataset) 255 print(valid_dataset)
258 writeImzML(msidata, "out") 256 writeImzML(msidata, "out")
259 257
260 #else 258 #else
278 276
279 ## remove duplicated coordinates 277 ## remove duplicated coordinates
280 datasetlist = list() 278 datasetlist = list()
281 count = 1 279 count = 1
282 for (usable_dataset in list(#echo ','.join($msidata)#)){ 280 for (usable_dataset in list(#echo ','.join($msidata)#)){
283 pixelsofinterest = pixels(usable_dataset)[names(pixels(usable_dataset)) %in% rownames(coordinates_combined)] 281
282 pixelsofinterest = paste(coord(usable_dataset)\$x, coord(usable_dataset)\$y, sep="_") %in% paste(coordinates_combined\$x, coordinates_combined\$y, sep="_")
284 filtered_dataset = usable_dataset[,pixelsofinterest] 283 filtered_dataset = usable_dataset[,pixelsofinterest]
285 if (ncol(filtered_dataset) > 0 ){ 284 if (ncol(filtered_dataset) > 0 ){
286 datasetlist[[count]] = filtered_dataset} 285 datasetlist[[count]] = filtered_dataset}
287 count = count +1} 286 count = count +1}
288 287 msidata = do.call(cbind, datasetlist)
289 msidata = do.call(combine, datasetlist)
290 writeImzML(msidata, "out") 288 writeImzML(msidata, "out")
291 289
292 #else 290 #else
293 291
294 ## in case user made mistake with xy shifts: find duplicated coordinates 292 ## in case user made mistake with xy shifts: find duplicated coordinates
360 ]]></configfile> 358 ]]></configfile>
361 </configfiles> 359 </configfiles>
362 <inputs> 360 <inputs>
363 <param name="infiles" type="data" multiple="true" format="imzml,rdata,analyze75" 361 <param name="infiles" type="data" multiple="true" format="imzml,rdata,analyze75"
364 label="MSI data" 362 label="MSI data"
365 help="Input file as imzML (composite upload), Analyze7.5 (composite upload) or Cardinal MSImageSet saved as RData (regular upload)"/> 363 help="Input file as imzML (composite upload), Analyze7.5 (composite upload) or Cardinal 'MSImageSet' or 'MSImagingExperiment' saved as RData (regular upload)"/>
366 <param name="centroids" type="boolean" label="Centroided input" help="Choose Yes if peak detection has already been done." truevalue="TRUE" falsevalue="FALSE"/> 364 <param name="centroids" type="boolean" label="Centroided input" help="Choose Yes if peak detection has already been done." truevalue="TRUE" falsevalue="FALSE"/>
367 <conditional name="processed_cond"> 365 <conditional name="processed_cond">
368 <param name="processed_file" type="select" label="Processed imzML file" help="Choose no if your input is an Analyze7.5 or continuous imzML file"> 366 <param name="processed_file" type="select" label="Processed imzML file" help="Choose no if your input is an Analyze7.5 or continuous imzML file">
369 <option value="no_processed" selected="True">no</option> 367 <option value="no_processed" selected="True">no</option>
370 <option value="processed">yes</option> 368 <option value="processed">yes</option>