annotate msi_combine.xml @ 0:9cbcf48bf60a draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
author galaxyp
date Tue, 24 Apr 2018 13:22:48 -0400
parents
children f3f6c32ab690
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
1 <tool id="mass_spectrometry_imaging_combine" name="MSI combine" version="1.7.0.0">
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
2 <description>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
3 combine several mass spectrometry imaging datasets into one
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
4 </description>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
5 <requirements>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
6 <requirement type="package" version="1.7.0">bioconductor-cardinal</requirement>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
7 </requirements>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
8 <command detect_errors="exit_code">
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
9 <![CDATA[
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
10 #for $i, $infile in enumerate($infiles):
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
11 #if $infile.ext == 'imzml'
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
12 cp '${infile.extra_files_path}/imzml' infile_$i.imzML &&
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
13 cp '${infile.extra_files_path}/ibd' infile_$i.ibd &&
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
14 #elif $infile.ext == 'analyze75'
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
15 cp '${infile.extra_files_path}/hdr' infile_$i.hdr &&
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
16 cp '${infile.extra_files_path}/img' infile_$i.img &&
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
17 cp '${infile.extra_files_path}/t2m' infile_$i.t2m &&
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
18 #else
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
19 ln -s '$infile' infile_${i}.RData &&
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
20 #end if
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
21 #end for
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
22 cat '${msi_combine}' &&
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
23 Rscript '${msi_combine}'
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
24
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
25 ]]>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
26 </command>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
27 <configfiles>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
28 <configfile name="msi_combine"><![CDATA[
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
29 library(Cardinal)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
30
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
31 #if $coordinates_file:
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
32 input_list = read.delim("$coordinates_file", header = FALSE,
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
33 stringsAsFactors = FALSE)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
34 #end if
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
35
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
36 pixel_vector = numeric()
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
37
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
38 #set $msidata = []
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
39 #for $i, $infile in enumerate($infiles):
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
40
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
41 #if $infile.ext == 'imzml'
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
42 msidata_$i <- readMSIData('infile_${i}.imzML')
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
43 sampleNames(msidata_$i) = "msidata"
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
44 #elif $infile.ext == 'analyze75'
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
45 msidata_$i <- readMSIData('infile_${i}.hdr')
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
46 sampleNames(msidata_$i) = "msidata"
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
47 #else
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
48 loadRData <- function(fileName){
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
49 #loads an RData file, and returns it
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
50 load(fileName)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
51 get(ls()[ls() != "fileName"])
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
52 }
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
53 msidata_$i = loadRData('infile_${i}.RData')
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
54 sampleNames(msidata_$i) = "msidata"
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
55 #end if
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
56
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
57 #if $coordinates_file:
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
58 coord(msidata_$i)\$x = coord(msidata_$i)\$x + input_list[$i+1+$coordinates_header,$column_x]
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
59 coord(msidata_$i)\$y = coord(msidata_$i)\$y + input_list[$i+1+$coordinates_header,$column_y]
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
60 pixelnumber = ncol(msidata_$i)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
61 pixel_vector = append(pixel_vector, rep(input_list[$i+1+$coordinates_header,$column_names],times=pixelnumber))
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
62 #end if
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
63 #silent $msidata.append('msidata_'+str($i))
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
64 #end for
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
65
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
66 msidata_combined = do.call(combine, list(#echo ','.join($msidata)#))
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
67
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
68 ### count NAs and replace by 0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
69 spectra(msidata_combined)[is.na(spectra(msidata_combined))] <- 0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
70 print(paste0("Number of NAs which were replaced ",sum(is.na(msidata_combined))))
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
71
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
72 #if $coordinates_file:
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
73 ### rename pixels according to dataset
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
74 sample_names = as.factor(pixel_vector)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
75 msidata_combined@pixelData@data\$sample = sample_names
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
76 #end if
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
77
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
78
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
79 ### outputs ###
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
80
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
81 ## save as (.RData)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
82 msidata = msidata_combined
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
83 save(msidata, file="$msidata_combined")
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
84
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
85 pdf("combining_qc.pdf", fonts = "Times", pointsize = 12)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
86 image(msidata_combined, mz=1, colorkey=FALSE)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
87 dev.off()
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
88
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
89 ### optional: intensity matrix ###
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
90
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
91 #if $output_matrix:
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
92
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
93 if (length(features(msidata_combined))> 0 & length(pixels(msidata_combined)) > 0)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
94 {
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
95 spectramatrix = spectra(msidata_combined)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
96 rownames(spectramatrix) = mz(msidata_combined)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
97 newmatrix = rbind(pixels(msidata_combined), spectramatrix)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
98 write.table(newmatrix[2:nrow(newmatrix),], file="$matrixasoutput", quote = FALSE, row.names = TRUE, col.names=NA, sep = "\t")
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
99 }else{
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
100 print("file has no features or pixels left")
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
101 }
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
102 #end if
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
103
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
104 ]]></configfile>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
105 </configfiles>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
106 <inputs>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
107 <param name="infiles" type="data" multiple="true" format="imzml,rdata,analyze75"
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
108 label="MSI rawdata as imzml, analyze7.5 or Cardinal MSImageSet saved as RData"
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
109 help="load imzml and ibd file by uploading composite datatype imzml"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
110 <param name="coordinates_file" type="data" optional="true" format="tabular" label="X and y values to shift data before combining"
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
111 help="tabular file with pixels of interest in two separate columns"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
112 <param name="column_x" data_ref="coordinates_file" optional="true" label="Column with values for shift in x direction" type="data_column"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
113 <param name="column_y" data_ref="coordinates_file" optional="true" label="Column with values for shift in y direction" type="data_column"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
114 <param name="column_names" data_ref="coordinates_file" optional="true" label="Column with dataset names" type="data_column"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
115 <param name="coordinates_header" label="Number of header lines to skip" value="0" type="integer"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
116 <param name="output_matrix" type="boolean" display="radio" label="Intensity matrix output"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
117 </inputs>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
118 <outputs>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
119 <data format="rdata" name="msidata_combined" label="Combined MSI data"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
120 <data format="pdf" name="combining_qc" from_work_dir="combining_qc.pdf" label = "Combined image of pixels"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
121 <data format="tabular" name="matrixasoutput" label="Combined matrix">
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
122 <filter>output_matrix</filter>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
123 </data>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
124 </outputs>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
125 <tests>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
126 <test expect_num_outputs="3">
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
127 <param name="infiles" value="msidata_1.RData,msidata_2.RData,msidata_3.RData" ftype="rdata"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
128 <param name="coordinates_file" ftype="tabular" value="xy_coordinates.tabular"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
129 <param name="column_x" value="1"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
130 <param name="column_y" value="2"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
131 <param name="column_names" value="3"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
132 <param name="output_matrix" value="True"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
133 <output name="matrixasoutput" file="123_combined_matrix.tabular"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
134 <output name="msidata_combined" file="123_combined.RData" compare="sim_size" />
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
135 <output name="combining_qc" file="123_combined_QC.pdf" compare="sim_size" delta="20000"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
136 </test>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
137 <test expect_num_outputs="3">
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
138 <param name="infiles" value="msidata_1.RData,msidata_2.RData" ftype="rdata"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
139 <param name="output_matrix" value="True"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
140 <output name="matrixasoutput" file="12_combined_matrix.tabular"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
141 <output name="msidata_combined" file="12_combined.RData" compare="sim_size" />
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
142 <output name="combining_qc" file="12_combined_QC.pdf" compare="sim_size" delta="20000"/>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
143 </test>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
144 </tests>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
145 <help>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
146 <![CDATA[
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
147 This tool can combine several mass-spectrometry imaging files. A prerequesite for the combination is that the m/z values are the same across all datasets. To achieve this use the filtering tool to get all datasets to the same m/z range and then use the binning function in the preprocessing tool to obtain the same bins for all dataset. The pixels on the other hand must be unique, therefore you should provide a number for the shift of x and y coordinates so that pixels of different datasets do not overlap.
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
148
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
149 Input data: 3 types of input data can be used:
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
150
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
151 - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <http://ms-imaging.org/wp/introduction/>`_
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
152 - Analyze7.5 (upload hdr, img and t2m file via the "composite" function)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
153 - Cardinal "MSImageSet" data (with variable name "msidata", saved as .RData)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
154
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
155 The output of this tool is a Cardinal "MSImageSet" with the variable name "msidata" saved as .RData.
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
156 ]]>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
157 </help>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
158 <citations>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
159 <citation type="doi">10.1093/bioinformatics/btv146</citation>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
160 </citations>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
161 </tool>