annotate msi_combine.xml @ 2:00b6c61f5054 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
author galaxyp
date Mon, 28 May 2018 12:35:49 -0400
parents f3f6c32ab690
children 91bba2486773
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
1 <tool id="mass_spectrometry_imaging_combine" name="MSI combine" version="1.10.0.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>
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
6 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
7 <requirement type="package" version="2.2.1">r-ggplot2</requirement>
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
8 </requirements>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
9 <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
10 <![CDATA[
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
11 #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
12 #if $infile.ext == 'imzml'
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
13 ln -s '${infile.extra_files_path}/imzml' infile.imzML &&
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
14 ln -s '${infile.extra_files_path}/ibd' infile.ibd &&
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
15 #elif $infile.ext == 'analyze75'
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
16 ln -s '${infile.extra_files_path}/hdr' infile.hdr &&
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
17 ln -s '${infile.extra_files_path}/img' infile.img &&
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
18 ln -s '${infile.extra_files_path}/t2m' infile.t2m &&
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
19 #else
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
20 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
21 #end if
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
22 #end for
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
23 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
24 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
25
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
26 ]]>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
27 </command>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
28 <configfiles>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
29 <configfile name="msi_combine"><![CDATA[
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
30 #import re
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
31 ################ load libraries, read rename and combine files #################
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
32
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
33 library(Cardinal)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
34 library(ggplot2)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
35
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
36 #if str( $combine_conditional.combine_method ) == 'xy_shifts':
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
37 input_list = read.delim("$combine_conditional.coordinates_file", header = FALSE,
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
38 stringsAsFactors = FALSE)
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
39 #end if
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
40
2
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
41 loadRData <- function(fileName){
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
42 #loads an RData file, and returns it
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
43 load(fileName)
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
44 get(ls()[ls() != "fileName"])
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
45 }
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
46
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
47 pixel_vector = numeric()
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
48 names_vector = character()
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
49 x_shifts = 0
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
50 y_shifts = 0
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
51 max_y = numeric()
0
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 #set $msidata = []
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
54 #set $pixelcoords = []
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
55 #set $num_infiles = len($infiles)
2
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
56 all_files = $num_infiles
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
57
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
58 #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
59
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
60 #if $infile.ext == 'imzml'
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
61 msidata_$i <- readImzML('infile_${i}')
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
62 #elif $infile.ext == 'analyze75'
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
63 msidata_$i <- readAnalyze('infile_${i}')
2
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
64 #else
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
65 msidata_$i = loadRData('infile_${i}.RData')
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
66 #end if
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
67
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
68 ########## wenn ncol msidata > 0 and nrow msidata > 0, dann alles abklappern andernfalls nicht in msiliste mitreinnehmen (unten hinter python vor end for: filenr ausprinten)
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
69 sampleNames(msidata_$i) = "msidata"
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
70 pixelcoords_$i = cbind(coord(msidata_$i)[,1:2], rep($i+1,ncol(msidata_$i)))
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
71
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
72 #if str( $combine_conditional.combine_method ) == 'xy_shifts':
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
73 coord(msidata_$i)\$x = coord(msidata_$i)\$x + input_list[$i+1,$combine_conditional.column_x]
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
74 coord(msidata_$i)\$y = coord(msidata_$i)\$y + input_list[$i+1,$combine_conditional.column_y]
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
75 pixel_vector = append(pixel_vector, rep(input_list[$i+1,$combine_conditional.column_names],times=ncol(msidata_$i)))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
76
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
77 #elif str( $combine_conditional.combine_method ) == 'automatic_combine':
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
78 #set escaped_element_identifier = re.sub('[^\w\-\s\[/]]', '_', str($infile.element_identifier))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
79 names_vector = append(names_vector, rep(paste($i+1, "$escaped_element_identifier", sep="_"),ncol(msidata_$i)))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
80 coord(msidata_$i)\$x = coord(msidata_$i)\$x - (min(coord(msidata_$i)\$x-1)) + x_shifts
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
81 coord(msidata_$i)\$y = coord(msidata_$i)\$y - (min(coord(msidata_$i)\$y-1)) + y_shifts
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
82 x_shifts = max(coord(msidata_$i)\$x) + $combine_conditional.x_distance
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
83 max_y = append(max_y, max(coord(msidata_$i)\$y))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
84
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
85 all_files = $num_infiles
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
86 new_row = ($i+1)/ceiling(sqrt(all_files))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
87 new_row%%1==0
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
88 if (new_row%%1==0)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
89 {x_shifts = 0 ### x values start again at zero
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
90 y_shifts = max(max_y) + $combine_conditional.y_distance
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
91 max_y = numeric()}
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
92
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
93 #end if
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
94 #silent $msidata.append('msidata_'+str($i))
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
95 #silent $pixelcoords.append('pixelcoords_'+str($i))
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
96 #end for
2
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
97 colnames(pixelcoords_$i)[3] = "file_number"
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
98
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
99 ###################### automatic combination ###################################
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
100 ################################################################################
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
101
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
102 #if str( $combine_conditional.combine_method ) == 'automatic_combine':
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
103 print("automatic_combine")
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
104 msidata_combined = do.call(combine, list(#echo ','.join($msidata)#))
2
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
105 print("combination successful")
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
106 sample_names = as.factor(names_vector)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
107 pData(msidata_combined)\$sample = sample_names
2
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
108 print("names successful")
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
109
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
110 ## create PDF to show pixels of each file
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
111 pdf("combining_qc.pdf", width=15, height=15)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
112 position_df = cbind(coord(msidata_combined)[,1:2], pData(msidata_combined)\$sample)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
113 colnames(position_df)[3] = "sample_name"
2
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
114 print("position_df")
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
115
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
116 combine_plot = ggplot(position_df, aes(x=x, y=y, fill=sample_name))+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
117 geom_tile() +
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
118 coord_fixed()+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
119 ggtitle("Spatial orientation of combined data")+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
120 theme_bw()+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
121 theme(text=element_text(family="ArialMT", face="bold", size=15))+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
122 theme(legend.position="bottom",legend.direction="vertical")+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
123 guides(fill=guide_legend(ncol=4,byrow=TRUE))
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
124
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
125
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
126 coord_labels = aggregate(cbind(x,y)~sample_name, data=position_df, mean)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
127 coord_labels\$file_number = gsub( "_.*$", "", coord_labels\$sample_name)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
128 for(file_count in 1:nrow(coord_labels))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
129 {
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
130 combine_plot = combine_plot + annotate("text",x=coord_labels[file_count,"x"],y=coord_labels[file_count,"y"],label=toString(coord_labels[file_count,4]))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
131 }
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
132
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
133 print(combine_plot)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
134 dev.off()
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
135
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
136 ## save as (.RData)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
137 msidata = msidata_combined
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
138 save(msidata, file="$msidata_combined")
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
139 ################################## xy shifts ###################################
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
140 ################################################################################
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
141 #elif str( $combine_conditional.combine_method ) == 'xy_shifts':
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
142 print("xy_shifts")
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
143 msidata_combined = do.call(combine, list(#echo ','.join($msidata)#))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
144
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
145 ############# replace NA with 0 and rename pixels according to dataset #########
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
146
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
147 spectra(msidata_combined)[is.na(spectra(msidata_combined))] <- 0
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
148 print(paste0("Number of NAs which were replaced ",sum(is.na(spectra(msidata_combined)))))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
149
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
150 sample_names = as.factor(pixel_vector)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
151 pData(msidata_combined)\$sample = sample_names
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
152
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
153 ###################################### outputs #################################
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
154 ## save as (.RData)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
155 msidata = msidata_combined
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
156 save(msidata, file="$msidata_combined")
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
157
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
158 ## create PDF to show pixels of each file
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
159 pdf("combining_qc.pdf")
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
160 position_df = cbind(coord(msidata), pData(msidata)\$sample)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
161 colnames(position_df)[3] = "sample_name"
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
162
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
163 combine_plot = ggplot(position_df, aes(x=x, y=y, fill=sample_name))+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
164 geom_tile() +
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
165 coord_fixed()+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
166 ggtitle("Spatial orientation of combined data")+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
167 theme_bw()+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
168 theme(text=element_text(family="ArialMT", face="bold", size=12))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
169
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
170 coord_labels = aggregate(cbind(x,y)~sample_name, data=position_df, mean)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
171 for(file_count in 1:nrow(coord_labels))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
172 {
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
173 combine_plot = combine_plot + annotate("text",x=coord_labels[file_count,"x"],y=coord_labels[file_count,"y"],label=toString(coord_labels[file_count,"sample_name"]))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
174 }
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
175
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
176 print(combine_plot)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
177
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
178 dev.off()
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
179
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
180
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
181 ################################## no shifts ###################################
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
182 ################################################################################
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
183 #elif str( $combine_conditional.combine_method ) == 'no_shifts':
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
184 print("no_shifts")
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
185 msidata_combined = do.call(combine, list(#echo ','.join($msidata)#))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
186
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
187 ############# replace NA with 0 and rename pixels according to dataset #########
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
188
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
189 spectra(msidata_combined)[is.na(spectra(msidata_combined))] <- 0
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
190 print(paste0("Number of NAs which were replaced ",sum(is.na(spectra(msidata_combined)))))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
191
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
192 ###################################### outputs #################################
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
193 ## save as (.RData)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
194 msidata = msidata_combined
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
195 save(msidata, file="$msidata_combined")
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
196
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
197 ## create PDF to show pixels of each file
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
198 pdf("combining_qc.pdf")
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
199 position_df = cbind(coord(msidata), pData(msidata)\$sample)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
200 colnames(position_df)[3] = "sample_name"
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
201
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
202 ggplot(position_df, aes(x=x, y=y, fill=sample_name))+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
203 geom_tile() +
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
204 coord_fixed()+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
205 ggtitle("Spatial orientation of combined data")+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
206 theme_bw()+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
207 theme(text=element_text(family="ArialMT", face="bold", size=12))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
208
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
209 dev.off()
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
210
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
211
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
212 ################################## no combination ##############################
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
213 ################################################################################
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
214 #elif str( $combine_conditional.combine_method ) == 'no_combine':
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
215 print("no_combine")
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
216
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
217 ## create PDF to show pixels of each file
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
218 pdf("combining_qc.pdf")
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
219 position_df = do.call(rbind, list(#echo ','.join($pixelcoords)#))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
220 position_df[duplicated(position_df[,1:2]),3] = 0
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
221 position_df\$file_number = as.factor(position_df\$file_number)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
222
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
223 combine_plot = ggplot(position_df, aes(x=x, y=y, fill=file_number))+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
224 geom_tile() +
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
225 coord_fixed()+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
226 ggtitle("Spatial orientation before combination")+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
227 theme_bw()+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
228 theme(text=element_text(family="ArialMT", face="bold", size=12))+
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
229 theme(panel.grid.major = element_line(colour = "black")) +
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
230 scale_x_continuous(minor_breaks = seq(min(position_df\$x-50), max(position_df\$x+50, 1))) +
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
231 scale_y_continuous(minor_breaks = seq(min(position_df\$y-50), max(position_df\$y+50, 1)))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
232
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
233
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
234 coord_labels = aggregate(cbind(x,y)~file_number, data=position_df, mean)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
235 for(file_count in 1:nrow(coord_labels))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
236 {
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
237 combine_plot = combine_plot + annotate("text",x=coord_labels[file_count,"x"],y=coord_labels[file_count,"y"],label=toString(coord_labels[file_count,"file_number"]))
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
238 }
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
239
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
240 print(combine_plot)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
241
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
242 dev.off()
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
243 #end if
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
244
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
245 #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
246
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
247 if (length(features(msidata_combined))> 0 & length(pixels(msidata_combined)) > 0)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
248 {
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
249 spectramatrix = spectra(msidata_combined)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
250 rownames(spectramatrix) = mz(msidata_combined)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
251 newmatrix = rbind(pixels(msidata_combined), spectramatrix)
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
252 write.table(newmatrix[2:nrow(newmatrix),], file="$matrixasoutput", quote = FALSE, row.names = TRUE, col.names=NA, sep = "\t")
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
253 }else{
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
254 print("file has no features or pixels left")
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
255 }
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
256 #end if
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
257
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
258 ]]></configfile>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
259 </configfiles>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
260 <inputs>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
261 <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
262 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
263 help="load imzml and ibd file by uploading composite datatype imzml"/>
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
264 <conditional name="combine_conditional">
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
265 <param name="combine_method" type="select" label="Select the way you want to combine multiple files" help="More detailed help can be found in the help section at the bottom">
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
266 <option value="automatic_combine" selected="True" >automatic combination</option>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
267 <option value="no_shifts" >no coordinates shift</option>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
268 <option value="xy_shifts">xy shifts by hand</option>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
269 <option value="no_combine">check pixels before combination</option>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
270 </param>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
271 <when value="no_shifts">
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
272 </when>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
273 <when value="automatic_combine">
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
274 <param name="x_distance" type="integer" value="10" label="How many pixels in x direction should be between files?"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
275 <param name="y_distance" type="integer" value="10" label="How many pixels in y direction should be between files?"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
276 </when>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
277 <when value="xy_shifts">
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
278 <param name="coordinates_file" type="data" format="tabular" label="datasetnames, X and y values to shift data before combining"
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
279 help="Tabular file with three columns: 1 for the filename, 1 for the x-coordinate shift and 1 for the y-coordinate shift"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
280 <param name="column_x" data_ref="coordinates_file" label="Column with values for shift in x direction" type="data_column"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
281 <param name="column_y" data_ref="coordinates_file" label="Column with values for shift in y direction" type="data_column"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
282 <param name="column_names" data_ref="coordinates_file" label="Column with dataset names" type="data_column"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
283 </when>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
284 <when value="no_combine"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
285 </conditional>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
286 <param name="output_matrix" type="boolean" display="radio" label="Intensity matrix output"/>
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
287 </inputs>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
288 <outputs>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
289 <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
290 <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
291 <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
292 <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
293 </data>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
294 </outputs>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
295 <tests>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
296 <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
297 <param name="infiles" value="msidata_1.RData,msidata_2.RData,msidata_3.RData" ftype="rdata"/>
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
298 <param name="combine_method" value="xy_shifts"/>
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
299 <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
300 <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
301 <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
302 <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
303 <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
304 <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
305 <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
306 <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
307 </test>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
308 <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
309 <param name="infiles" value="msidata_1.RData,msidata_2.RData" ftype="rdata"/>
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
310 <param name="combine_method" value="no_shifts"/>
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
311 <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
312 <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
313 <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
314 <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
315 </test>
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
316 <test expect_num_outputs="3">
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
317 <param name="infiles" value="msidata_1.RData,msidata_2.RData" ftype="rdata"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
318 <param name="combine_method" value="automatic_combine"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
319 <param name="x_distance" value="1"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
320 <param name="y_distance" value="1"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
321 <param name="output_matrix" value="True"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
322 <output name="matrixasoutput" file="12_auto_combined_matrix.tabular"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
323 <output name="msidata_combined" file="12_auto_combined.RData" compare="sim_size" />
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
324 <output name="combining_qc" file="12_auto_combined_QC.pdf" compare="sim_size" delta="20000"/>
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
325 </test>
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
326 </tests>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
327 <help>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
328 <![CDATA[
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
329
2
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
330 Cardinal is an R package that implements statistical & computational tools for analyzing mass spectrometry imaging datasets. `More information on Cardinal <http://cardinalmsi.org//>`_
1
f3f6c32ab690 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 0
diff changeset
331
2
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
332 This tool uses the Cardinal combine function to combine several mass-spectrometry imaging data.
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
333
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
334 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
335
2
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
336 - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <https://ms-imaging.org/wp/imzml/>`_
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
337 - 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
338 - 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
339
2
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
340 Prerequisite:
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
341
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
342 - m/z values need to be the same across all datasets (before using this tool), this can be achieved with the filtering tool (use same m/z range) and the preprocessing tool (use same binning parameter)
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
343
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
344 Options:
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
345
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
346 - "automatic combination": files are arranged in a grid with a minimal distance in x and y direction which can be given by the user, subfiles are named according to input file name
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
347 - "no coordinates shift": this option can only be used if all pixels are unique across datasets, no assignment of names to the subfiles
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
348 - "xy shifts by hand": each file can be moved in x and y direction according to the users need (define one tabular file in the order in which the files are loaded in the history (bottom to top) and define for each file the x and y coordinates shifts in separate columns
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
349 - "check pixels before combination": no combination takes place but a pdf shows the current arrangement of the pixels
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
350
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
351 Output:
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
352
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
353 - imzML file containing multiple subfiles
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
354 - pdf that shows the pixel positions of the combined files
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
355 - optional: intensity matrix as tabular file (intensities for masses in rows and pixel in columns)
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
356
00b6c61f5054 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 1
diff changeset
357
0
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
358 ]]>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
359 </help>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
360 <citations>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
361 <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
362 </citations>
9cbcf48bf60a planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_combine commit 1e5a87e56e09f01087844f8d2c95002455b1d89d
galaxyp
parents:
diff changeset
363 </tool>