annotate segmentation_tool.xml @ 8:4a62874c21a3 draft default tip

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
author galaxyp
date Wed, 22 Aug 2018 13:44:28 -0400
parents adfef12c7e31
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
1 <tool id="mass_spectrometry_imaging_segmentations" name="MSI segmentation" version="1.10.0.4">
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
2 <description>mass spectrometry imaging spatial clustering</description>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
3 <requirements>
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
4 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
5 <requirement type="package" version="2.2.1">r-gridextra</requirement>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
6 <requirement type="package" version="0.20-35">r-lattice</requirement>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
7 </requirements>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
8 <command detect_errors="exit_code">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
9 <![CDATA[
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
10
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
11 #if $infile.ext == 'imzml'
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
12 ln -s '${infile.extra_files_path}/imzml' infile.imzML &&
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
13 ln -s '${infile.extra_files_path}/ibd' infile.ibd &&
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
14 #elif $infile.ext == 'analyze75'
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
15 ln -s '${infile.extra_files_path}/hdr' infile.hdr &&
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
16 ln -s '${infile.extra_files_path}/img' infile.img &&
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
17 ln -s '${infile.extra_files_path}/t2m' infile.t2m &&
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
18 #else
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
19 ln -s $infile infile.RData &&
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
20 #end if
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
21 cat '${MSI_segmentation}' &&
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
22 echo ${MSI_segmentation} &&
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
23 Rscript '${MSI_segmentation}'
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
24
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
25 ]]>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
26 </command>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
27 <configfiles>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
28 <configfile name="MSI_segmentation"><![CDATA[
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
29
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
30
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
31 ################################# load libraries and read file #################
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
32
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
33 library(Cardinal)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
34 library(gridExtra)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
35 library(lattice)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
36
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
37 ## Read MALDI Imaging dataset
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
38
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
39 #if $infile.ext == 'imzml'
7
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
40 #if str($processed_cond.processed_file) == "processed":
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
41 msidata <- readImzML('infile', mass.accuracy=$processed_cond.accuracy, units.accuracy = "$processed_cond.units")
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
42 #else
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
43 msidata <- readImzML('infile')
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
44 #end if
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
45 #elif $infile.ext == 'analyze75'
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
46 msidata = readAnalyze('infile')
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
47 #else
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
48 loadRData <- function(fileName){
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
49 load(fileName)
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
50 get(ls()[ls() != "fileName"])
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
51 }
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
52 msidata = loadRData('infile.RData')
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
53 #end if
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
54
7
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
55
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
56 ## create full matrix to make processed imzML files compatible with segmentation
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
57 iData(msidata) <- iData(msidata)[]
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
58 ###################################### file properties in numbers ##############
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
59
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
60 ## Number of features (m/z)
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
61 maxfeatures = length(features(msidata))
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
62 ## Range m/z
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
63 minmz = round(min(mz(msidata)), digits=2)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
64 maxmz = round(max(mz(msidata)), digits=2)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
65 ## Number of spectra (pixels)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
66 pixelcount = length(pixels(msidata))
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
67 ## Range x coordinates
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
68 minimumx = min(coord(msidata)[,1])
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
69 maximumx = max(coord(msidata)[,1])
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
70 ## Range y coordinates
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
71 minimumy = min(coord(msidata)[,2])
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
72 maximumy = max(coord(msidata)[,2])
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
73 ## Range of intensities
7
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
74 minint = round(min(spectra(msidata)[],na.rm=TRUE), digits=2)
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
75 maxint = round(max(spectra(msidata)[],na.rm=TRUE), digits=2)
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
76 medint = round(median(spectra(msidata)[]), digits=2)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
77 ## Number of intensities > 0
7
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
78 npeaks= sum(spectra(msidata)[]>0, na.rm=TRUE)
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
79 ## Spectra multiplied with m/z (potential number of peaks)
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
80 numpeaks = ncol(spectra(msidata)[])*nrow(spectra(msidata)[])
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
81 ## Percentage of intensities > 0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
82 percpeaks = round(npeaks/numpeaks*100, digits=2)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
83 ## Number of empty TICs
7
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
84 TICs = colSums(spectra(msidata)[], na.rm=TRUE)
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
85 NumemptyTIC = sum(TICs == 0)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
86
7
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
87
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
88
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
89 ## Processing informations
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
90 processinginfo = processingData(msidata)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
91 centroidedinfo = processinginfo@centroided # TRUE or FALSE
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
92
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
93 ## if TRUE write processinginfo if FALSE write FALSE
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
94
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
95 ## normalization
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
96 if (length(processinginfo@normalization) == 0) {
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
97 normalizationinfo='FALSE'
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
98 } else {
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
99 normalizationinfo=processinginfo@normalization
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
100 }
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
101 ## smoothing
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
102 if (length(processinginfo@smoothing) == 0) {
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
103 smoothinginfo='FALSE'
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
104 } else {
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
105 smoothinginfo=processinginfo@smoothing
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
106 }
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
107 ## baseline
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
108 if (length(processinginfo@baselineReduction) == 0) {
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
109 baselinereductioninfo='FALSE'
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
110 } else {
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
111 baselinereductioninfo=processinginfo@baselineReduction
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
112 }
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
113 ## peak picking
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
114 if (length(processinginfo@peakPicking) == 0) {
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
115 peakpickinginfo='FALSE'
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
116 } else {
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
117 peakpickinginfo=processinginfo@peakPicking
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
118 }
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
119
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
120 properties = c("Number of m/z features",
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
121 "Range of m/z values",
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
122 "Number of pixels",
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
123 "Range of x coordinates",
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
124 "Range of y coordinates",
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
125 "Range of intensities",
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
126 "Median of intensities",
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
127 "Intensities > 0",
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
128 "Number of zero TICs",
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
129 "Preprocessing",
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
130 "Normalization",
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
131 "Smoothing",
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
132 "Baseline reduction",
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
133 "Peak picking",
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
134 "Centroided")
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
135
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
136 values = c(paste0(maxfeatures),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
137 paste0(minmz, " - ", maxmz),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
138 paste0(pixelcount),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
139 paste0(minimumx, " - ", maximumx),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
140 paste0(minimumy, " - ", maximumy),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
141 paste0(minint, " - ", maxint),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
142 paste0(medint),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
143 paste0(percpeaks, " %"),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
144 paste0(NumemptyTIC),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
145 paste0(" "),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
146 paste0(normalizationinfo),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
147 paste0(smoothinginfo),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
148 paste0(baselinereductioninfo),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
149 paste0(peakpickinginfo),
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
150 paste0(centroidedinfo))
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
151
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
152 property_df = data.frame(properties, values)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
153
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
154
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
155 ######################################## PDF ###################################
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
156 ################################################################################
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
157 ################################################################################
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
158
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
159
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
160 pdf("segmentationpdf.pdf", fonts = "Times", pointsize = 12)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
161 plot(0,type='n',axes=FALSE,ann=FALSE)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
162
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
163 title(main=paste0("Spatial segmentation for file: \n\n", "$infile.display_name"))
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
164
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
165
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
166 ############################# I) numbers ####################################
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
167 #############################################################################
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
168 grid.table(property_df, rows= NULL)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
169
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
170 if (npeaks > 0)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
171 {
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
172
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
173 ######################## II) segmentation tools #############################
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
174 #############################################################################
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
175 #set $color_string = ','.join(['"%s"' % $color.feature_color for $color in $colours])
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
176 colourvector = c($color_string)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
177
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
178 ### preparation for images and plots:
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
179 #if str($image_cond.image_type) == "standard_image":
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
180 print("standard image")
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
181
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
182 strip_input = TRUE
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
183 lattice_input = FALSE
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
184
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
185 #elif str($image_cond.image_type) == "lattice_image":
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
186 print("lattice image")
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
187
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
188 strip_input = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9))
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
189 lattice_input = TRUE
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
190
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
191 #end if
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
192
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
193 ## set seed to make analysis reproducible
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
194 set.seed($setseed)
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
195
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
196 #if str( $segm_cond.segmentationtool ) == 'pca':
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
197 print('pca')
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
198 ##pca
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
199
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
200 component_vector = character()
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
201 for (numberofcomponents in 1:$segm_cond.pca_ncomp)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
202 {component_vector[numberofcomponents]= paste0("PC", numberofcomponents)}
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
203 pca_result = PCA(msidata, ncomp=$segm_cond.pca_ncomp, column = component_vector, superpose = FALSE,
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
204 method = "$segm_cond.pca_method", scale = $segm_cond.pca_scale, layout = c(ncomp, 1))
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
205
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
206 ### images in pdf file
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
207 print(image(pca_result, main="PCA image", lattice=lattice_input, strip = strip_input, col=colourvector, ylim=c(maximumy+2, minimumy-2)))
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
208 for (PCs in 1:$segm_cond.pca_ncomp){
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
209 print(image(pca_result, column = c(paste0("PC",PCs)), lattice=lattice_input, superpose = FALSE, col.regions = risk.colors(100), ylim=c(maximumy+2, minimumy-2)))}
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
210 ### plots in pdf file
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
211 print(plot(pca_result, main="PCA plot", lattice=lattice_input, col= colourvector, strip = strip_input))
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
212 for (PCs in 1:$segm_cond.pca_ncomp){
7
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
213 print(plot(pca_result, column = c(paste0("PC",PCs)),superpose = FALSE))}
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
214
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
215 ### values in tabular files
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
216 pcaloadings = (pca_result@resultData\$ncomp\$loadings) ### loading for each m/z value
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
217 pcaloadings2 = cbind(rownames(pcaloadings), pcaloadings)
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
218 colnames(pcaloadings2) = c("mz", colnames(pcaloadings))
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
219 pcascores = (pca_result@resultData\$ncomp\$scores) ### scores for each pixel
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
220 pcascores2 = cbind(rownames(pcascores), pcascores)
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
221 colnames(pcascores2) = c("pixel names", colnames(pcascores))
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
222
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
223 write.table(pcaloadings2, file="$mzfeatures", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
224 write.table(pcascores2, file="$pixeloutput", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
225
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
226 ## optional output as .RData
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
227 #if $output_rdata:
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
228 ## save as (.RData)
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
229 save(pca, file="$segmentation_rdata")
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
230
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
231 #end if
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
232
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
233 #elif str( $segm_cond.segmentationtool ) == 'kmeans':
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
234 print('kmeans')
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
235 ##k-means
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
236
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
237 skm = spatialKMeans(msidata, r=c($segm_cond.kmeans_r), k=c($segm_cond.kmeans_k), method="$segm_cond.kmeans_method")
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
238 print(image(skm, key=TRUE, main="K-means clustering", lattice=lattice_input, strip=strip_input, col= colourvector, layout=c(1,1), ylim=c(maximumy+2, minimumy-2)))
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
239
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
240 print(plot(skm, main="K-means plot", lattice=lattice_input, col= colourvector, strip=strip_input, layout=c($segm_cond.kmeans_layout)))
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
241
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
242 skm_clusters = data.frame(matrix(NA, nrow = pixelcount, ncol = 0))
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
243 for (iteration in 1:length(skm@resultData)){
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
244 skm_cluster = ((skm@resultData)[[iteration]]\$cluster)
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
245 skm_clusters = cbind(skm_clusters, skm_cluster) }
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
246 skm_clusters2 = cbind(rownames(skm_clusters), skm_clusters)
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
247 colnames(skm_clusters2) = c("pixel names", names(skm@resultData))
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
248
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
249 skm_toplabels = topLabels(skm, n=$segm_cond.kmeans_toplabels)
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
250
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
251 write.table(skm_toplabels, file="$mzfeatures", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
252 write.table(skm_clusters2, file="$pixeloutput", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
253
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
254 ## optional output as .RData
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
255 #if $output_rdata:
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
256
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
257 ## save as (.RData)
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
258 save(skm, file="$segmentation_rdata")
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
259
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
260 #end if
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
261
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
262 #elif str( $segm_cond.segmentationtool ) == 'centroids':
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
263 print('centroids')
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
264 ##centroids
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
265
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
266 ssc = spatialShrunkenCentroids(msidata, r=c($segm_cond.centroids_r), k=c($segm_cond.centroids_k), s=c($segm_cond.centroids_s), method="$segm_cond.centroids_method")
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
267 print(image(ssc, key=TRUE, main="Spatial shrunken centroids", lattice=lattice_input, strip = strip_input, col= colourvector,layout=c(1,1), ylim=c(maximumy+2, minimumy-2)))
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
268 print(plot(ssc, main="Spatial shrunken centroids plot", lattice=lattice_input, col= colourvector, strip = strip_input,layout=c($segm_cond.centroids_layout)))
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
269 print(plot(ssc, mode = "tstatistics",key = TRUE, lattice=lattice_input, layout = c($segm_cond.centroids_layout), main="t-statistics", col=colourvector))
7
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
270 plot(summary(ssc), main = "Number of segments")
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
271
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
272 ssc_classes = data.frame(matrix(NA, nrow = pixelcount, ncol = 0))
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
273 for (iteration in 1:length(ssc@resultData)){
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
274 ssc_class = ((ssc@resultData)[[iteration]]\$classes)
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
275 ssc_classes = cbind(ssc_classes, ssc_class) }
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
276 ssc_classes2 = cbind(rownames(ssc_classes), ssc_classes)
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
277 colnames(ssc_classes2) = c("pixel names", names(ssc@resultData))
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
278
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
279 ssc_toplabels = topLabels(ssc, n=$segm_cond.centroids_toplabels)
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
280
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
281 write.table(ssc_toplabels, file="$mzfeatures", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
282 write.table(ssc_classes2, file="$pixeloutput", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
283
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
284 ## optional output as .RData
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
285 #if $output_rdata:
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
286
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
287 ## save as (.RData)
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
288 save(ssc, file="$segmentation_rdata")
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
289
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
290 #end if
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
291
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
292 #end if
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
293
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
294 dev.off()
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
295
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
296 }else{
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
297 print("Inputfile has no intensities > 0")
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
298 dev.off()
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
299 }
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
300
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
301 ]]></configfile>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
302 </configfiles>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
303 <inputs>
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
304 <param name="infile" type="data" format="imzml,rdata,analyze75"
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
305 label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData"
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
306 help="Upload composite datatype imzml (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/>
7
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
307 <conditional name="processed_cond">
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
308 <param name="processed_file" type="select" label="Is the input file a processed imzML file ">
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
309 <option value="no_processed" selected="True">not a processed imzML</option>
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
310 <option value="processed">processed imzML</option>
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
311 </param>
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
312 <when value="no_processed"/>
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
313 <when value="processed">
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
314 <param name="accuracy" type="float" value="50" label="Mass accuracy to which the m/z values will be binned" help="This should be set to the native accuracy of the mass spectrometer, if known"/>
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
315 <param name="units" display="radio" type="select" label="Unit of the mass accuracy" help="either m/z or ppm">
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
316 <option value="mz" >mz</option>
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
317 <option value="ppm" selected="True" >ppm</option>
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
318 </param>
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
319 </when>
adfef12c7e31 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
galaxyp
parents: 6
diff changeset
320 </conditional>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
321 <conditional name="segm_cond">
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
322 <param name="segmentationtool" type="select" label="Select the tool for spatial clustering">
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
323 <option value="pca" selected="True">pca</option>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
324 <option value="kmeans">k-means</option>
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
325 <option value="centroids">spatial shrunken centroids</option>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
326 </param>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
327 <when value="pca">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
328 <param name="pca_ncomp" type="integer" value="2"
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
329 label="The number of principal components to calculate"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
330 <param name="pca_method" type="select"
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
331 label="The function used to calculate the singular value decomposition">
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
332 <option value="irlba" selected="True">irlba</option>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
333 <option value="svd">svd</option>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
334 </param>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
335 <param name="pca_scale" type="select" display="radio" optional="False"
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
336 label="Scaling of data before analysis">
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
337 <option value="TRUE">yes</option>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
338 <option value="FALSE" selected="True">no</option>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
339 </param>
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
340 </when>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
341
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
342 <when value="kmeans">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
343 <param name="kmeans_r" type="text" value="2"
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
344 label="The spatial neighborhood radius of nearby pixels to consider (r)" help="Multiple values are allowed (e.g. 1,2,3 or 2:5)"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
345 <param name="kmeans_k" type="text" value="3"
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
346 label="The number of clusters (k)" help="Multiple values are allowed (e.g. 1,2,3 or 2:5)"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
347 <param name="kmeans_method" type="select" display="radio"
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
348 label="The method to use to calculate the spatial smoothing kernels for the embedding. The 'gaussian' method refers to spatially-aware (SA) clustering, and 'adaptive' refers to spatially-aware structurally-adaptive (SASA) clustering">
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
349 <option value="gaussian">gaussian</option>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
350 <option value="adaptive" selected="True">adaptive</option>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
351 </param>
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
352 <param name="kmeans_toplabels" type="integer" value="500"
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
353 label="Number of toplabels (m/z) which should be written in tabular output"/>
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
354 <param name="kmeans_layout" type="text" value="1,1"
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
355 label="Number of rows and columns to plot pictures in pdf output" help="e.g. 1,1 means 1 plot per page; 2,3 means 2 rows with 3 plots each = 6 plots per page"/>
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
356 </when>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
357
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
358 <when value="centroids">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
359 <param name="centroids_r" type="text" value="2"
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
360 label="The spatial neighborhood radius of nearby pixels to consider (r)" help="Multiple values are allowed (e.g. 1,2,3 or 2:5)"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
361 <param name="centroids_k" type="text" value="5"
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
362 label="The initial number of clusters (k)" help="Multiple values are allowed (e.g. 1,2,3 or 2:5)"/>
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
363 <param name="centroids_s" type="text" value="2"
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
364 label="The sparsity thresholding parameter by which to shrink the t-statistics (s)"
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
365 help="As s increases, fewer m/z features (m/z values) will be used in the spatial segmentation, and only the informative m/z features will be retained. Multiple values are allowed (e.g. 1,2,3 or 2:5)"/>
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
366 <param name="centroids_method" type="select" display="radio" label = "The method to use to calculate the spatial smoothing kernels for the embedding. The 'gaussian' method refers to spatially-aware (SA) weights, and 'adaptive' refers to spatially-aware structurally-adaptive (SASA) weights">
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
367 <option value="gaussian">gaussian</option>
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
368 <option value="adaptive" selected="True">adaptive</option>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
369 </param>
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
370 <param name="centroids_toplabels" type="integer" value="500"
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
371 label="Number of toplabels (m/z) which should be written in tabular output"/>
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
372 <param name="centroids_layout" type="text" value="1,1"
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
373 label="Number of rows and columns to plot pictures in pdf output" help="e.g. 1,1 means 1 plot per page; 2,3 means 2 rows with 3 plots each = 6 plots per page"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
374 </when>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
375 </conditional>
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
376 <conditional name="image_cond">
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
377 <param name="image_type" type="select" label="Select the image type">
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
378 <option value="standard_image" selected="True">standard</option>
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
379 <option value="lattice_image">lattice</option>
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
380 </param>
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
381 <when value="standard_image"/>
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
382 <when value="lattice_image"/>
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
383 </conditional>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
384 <repeat name="colours" title="Colours for the plots" min="1" max="50">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
385 <param name="feature_color" type="color" label="Colours" value="#ff00ff" help="Numbers of columns should be the same as number of components">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
386 <sanitizer>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
387 <valid initial="string.letters,string.digits">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
388 <add value="#" />
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
389 </valid>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
390 </sanitizer>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
391 </param>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
392 </repeat>
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
393 <param name="output_rdata" type="boolean" display="radio" label="Results as .RData output"/>
8
4a62874c21a3 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
galaxyp
parents: 7
diff changeset
394 <param name="setseed" type="integer" value="1" label="set seed" help="use same value to reproduce previous results"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
395 </inputs>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
396 <outputs>
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
397 <data format="pdf" name="segmentationimages" from_work_dir="segmentationpdf.pdf" label = "$infile.display_name segmentation"/>
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
398 <data format="tabular" name="mzfeatures" label="$infile.display_name m/z features"/>
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
399 <data format="tabular" name="pixeloutput" label="$infile.display_name pixels"/>
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
400 <data format="rdata" name="segmentation_rdata" label="$infile.display_name segmentation">
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
401 <filter>output_rdata</filter>
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
402 </data>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
403 </outputs>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
404 <tests>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
405 <test>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
406 <param name="infile" value="" ftype="imzml">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
407 <composite_data value="Example_Continuous.imzML"/>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
408 <composite_data value="Example_Continuous.ibd"/>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
409 </param>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
410 <param name="segmentationtool" value="pca"/>
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
411 <param name="image_type" value="lattice_image"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
412 <repeat name="colours">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
413 <param name="feature_color" value="#ff00ff"/>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
414 </repeat>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
415 <repeat name="colours">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
416 <param name="feature_color" value="#0000FF"/>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
417 </repeat>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
418 <output name="segmentationimages" file="pca_imzml.pdf" compare="sim_size" delta="20000"/>
1
d4158c9955ea planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 0
diff changeset
419 <output name="mzfeatures" file="loadings_pca.tabular" compare="sim_size"/>
d4158c9955ea planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 0
diff changeset
420 <output name="pixeloutput" file="scores_pca.tabular" compare="sim_size"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
421 </test>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
422 <test>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
423 <param name="infile" value="" ftype="analyze75">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
424 <composite_data value="Analyze75.hdr" />
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
425 <composite_data value="Analyze75.img" />
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
426 <composite_data value="Analyze75.t2m" />
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
427 </param>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
428 <param name="segmentationtool" value="kmeans"/>
2
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
429 <param name="kmeans_r" value="1:3"/>
f66c5789deac planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 1
diff changeset
430 <param name="kmeans_k" value="2,3"/>
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
431 <param name="kmeans_toplabels" value="20"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
432 <repeat name="colours">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
433 <param name="feature_color" value="#ff00ff"/>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
434 </repeat>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
435 <repeat name="colours">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
436 <param name="feature_color" value="#0000FF"/>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
437 </repeat>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
438 <repeat name="colours">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
439 <param name="feature_color" value="#00C957"/>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
440 </repeat>
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
441 <param name="output_rdata" value="True"/>
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
442 <output name="segmentationimages" file="kmeans_analyze.pdf" compare="sim_size" delta="20000"/>
1
d4158c9955ea planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 0
diff changeset
443 <output name="mzfeatures" file="toplabels_skm.tabular" compare="sim_size"/>
d4158c9955ea planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 0
diff changeset
444 <output name="pixeloutput" file="cluster_skm.tabular" compare="sim_size"/>
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
445 <output name="pixeloutput" file="cluster_skm.tabular" compare="sim_size"/>
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
446 <output name="segmentation_rdata" file="cluster_skm.RData" compare="sim_size"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
447 </test>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
448 <test>
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
449 <param name="infile" value="preprocessed.RData" ftype="rdata"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
450 <param name="segmentationtool" value="centroids"/>
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
451 <param name="centroids_r" value="1,2"/>
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
452 <param name="centroids_k" value="3"/>
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
453 <param name="centroids_toplabels" value="50"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
454 <repeat name="colours">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
455 <param name="feature_color" value="#0000FF"/>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
456 </repeat>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
457 <repeat name="colours">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
458 <param name="feature_color" value="#00C957"/>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
459 </repeat>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
460 <repeat name="colours">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
461 <param name="feature_color" value="#B0171F"/>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
462 </repeat>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
463 <repeat name="colours">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
464 <param name="feature_color" value="#FFD700"/>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
465 </repeat>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
466 <repeat name="colours">
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
467 <param name="feature_color" value="#848484"/>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
468 </repeat>
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
469 <output name="segmentationimages" file="centroids_rdata.pdf" compare="sim_size" delta="20000"/>
1
d4158c9955ea planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 0
diff changeset
470 <output name="mzfeatures" file="toplabels_ssc.tabular" compare="sim_size"/>
d4158c9955ea planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 0
diff changeset
471 <output name="pixeloutput" file="classes_ssc.tabular" compare="sim_size"/>
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
472 </test>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
473 </tests>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
474 <help>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
475 <![CDATA[
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
476
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
477 Cardinal is an R package that implements statistical & computational tools for analyzing mass spectrometry imaging datasets. `More information on Cardinal <http://cardinalmsi.org//>`_
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
478
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
479 This tool provides three different Cardinal functions for unsupervised clustering/spatial segmentation of mass spectrometry imaging data.
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
480
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
481 Input data: 3 types of input data can be used:
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
482
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
483 - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <https://ms-imaging.org/wp/imzml/>`_
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
484 - Analyze7.5 (upload hdr, img and t2m file via the "composite" function)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
485 - Cardinal "MSImageSet" data (with variable name "msidata", saved as .RData)
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
486
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
487 Options:
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
488
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
489 - PCA: principal component analysis
6
80b6b96a175c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 5
diff changeset
490 - k-means: spatially-aware k-means clustering
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
491 - spatial shrunken centroids: Allows the number of segments to decrease according to the data. This allows automatic selection of the number of clusters
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
492
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
493 Output:
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
494
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
495 - Pdf with the heatmaps and plots for the segmentation
5
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
496 - Tabular file with information on m/z and pixels: loadings/scores (PCA), toplabels/clusters (k-means), toplabels/classes (spatial shrunken centroids)
cee9cf693709 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 4
diff changeset
497 - Optional .RData file which contains the segmentation results and can be used for further exploration in R
4
aec189b0c64d planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_segmentation commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 3
diff changeset
498
0
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
499 ]]>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
500 </help>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
501 <citations>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
502 <citation type="doi">10.1093/bioinformatics/btv146</citation>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
503 </citations>
0c1a9b68f436 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit da5a0723327f7cce689b230ccd69f3edecb1bc6b
galaxyp
parents:
diff changeset
504 </tool>