annotate msi_qualitycontrol.xml @ 11:30d0aabb1b46 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
author galaxyp
date Thu, 21 Jun 2018 16:46:09 -0400
parents 3eee933c27cf
children c43a7821c030
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1 <tool id="mass_spectrometry_imaging_qc" name="MSI Qualitycontrol" version="1.10.0.3">
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
2 <description>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
3 mass spectrometry imaging QC
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
4 </description>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
5 <requirements>
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
6 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
7 <requirement type="package" version="2.2.1">r-ggplot2</requirement>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
8 <requirement type="package" version="1.1_2">r-rcolorbrewer</requirement>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
9 <requirement type="package" version="2.2.1">r-gridextra</requirement>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
10 <requirement type="package" version="2.23_15">r-kernsmooth</requirement>
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
11 <requirement type="package" version="0.5.0">r-scales</requirement>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
12 </requirements>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
13 <command detect_errors="exit_code">
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
14 <![CDATA[
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
15 #if $infile.ext == 'imzml'
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
16 ln -s '${infile.extra_files_path}/imzml' infile.imzML &&
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
17 ln -s '${infile.extra_files_path}/ibd' infile.ibd &&
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
18 #elif $infile.ext == 'analyze75'
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
19 ln -s '${infile.extra_files_path}/hdr' infile.hdr &&
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
20 ln -s '${infile.extra_files_path}/img' infile.img &&
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
21 ln -s '${infile.extra_files_path}/t2m' infile.t2m &&
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
22 #else
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
23 ln -s '$infile' infile.RData &&
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
24 #end if
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
25 cat '${cardinal_qualitycontrol_script}' &&
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
26 Rscript '${cardinal_qualitycontrol_script}'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
27 ]]>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
28 </command>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
29 <configfiles>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
30 <configfile name="cardinal_qualitycontrol_script"><![CDATA[
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
31
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
32 ################################# load libraries and read file #################
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
33
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
34 library(Cardinal)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
35 library(ggplot2)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
36 library(RColorBrewer)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
37 library(gridExtra)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
38 library(KernSmooth)
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
39 library(scales)
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
40
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
41
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
42 #if $infile.ext == 'imzml'
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
43 #if str($processed_cond.processed_file) == "processed":
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
44 msidata <- readImzML('infile', mass.accuracy=$processed_cond.accuracy, units.accuracy = "$processed_cond.units")
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
45 #else
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
46 msidata <- readImzML('infile')
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
47 #end if
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
48 #elif $infile.ext == 'analyze75'
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
49 msidata = readAnalyze('infile')
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
50 #else
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
51 load('infile.RData')
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
52 #end if
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
53
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
54 ## create full matrix to make processed imzML files compatible with segmentation
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
55 iData(msidata) <- iData(msidata)[]
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
56
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
57 ###################################### file properties in numbers ######################
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
58
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
59 ## Number of features (m/z)
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
60 maxfeatures = length(features(msidata))
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
61 ## Range m/z
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
62 minmz = round(min(mz(msidata)), digits=2)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
63 maxmz = round(max(mz(msidata)), digits=2)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
64 ## Number of spectra (pixels)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
65 pixelcount = length(pixels(msidata))
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
66 ## Range x coordinates
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
67 minimumx = min(coord(msidata)[,1])
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
68 maximumx = max(coord(msidata)[,1])
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
69 ## Range y coordinates
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
70 minimumy = min(coord(msidata)[,2])
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
71 maximumy = max(coord(msidata)[,2])
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
72 ## Range of intensities
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
73 minint = round(min(spectra(msidata)[]), digits=2)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
74 maxint = round(max(spectra(msidata)[]), digits=2)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
75 medint = round(median(spectra(msidata)[]), digits=2)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
76 ## Number of intensities > 0
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
77 npeaks= sum(spectra(msidata)[]>0)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
78 ## Spectra multiplied with m/z (potential number of peaks)
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
79 numpeaks = ncol(spectra(msidata)[])*nrow(spectra(msidata)[])
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
80 ## Percentage of intensities > 0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
81 percpeaks = round(npeaks/numpeaks*100, digits=2)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
82 ## Number of empty TICs
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
83 TICs = colSums(spectra(msidata)[])
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
84 NumemptyTIC = sum(TICs == 0)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
85 ## Median TIC
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
86 medTIC = round(median(TICs), digits=2)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
87 ## Median peaks per spectrum
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
88 medpeaks = median(colSums(spectra(msidata)[]>0))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
89 print(cor(TICs,colSums(spectra(msidata)[]>0), method="pearson"))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
90
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
91 ## Processing informations
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
92 processinginfo = processingData(msidata)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
93 centroidedinfo = processinginfo@centroided
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
94
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
95 ## if TRUE write processinginfo if FALSE write FALSE
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
96
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
97 ## normalization
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
98 if (length(processinginfo@normalization) == 0) {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
99 normalizationinfo='FALSE'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
100 } else {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
101 normalizationinfo=processinginfo@normalization
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
102 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
103 ## smoothing
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
104 if (length(processinginfo@smoothing) == 0) {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
105 smoothinginfo='FALSE'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
106 } else {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
107 smoothinginfo=processinginfo@smoothing
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
108 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
109 ## baseline
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
110 if (length(processinginfo@baselineReduction) == 0) {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
111 baselinereductioninfo='FALSE'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
112 } else {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
113 baselinereductioninfo=processinginfo@baselineReduction
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
114 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
115 ## peak picking
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
116 if (length(processinginfo@peakPicking) == 0) {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
117 peakpickinginfo='FALSE'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
118 } else {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
119 peakpickinginfo=processinginfo@peakPicking
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
120 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
121
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
122 ############## Read and filter tabular file with m/z ###########################
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
123
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
124 ### reading calibrant file:
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
125
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
126 #if $calibrant_file:
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
127
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
128 calibrant_list = read.delim("$calibrant_file", header = FALSE, na.strings=c("","NA"), stringsAsFactors = FALSE)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
129 if (ncol(calibrant_list) == 1)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
130 {calibrant_list = cbind(calibrant_list, calibrant_list)} ## if there is just one column dublicate it to have a names column
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
131
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
132 ### calculate how many input calibrant m/z are valid:
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
133
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
134 inputcalibrants = calibrant_list[calibrant_list[,1]>minmz & calibrant_list[,1]<maxmz,]
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
135 number_calibrants_in = length(calibrant_list[,1])
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
136 number_calibrants_valid = length(inputcalibrants[,1])
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
137
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
138 #else
5
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
139
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
140 inputcalibrants = as.data.frame(matrix(, nrow = 0, ncol = 2))
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
141 number_calibrants_in = 0
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
142 number_calibrants_valid = 0
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
143
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
144 #end if
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
145
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
146 ## rename input dataframe and extract m/z
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
147 colnames(inputcalibrants) = c("m/z", "name")
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
148 inputcalibrantmasses = inputcalibrants[,1]
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
149
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
150
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
151 ######################################## PDF #############################################
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
152 ##########################################################################################
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
153 ##########################################################################################
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
154
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
155 pdf("qualitycontrol.pdf", fonts = "Times", pointsize = 12)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
156 plot(0,type='n',axes=FALSE,ann=FALSE)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
157
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
158 ## if no filename is given, name of file in Galaxy history is used
5
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
159
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
160 #if not $filename:
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
161 #set $filename = $infile.display_name
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
162 #end if
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
163
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
164 title(main=paste("$filename"))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
165
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
166 ################# I) file properties in numbers ################################
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
167 ################################################################################
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
168 print("properties in numbers")
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
169
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
170 properties = c("Number of m/z features",
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
171 "Range of m/z values",
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
172 "Number of pixels",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
173 "Range of x coordinates",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
174 "Range of y coordinates",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
175 "Range of intensities",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
176 "Median of intensities",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
177 "Intensities > 0",
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
178 "Number of empty spectra",
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
179 "Median TIC",
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
180 "Median # peaks per spectrum",
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
181 "Normalization",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
182 "Smoothing",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
183 "Baseline reduction",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
184 "Peak picking",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
185 "Centroided",
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
186 paste0("calibrants (#valid/#input) in \n", "$calibrant_file.display_name"))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
187
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
188 values = c(paste0(maxfeatures),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
189 paste0(minmz, " - ", maxmz),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
190 paste0(pixelcount),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
191 paste0(minimumx, " - ", maximumx),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
192 paste0(minimumy, " - ", maximumy),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
193 paste0(minint, " - ", maxint),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
194 paste0(medint),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
195 paste0(percpeaks, " %"),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
196 paste0(NumemptyTIC),
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
197 paste0(medTIC),
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
198 paste0(medpeaks),
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
199 paste0(normalizationinfo),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
200 paste0(smoothinginfo),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
201 paste0(baselinereductioninfo),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
202 paste0(peakpickinginfo),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
203 paste0(centroidedinfo),
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
204 paste0(number_calibrants_valid, " / ", number_calibrants_in))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
205
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
206 property_df = data.frame(properties, values)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
207
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
208 grid.table(property_df, rows= NULL)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
209
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
210 ####################### II) x-y images #######################################
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
211 ##############################################################################
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
212 print("x-y images")
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
213
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
214 if (npeaks > 0){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
215 ## function for density plots
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
216 plot_colorByDensity = function(x1,x2,
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
217 ylim=c(min(x2),max(x2)),
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
218 xlim=c(min(x1),max(x1)),
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
219 xlab="",ylab="",main=""){
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
220 df = data.frame(x1,x2)
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
221 x = densCols(x1,x2, colramp=colorRampPalette(c("black", "white")))
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
222 df\$dens = col2rgb(x)[1,] + 1L
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
223 cols = colorRampPalette(c("#000099", "#00FEFF", "#45FE4F","#FCFF00", "#FF9400", "#FF3100"))(256)
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
224 df\$col = cols[df\$dens]
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
225 plot(x2~x1, data=df[order(df\$dens),], ylim=ylim,xlim=xlim,pch=20,col=col,
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
226 cex=1,xlab=xlab,ylab=ylab,las=1, main=main)}
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
227
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
228 abline_vector= -100000 ## will be filled for samples in case data is combined
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
229
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
230 ## start list for optional spectrum values output
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
231 spectrum_list = list()
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
232 list_count = 1
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
233
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
234 ################### 0) overview for combined data ###########################
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
235
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
236 ### only for previously combined data, same plot as in combine QC pdf
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
237
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
238 if (!is.null(levels(msidata\$combined_sample))){
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
239 number_combined = length(levels(msidata\$combined_sample))
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
240
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
241 ## the more combined_samples a file has the smaller will be the legend
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
242 if (number_combined<20){
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
243 legend_size = 10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
244 cex_boxplot = 1
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
245 }else if (number_combined>20 && number_combined<40){
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
246 legend_size = 9
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
247 cex_boxplot = 0.8
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
248 }else if (number_combined>40 && number_combined<60){
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
249 legend_size = 8
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
250 cex_boxplot = 0.6
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
251 }else if (number_combined>60 && number_combined<100){
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
252 legend_size = 7
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
253 cex_boxplot = 0.5
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
254 }else{
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
255 legend_size = 6
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
256 cex_boxplot = 0.3
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
257 }
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
258
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
259 position_df = cbind(coord(msidata)[,1:2], msidata\$combined_sample)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
260 colnames(position_df)[3] = "sample_name"
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
261
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
262 combine_plot = ggplot(position_df, aes(x=x, y=y, fill=sample_name))+
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
263 geom_tile() +
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
264 coord_fixed()+
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
265 ggtitle("Spatial orientation of combined data")+
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
266 theme_bw()+
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
267 theme(plot.title = element_text(hjust = 0.5))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
268 theme(text=element_text(family="ArialMT", face="bold", size=12))+
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
269 theme(legend.position="bottom",legend.direction="vertical")+
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
270 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
271 guides(fill=guide_legend(ncol=5,byrow=TRUE))
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
272 coord_labels = aggregate(cbind(x,y)~sample_name, data=position_df, mean)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
273 coord_labels\$file_number = gsub( "_.*$", "", coord_labels\$sample_name)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
274 for(file_count in 1:nrow(coord_labels))
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
275 {combine_plot = combine_plot + annotate("text",x=coord_labels[file_count,"x"],
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
276 y=coord_labels[file_count,"y"],label=toString(coord_labels[file_count,4]))}
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
277
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
278 print(combine_plot)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
279
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
280 ### find max pixelnumber per subsample to later draw ablines
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
281 pixel_name_df = data.frame(pixels(msidata), msidata\$combined_sample)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
282 colnames(pixel_name_df) = c("pixel_number", "pixel_name")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
283 last_pixel = aggregate(pixel_number~pixel_name, data = pixel_name_df, max)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
284 pixel_vector = last_pixel[,2]
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
285 abline_vector = pixel_vector[1:number_combined-1]
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
286 print(abline_vector)
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
287 }
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
288
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
289 ################### 1) Pixel order image ###################################
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
290
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
291 pixelnumber = 1:pixelcount
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
292 pixelxyarray=cbind(coord(msidata)[,1:2],pixelnumber)
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
293
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
294 print(ggplot(pixelxyarray, aes(x=x, y=y, fill=pixelnumber))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
295 geom_tile() + coord_fixed()+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
296 ggtitle("Pixel order") + theme_bw()+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
297 theme(plot.title = element_text(hjust = 0.5))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
298 theme(text=element_text(family="ArialMT", face="bold", size=12))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
299 scale_fill_gradientn(colours = c("blue", "purple" , "red","orange"),
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
300 space = "Lab", na.value = "black", name = "Pixel\nnumber"))
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
301
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
302 ################ 2) Number of calibrants per spectrum ######################
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
303
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
304 ## matrix with calibrants in columns and in rows if there is peak intensity in range or not
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
305 pixelmatrix = matrix(ncol=ncol(msidata), nrow = 0)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
306
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
307 ## plot only possible when there is at least one valid calibrant
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
308 if (length(inputcalibrantmasses) != 0){
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
309
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
310 ## calculate plusminus values in m/z for each calibrant
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
311 plusminusvalues = rep($plusminus_ppm/1000000, length(inputcalibrantmasses))*inputcalibrantmasses
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
312
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
313 ## filter for m/z window of each calibrant and calculate if sum of peak intensities > 0
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
314 for (mass in 1:length(inputcalibrantmasses)){
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
315
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
316 filtered_data = msidata[mz(msidata) >= inputcalibrantmasses[mass]-plusminusvalues[mass] & mz(msidata) <= inputcalibrantmasses[mass]+plusminusvalues[mass],]
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
317
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
318 if (nrow(filtered_data) > 1 & sum(spectra(filtered_data)) > 0){
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
319
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
320 ## intensity of all m/z > 0
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
321 intensity_sum = colSums(spectra(filtered_data)) > 0
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
322 }else if(nrow(filtered_data) == 1 & sum(spectra(filtered_data)) > 0){
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
323
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
324 ## intensity of only m/z > 0
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
325 intensity_sum = spectra(filtered_data) > 0
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
326 }else{
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
327 intensity_sum = rep(FALSE, ncol(filtered_data))}
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
328
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
329 ## for each pixel add sum of intensity in the given m/z range
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
330 pixelmatrix = rbind(pixelmatrix, intensity_sum)
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
331 }
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
332
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
333 ## for each pixel count TRUE (each calibrant m/z range with intensity > 0 is TRUE)
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
334 countvector= as.factor(colSums(pixelmatrix))
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
335 countdf= cbind(coord(msidata)[,1:2], countvector) ## add pixel coordinates to counts
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
336 mycolours = c("black","grey", "darkblue", "blue", "green" , "red", "yellow", "magenta", "olivedrab1", "lightseagreen")
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
337
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
338 print(ggplot(countdf, aes(x=x, y=y, fill=countvector))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
339 geom_tile() + coord_fixed() +
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
340 ggtitle(paste0("Number of calibrants per pixel (±",$plusminus_ppm, " ppm)")) +
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
341 theme_bw() +
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
342 theme(plot.title = element_text(hjust = 0.5))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
343 theme(text=element_text(family="ArialMT", face="bold", size=12))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
344 scale_fill_manual(values = mycolours[1:length(countvector)],
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
345 na.value = "black", name = "# calibrants"))
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
346
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
347 ## append list for optional tabular output with spectrum values
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
348 colnames(countdf)[3] = "Number of Calibrants"
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
349 spectrum_list[[list_count]] = countdf
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
350 list_count = list_count+1
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
351
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
352 }else{print("2) The inputcalibrant m/z were not provided or outside the m/z range")}
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
353
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
354 ########################## 3) fold change image ###########################
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
355
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
356 #if $calibrantratio:
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
357 #for $foldchanges in $calibrantratio:
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
358 mass1 = $foldchanges.mass1
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
359 mass2 = $foldchanges.mass2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
360 distance = $foldchanges.distance
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
361
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
362 ### if user did not write a label use input m/z as label
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
363 #if not str($foldchanges.filenameratioplot).strip():
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
364 #set $label = "Fold change %s Da / %s Da" % ($foldchanges.mass1, $foldchanges.mass2)
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
365 #else:
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
366 #set $label = $foldchanges.filenameratioplot
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
367 #end if
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
368
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
369 ### filter msidata for given m/z range (for both input m/z)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
370 filtered_data1 = msidata[mz(msidata) >= mass1-distance & mz(msidata) <= mass1+distance,]
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
371 filtered_data2 = msidata[mz(msidata) >= mass2-distance & mz(msidata) <= mass2+distance,]
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
372
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
373 ### find m/z in the two given ranges with the highest mean intensity
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
374 ### this two m/z will be used to calculate the fold change (red line in plot)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
375 maxmassrow1 = rowMeans(spectra(filtered_data1))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
376 maxmass1 = mz(filtered_data1)[which.max(maxmassrow1)]
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
377 maxmassrow2 = rowMeans(spectra(filtered_data2))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
378 maxmass2 = mz(filtered_data2)[which.max(maxmassrow2)]
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
379
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
380 ### plot legend: chosen value in blue, distance in blue, max m/z in red
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
381 ### m/z range for each plot (fixed range of 5 Da)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
382 ### xlim does not work because it does not adjust for the max. intensities within the range
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
383 mzdown1 = features(msidata, mz = mass1-2)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
384 mzup1 = features(msidata, mz = mass1+3)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
385 mzdown2 = features(msidata, mz = mass2-2)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
386 mzup2 = features(msidata, mz = mass2+3)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
387
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
388 ### plot for first m/z
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
389 par(mfrow=c(2,1), oma=c(0,0,2,0))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
390 plot(msidata[mzdown1:mzup1,], pixel = 1:pixelcount, main=paste0("average spectrum ", mass1, " Da"))
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
391 abline(v=c(mass1-distance, mass1, mass1+distance), col="blue",lty=c(3,6,3))
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
392 abline(v=maxmass1, col="red", lty=5)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
393
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
394 ### plot for second m/z
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
395 plot(msidata[mzdown2:mzup2,], pixel = 1:pixelcount, main= paste0("average spectrum ", mass2, " Da"))
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
396 abline(v=c(mass2-distance, mass2, mass2+distance), col="blue", lty=c(3,6,3))
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
397 abline(v=maxmass2, col="red", lty=5)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
398 title("Control of fold change plot", outer=TRUE)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
399
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
400 ### filter spectra for max m/z to have two vectors, which can be divided
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
401 ### plot spatial distribution of fold change
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
402 ### only possible when there are intensities > 0 in both given m/z ranges
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
403
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
404 if (length(maxmass1)>0&length(maxmass2)>0){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
405 mass1vector = spectra(msidata)[features(msidata, mz = maxmass1),]
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
406 mass2vector = spectra(msidata)[features(msidata, mz = maxmass2),]
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
407 foldchange= log2(mass1vector/mass2vector)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
408 fcmatrix = cbind(foldchange, coord(msidata)[,1:2])
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
409
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
410 print(ggplot(fcmatrix, aes(x=x, y=y, fill=foldchange), colour=colo)+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
411 geom_tile() + coord_fixed()+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
412 ggtitle("$label")+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
413 theme_bw()+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
414 theme(plot.title = element_text(hjust = 0.5))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
415 theme(text=element_text(family="ArialMT", face="bold", size=12))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
416 scale_fill_gradientn(colours = c("blue", "purple" , "red","orange")
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
417 ,space = "Lab", na.value = "black", name ="FC"))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
418 }else{
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
419 plot(0,type='n',axes=FALSE,ann=FALSE)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
420 title(main=paste("At least one m/z range did not contain any intensity value > 0,\n therefore no foldchange plot could be drawn"))}
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
421
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
422 #end for
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
423 #end if
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
424
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
425 #################### 4) m/z heatmaps #######################################
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
426
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
427 par(mfrow=c(1,1), mar=c(5.1, 4.1, 4.1, 2.1), mgp=c(3, 1, 0), las=0)
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
428 if (length(inputcalibrants[,1]) != 0){
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
429 for (mass in 1:length(inputcalibrants[,1])){
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
430
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
431
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
432 image(msidata, mz=inputcalibrants[,1][mass], plusminus=plusminusvalues[mass],
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
433 main= paste0(inputcalibrants[,2][mass], ": ", round(inputcalibrants[,1][mass], digits = 2)," (±",$plusminus_ppm, " ppm)"),
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
434 contrast.enhance = "histogram", ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy))
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
435 }
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
436 } else {print("4) The input peptide and calibrant m/z were not provided or outside the m/z range")}
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
437
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
438 #################### 5) Number of peaks per pixel - image ##################
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
439
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
440 ## here every intensity value > 0 counts as pixel
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
441 peaksperpixel = colSums(spectra(msidata)[]> 0)
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
442 peakscoordarray=cbind(coord(msidata)[,1:2], peaksperpixel)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
443
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
444 print(ggplot(peakscoordarray, aes(x=x, y=y, fill=peaksperpixel), colour=colo)+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
445 geom_tile() + coord_fixed() +
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
446 ggtitle("Number of peaks per spectrum")+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
447 theme_bw() +
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
448 theme(plot.title = element_text(hjust = 0.5))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
449 theme(text=element_text(family="ArialMT", face="bold", size=12))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
450 scale_fill_gradientn(colours = c("blue", "purple" , "red","orange")
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
451 ,space = "Lab", na.value = "black", name = "# peaks"))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
452
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
453 ## append list for optional tabular output with spectrum values
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
454 colnames(peakscoordarray)[3] = "Number of Peaks"
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
455 spectrum_list[[list_count]] = peakscoordarray
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
456 list_count = list_count+1
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
457
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
458 ############################### 6) TIC image ###############################
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
459
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
460 TICcoordarray=cbind(coord(msidata)[,1:2], TICs)
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
461 colo = colorRampPalette(
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
462 c("blue", "cyan", "green", "yellow","red"))
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
463 print(ggplot(TICcoordarray, aes(x=x, y=y, fill=TICs), colour=colo)+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
464 geom_tile() + coord_fixed() +
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
465 ggtitle("Total Ion Chromatogram")+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
466 theme_bw() +
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
467 theme(plot.title = element_text(hjust = 0.5))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
468 theme(text=element_text(family="ArialMT", face="bold", size=12))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
469 scale_fill_gradientn(colours = c("blue", "purple" , "red","orange")
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
470 ,space = "Lab", na.value = "black", name = "TIC"))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
471
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
472 ## append list for optional tabular output with spectrum values
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
473 colnames(TICcoordarray)[3] = "TIC per spectrum"
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
474 spectrum_list[[list_count]] = TICcoordarray
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
475 list_count = list_count+1
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
476
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
477 ############################### 7) Most abundant m/z image #################
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
478
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
479 highestmz = apply(spectra(msidata)[],2,which.max)
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
480 highestmz_matrix = cbind(coord(msidata)[,1:2],mz(msidata)[highestmz])
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
481 colnames(highestmz_matrix)[3] = "highestmzinDa"
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
482
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
483 print(ggplot(highestmz_matrix, aes(x=x, y=y, fill=highestmzinDa))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
484 geom_tile() + coord_fixed() +
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
485 ggtitle("Most abundant m/z in each spectrum")+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
486 theme_bw() +
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
487 theme(plot.title = element_text(hjust = 0.5))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
488 scale_fill_gradientn(colours = c("blue", "purple" , "red","orange"), space = "Lab", na.value = "black", name = "m/z",
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
489 labels = as.character(pretty(highestmz_matrix\$highestmzinDa)[c(1,3,5,7)]),
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
490 breaks = pretty(highestmz_matrix\$highestmzinDa)[c(1,3,5,7)], limits=c(min(highestmz_matrix\$highestmzinDa), max(highestmz_matrix\$highestmzinDa)))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
491 theme(text=element_text(family="ArialMT", face="bold", size=12)))
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
492
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
493 ## which m/z are highest
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
494 highestmz_peptides = names(sort(table(round(highestmz_matrix\$highestmzinDa, digits=0)), decreasing=TRUE)[1])
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
495 highestmz_pixel = which(round(highestmz_matrix\$highestmzinDa, digits=0) == highestmz_peptides)[1]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
496
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
497 secondhighestmz = names(sort(table(round(highestmz_matrix\$highestmzinDa, digits=0)), decreasing=TRUE)[2])
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
498 secondhighestmz_pixel = which(round(highestmz_matrix\$highestmzinDa, digits=0) == secondhighestmz)[1]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
499
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
500 ## append list for optional tabular output with spectrum values
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
501 colnames(highestmz_matrix)[3] = "Most abundant m/z"
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
502 spectrum_list[[list_count]] = highestmz_matrix
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
503
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
504 ########################## 8) pca image for two components #################
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
505
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
506 pca = PCA(msidata, ncomp=2)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
507 par(mfrow = c(2,1))
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
508 plot(pca, col=c("black", "darkgrey"), main="PCA for two components")
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
509 image(pca, col=c("black", "white"), strip=FALSE, ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
510
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
511 ################## III) properties over spectra index ##########
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
512 ##############################################################################
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
513 print("properties over pixels")
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
514 par(mfrow = c(2,1), mar=c(5,6,4,2))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
515
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
516 ########################## 9) number of peaks per spectrum #################
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
517 ## 9a) scatterplot
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
518 plot_colorByDensity(pixels(msidata), peaksperpixel, ylab = "", xlab = "", main="Number of peaks per spectrum")
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
519 title(xlab="Spectra index", line=3)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
520 title(ylab="Number of peaks", line=4)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
521 abline(v=abline_vector, lty = 3)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
522
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
523 ## 9b) histogram
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
524
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
525 hist(peaksperpixel, main="", las=1, xlab = "Number of peaks per spectrum", ylab="")
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
526 title(main="Number of peaks per spectrum", line=2)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
527 title(ylab="Frequency = # spectra", line=4)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
528 abline(v=median(peaksperpixel), col="blue")
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
529
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
530 ## 9c) additional histogram to show subsample contributions
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
531 ## only when samples were combined before (combined_sample)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
532 if (!is.null(levels(msidata\$combined_sample))){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
533
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
534 df_9 = data.frame(peaksperpixel, msidata\$combined_sample)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
535 colnames(df_9) = c("Npeaks", "sample_name")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
536
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
537 hist_9 = ggplot(df_9, aes(x=Npeaks, fill=sample_name)) +
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
538 geom_histogram()+ theme_bw()+
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
539 theme(text=element_text(family="ArialMT", face="bold", size=12))+
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
540 theme(plot.title = element_text(hjust = 0.5))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
541 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
542 theme(legend.position="bottom",legend.direction="vertical")+
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
543 labs(title="Number of peaks per spectrum and sample", x="Number of peaks per spectrum", y = "Frequency = # spectra") +
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
544 guides(fill=guide_legend(ncol=5,byrow=TRUE))+
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
545 geom_vline(xintercept = median(peaksperpixel), size = 1, colour = "black",linetype = "dashed")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
546 print(hist_9)}
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
547
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
548 ########################## 10) TIC per spectrum ###########################
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
549
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
550 ## 10a)density scatterplot
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
551 par(mfrow = c(2,1), mar=c(5,6,4,2))
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
552 plot_colorByDensity(pixels(msidata), TICs, ylab = "", xlab = "", main="TIC per spectrum")
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
553 title(xlab="Spectra index", line=3)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
554 title(ylab = "Total ion chromatogram intensity", line=4)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
555 abline(v=abline_vector, lty = 3)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
556
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
557 ## 10b) histogram
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
558 hist(log(TICs), main="", las=1, xlab = "log(TIC per spectrum)", ylab="")
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
559 title(main= "TIC per spectrum", line=2)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
560 title(ylab="Frequency = # spectra", line=4)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
561 abline(v=median(log(TICs[TICs>0])), col="blue")
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
562
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
563 ## 10c) additional histogram to show subsample contributions
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
564 ## only when samples were combined before (combined_sample)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
565 if (!is.null(levels(msidata\$combined_sample))){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
566 df_10 = data.frame(log(TICs), msidata\$combined_sample)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
567 colnames(df_10) = c("TICs", "sample_name")
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
568
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
569 hist_10 = ggplot(df_10, aes(x=TICs, fill=sample_name)) +
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
570 geom_histogram()+ theme_bw()+
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
571 theme(text=element_text(family="ArialMT", face="bold", size=12))+
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
572 theme(plot.title = element_text(hjust = 0.5))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
573 theme(legend.position="bottom",legend.direction="vertical")+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
574 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
575 labs(title="TIC per spectrum and sample", x="log(TIC per spectrum)", y = "Frequency = # spectra") +
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
576 guides(fill=guide_legend(ncol=5,byrow=TRUE))+
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
577 geom_vline(xintercept = median(log(TICs[TICs>0])), size = 1, colour = "black",linetype = "dashed")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
578 print(hist_10)}
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
579
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
580 ################################## IV) properties over m/z ####################
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
581 ############################################################################
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
582 print("propverties over m/z")
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
583
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
584 ########################## 11) Histogram on m/z values #####################
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
585
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
586 par(mfrow = c(1, 1), cex.axis=1, cex.lab=1, mar=c(5.1,4.1,4.1,2.1))
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
587 hist(mz(msidata), xlab = "m/z", main="Histogram of m/z values")
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
588
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
589 ########################## 12) Number of peaks per m/z #####################
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
590
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
591 peakspermz = rowSums(spectra(msidata)[] > 0 )
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
592
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
593 par(mfrow = c(2,1), mar=c(5,6,4,4.5))
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
594 ## 12a) scatterplot
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
595 plot_colorByDensity(mz(msidata),peakspermz, main= "Number of peaks per m/z", ylab ="")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
596 title(xlab="m/z", line=2.5)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
597 title(ylab = "Number of peaks", line=4)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
598 axis(4, at=pretty(peakspermz),labels=as.character(round((pretty(peakspermz)/pixelcount*100), digits=1)), las=1)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
599 mtext("Coverage of spectra [%]", 4, line=3, adj=1)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
600
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
601 ## 12b) histogram
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
602 hist(peakspermz, main="", las=1, ylab="", xlab="")
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
603 title(ylab = "Frequency", line=4)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
604 title(main="Number of peaks per m/z", xlab = "Number of peaks per m/z", line=2)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
605 abline(v=median(peakspermz), col="blue")
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
606
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
607 ########################## 13) Sum of intensities per m/z ##################
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
608
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
609 ## Sum of all intensities for each m/z (like TIC, but for m/z instead of pixel)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
610 mzTIC = rowSums(spectra(msidata)[]) ## calculate intensity sum for each m/z
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
611
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
612 par(mfrow = c(2,1), mar=c(5,6,4,2))
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
613 ## 13a) scatterplot
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
614 plot_colorByDensity(mz(msidata),mzTIC, main= "Sum of intensities per m/z", ylab ="")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
615 title(xlab="m/z", line=2.5)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
616 title(ylab="Intensity sum", line=4)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
617
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
618 ## 13b) histogram
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
619 hist(log(mzTIC), main="", xlab = "", las=1, ylab="")
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
620 title(main="Sum of intensities per m/z", line=2, ylab="")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
621 title(xlab = "log (sum of intensities per m/z)")
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
622 title(ylab = "Frequency", line=4)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
623 abline(v=median(log(mzTIC[mzTIC>0])), col="blue")
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
624
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
625 ################################## V) intensity plots ########################
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
626 ############################################################################
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
627 print("intensity plots")
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
628 ########################## 14) Intensity distribution ######################
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
629
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
630 par(mfrow = c(2,1), mar=c(5,6,4,2))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
631
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
632 ## 14a) Median intensity over spectra
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
633 medianint_spectra = apply(spectra(msidata), 2, median)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
634 plot(medianint_spectra, main="Median intensity per spectrum",las=1, xlab="Spectra index", ylab="")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
635 title(ylab="Median spectrum intensity", line=4)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
636 abline(v=abline_vector, lty = 3)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
637
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
638 ## 14b) histogram:
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
639 hist(log2(spectra(msidata)[]), main="", xlab = "", ylab="", las=1)
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
640 title(main="Log2-transformed intensities", line=2)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
641 title(xlab="log2 intensities")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
642 title(ylab="Frequency", line=4)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
643 abline(v=median(log2(spectra(msidata)[(spectra(msidata)>0)])), col="blue")
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
644
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
645 ## 14c) histogram to show subsample contribution
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
646 ## only for previously combined samples
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
647 if (!is.null(levels(msidata\$combined_sample))){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
648
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
649 df_13 = data.frame(matrix(,ncol=2, nrow=0))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
650 for (subsample in levels(msidata\$combined_sample)){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
651 log2_int_subsample = log2(spectra(msidata)[,msidata\$combined_sample==subsample])
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
652 df_subsample = data.frame(as.numeric(log2_int_subsample))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
653 df_subsample\$sample_name = subsample
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
654 df_13 = rbind(df_13, df_subsample)}
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
655 df_13\$sample_name = as.factor(df_13\$sample_name)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
656 colnames(df_13) = c("logint", "sample_name")
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
657
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
658 hist_13 = ggplot(df_13, aes(x=logint, fill=sample_name)) +
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
659 geom_histogram()+ theme_bw()+
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
660 theme(text=element_text(family="ArialMT", face="bold", size=12))+
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
661 labs(title="Log2-transformed intensities per sample", x="log2 intensities", y = "Frequency") +
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
662 theme(plot.title = element_text(hjust = 0.5))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
663 theme(legend.position="bottom",legend.direction="vertical")+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
664 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
665 guides(fill=guide_legend(ncol=5,byrow=TRUE))+
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
666 geom_vline(xintercept = median(log2(spectra(msidata)[(spectra(msidata)>0)])), size = 1, colour = "black",linetype = "dashed")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
667 print(hist_13)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
668
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
669 ## 14d) boxplots to visualize in a different way the intensity distributions
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
670 par(mfrow = c(1,1), cex.axis=1.3, cex.lab=1.3, mar=c(13.1,4.1,5.1,2.1))
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
671
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
672 mean_matrix = matrix(,ncol=0, nrow = nrow(msidata))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
673 for (subsample in levels(msidata\$combined_sample)){
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
674 mean_mz_sample = rowMeans(spectra(msidata)[,msidata\$combined_sample==subsample])
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
675 mean_matrix = cbind(mean_matrix, mean_mz_sample)}
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
676
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
677 boxplot(log2(mean_matrix), ylab = "log2 mean intensity per m/z", main="Mean intensities per m/z and sample", xaxt = "n")
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
678 (axis(1, at = c(1:number_combined), labels=levels(msidata\$combined_sample), cex.axis=cex_boxplot, las=2))
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
679 }
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
680
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
681 ################################## VI) Mass spectra and m/z accuracy ########################
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
682 ############################################################################
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
683 print("Mass spectra and m/z accuracy")
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
684
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
685 ############################ 15) Mass spectra ##############################
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
686
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
687 par(mfrow = c(2, 2), cex.axis=1, cex.lab=1, mar=c(5.1,4.1,4.1,2.1))
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
688 pixels_for_plot = c(round(length(pixelnumber)/2, , digits=0), round(length(pixelnumber)/4, , digits=0), round(length(pixelnumber)/4*3, , digits=0))
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
689 plot(msidata, pixel = 1:length(pixelnumber), main= "Average spectrum")
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
690 plot(msidata, pixel = pixels_for_plot[1], main=paste0("Spectrum at ", rownames(coord(msidata)[pixels_for_plot[1],1:2])))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
691 plot(msidata, pixel = pixels_for_plot[2], main= paste0("Spectrum at ", rownames(coord(msidata)[pixels_for_plot[2],1:2])))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
692 plot(msidata, pixel = pixels_for_plot[3], main= paste0("Spectrum at ", rownames(coord(msidata)[pixels_for_plot[3],1:2])))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
693
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
694 #################### 16) Zoomed in mass spectra for calibrants##############
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
695
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
696 count = 1
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
697 differencevector = numeric()
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
698 differencevector2 = vector()
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
699
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
700 if (length(inputcalibrantmasses) != 0){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
701
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
702 ### calculate plusminus values in m/z for each calibrant, this is used for all following plots
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
703 plusminusvalues = rep($plusminus_ppm/1000000, length(inputcalibrantmasses))*inputcalibrantmasses
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
704
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
705 for (mass in 1:length(inputcalibrantmasses)){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
706
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
707 ### define the plot window with xmin und xmax
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
708 minmasspixel = features(msidata, mz=inputcalibrantmasses[mass]-1)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
709 maxmasspixel = features(msidata, mz=inputcalibrantmasses[mass]+3)
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
710
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
711 ### find m/z with the highest mean intensity in m/z range (red line in plot 16) and calculate ppm difference for plot 17
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
712 filtered_data = msidata[mz(msidata) >= inputcalibrantmasses[mass]-plusminusvalues[mass] & mz(msidata) <= inputcalibrantmasses[mass]+plusminusvalues[mass],]
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
713 if (nrow(filtered_data) > 0 & sum(spectra(filtered_data)) > 0){
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
714 maxmassrow = rowMeans(spectra(filtered_data)) ## for each m/z average intensity is calculated
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
715 maxvalue = mz(filtered_data)[which.max(maxmassrow)] ### m/z with highest average intensity in m/z range
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
716 mzdifference = maxvalue - inputcalibrantmasses[mass] ### difference: theoretical value - closest m/z value
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
717 ppmdifference = mzdifference/inputcalibrantmasses[mass]*1000000 ### calculate ppm for accuracy measurement
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
718 }else{
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
719 ppmdifference = NA
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
720 maxvalue = NA}
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
721 differencevector[mass] = round(ppmdifference, digits=2)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
722
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
723 ### find m/z closest to inputcalibrant and calculate ppm difference for plot 18
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
724 mznumber = features(msidata, mz = inputcalibrantmasses[mass]) ### gives featurenumber which is closest to given m/z
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
725 mzvalue = mz(msidata)[mznumber] ### gives closest m/z
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
726 mzdifference2 = mzvalue - inputcalibrantmasses[mass]
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
727 ppmdifference2 = mzdifference2/inputcalibrantmasses[mass]*1000000
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
728 differencevector2[mass] = round(ppmdifference2, digits=2)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
729
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
730 par(mfrow = c(2, 2), oma=c(0,0,2,0))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
731 plot(msidata[minmasspixel:maxmasspixel,], pixel = 1:length(pixelnumber), main= "average spectrum")
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
732 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="blue", lty=c(3,1,3))
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
733 abline(v=c(maxvalue), col="red", lty=2)
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
734 abline(v=c(mzvalue), col="green2", lty=4)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
735 plot(msidata[minmasspixel:maxmasspixel,], pixel = pixels_for_plot[1], main=paste0("Spectrum at ", rownames(coord(msidata)[pixels_for_plot[1],1:2])))
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
736 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="blue", lty=c(3,1,3))
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
737 abline(v=c(maxvalue), col="red", lty=2)
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
738 abline(v=c(mzvalue), col="green2", lty=4)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
739 plot(msidata[minmasspixel:maxmasspixel,], pixel = pixels_for_plot[2], main= paste0("Spectrum at ", rownames(coord(msidata)[pixels_for_plot[2],1:2])))
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
740 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="blue", lty=c(3,1,3))
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
741 abline(v=c(maxvalue), col="red", lty=2)
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
742 abline(v=c(mzvalue), col="green2", lty=4)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
743 plot(msidata[minmasspixel:maxmasspixel,], pixel = pixels_for_plot[3], main= paste0("Spectrum at ", rownames(coord(msidata)[pixels_for_plot[3],1:2])))
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
744 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="blue", lty=c(3,1,3))
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
745 abline(v=c(maxvalue), col="red", lty=2)
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
746 abline(v=c(mzvalue), col="green2", lty=4)
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
747 title(paste0("theor. m/z: ", inputcalibrants[count,1]), col.main="blue", outer=TRUE, line=0, adj=0.074)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
748 title(paste0("most abundant m/z: ", round(maxvalue, digits=4)), col.main="red", outer=TRUE, line=0, adj=0.49)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
749 title(paste0("closest m/z: ", round(mzvalue, digits=4)), col.main="green2", outer=TRUE, line=0, adj=0.93)
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
750
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
751 ### 16b) one large extra plot with different colours for different samples (for combined_sample only)
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
752
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
753 if (!is.null(levels(msidata\$combined_sample))){
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
754 if (number_combined < 10){
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
755 key_zoomed = TRUE
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
756 }else{key_zoomed = FALSE}
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
757 par(mfrow = c(1, 1))
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
758 plot(msidata[minmasspixel:maxmasspixel,], pixel=1:ncol(msidata),main="Average spectrum per sample",
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
759 pixel.groups=msidata\$combined_sample, key=key_zoomed, col=hue_pal()(number_combined),superpose=TRUE)
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
760 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="black", lty=c(3,1,3))
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
761 count=count+1
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
762 }
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
763 }
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
764
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
765 ######### 17) ppm difference input calibrant m/z and m/z with max intensity in given m/z range#########
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
766
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
767 par(mfrow = c(1, 1))
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
768
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
769 ### plot the ppm difference calculated above: theor. m/z value to highest m/z value:
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
770
7
b86a66dd1a16 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit dd64f41874a56c4e2619bf58ae3681d806cf9b3f
galaxyp
parents: 6
diff changeset
771 calibrant_names = as.character(inputcalibrants[,2])
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
772 diff_df = data.frame(differencevector, calibrant_names)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
773
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
774 if (sum(is.na(diff_df[,1])) == nrow(diff_df)){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
775 print("plot 17: no peaks in the chosen region, repeat with higher ppm range")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
776 }else{
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
777
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
778 diff_plot=ggplot(data=diff_df, aes(x=calibrant_names, y=differencevector)) + geom_bar(stat="identity", fill = "darkgray") + theme_minimal() +
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
779 labs(title="Difference m/z with max. average intensity vs. theor. calibrant m/z", x="calibrants", y = "Difference in ppm")+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
780 theme(plot.title = element_text(hjust = 0.5))+theme(text=element_text(family="ArialMT", face="bold", size=12))+
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
781 geom_text(aes(label=differencevector), vjust=-0.3, size=3.5, col="blue")
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
782
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
783 print(diff_plot)}
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
784
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
785 ######### 18) ppm difference input calibrant m/z and closest m/z ###########
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
786
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
787 ### plot the ppm difference calculated above theor. m/z value to closest m/z value:
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
788
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
789 differencevector2 = round(differencevector2, digits=2)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
790 calibrant_names = as.character(inputcalibrants[,2])
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
791 diff_df = data.frame(differencevector2, calibrant_names)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
792
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
793 diff_plot=ggplot(data=diff_df, aes(x=calibrant_names, y=differencevector2)) + geom_bar(stat="identity", fill = "darkgray") + theme_minimal() +
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
794 labs(title="Difference closest measured m/z vs. theor. calibrant m/z", x="calibrants", y = "Difference in ppm")+
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
795 theme(plot.title = element_text(hjust = 0.5))+theme(text=element_text(family="ArialMT", face="bold", size=12))+
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
796 geom_text(aes(label=differencevector2), vjust=-0.3, size=3.5, col="blue")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
797
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
798 print(diff_plot)
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
799
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
800 #################### 19) ppm difference over pixels #####################
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
801
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
802 mycolours = c("darkgrey", "darkblue", "blue", "green" , "red", "orange", "yellow", "magenta", "olivedrab1", "lightseagreen")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
803 count = 1
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
804 ppm_df = as.data.frame(matrix(,ncol=0, nrow = ncol(msidata)))
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
805 for (calibrant in inputcalibrantmasses){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
806 ### find m/z with the highest mean intensity in m/z range, if no m/z in the range, all ppm differences will be NA
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
807 filtered_data = msidata[mz(msidata) >= calibrant-plusminusvalues[count] & mz(msidata) <= calibrant+plusminusvalues[count],]
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
808
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
809 if (nrow(filtered_data) > 0){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
810 ### filtered for m/z range, now go through it pixel by pixel to find max peak in each spectrum
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
811 ppm_vector = numeric()
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
812 for (pixel_count in 1:ncol(filtered_data)){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
813 mz_max = mz(filtered_data)[which.max(spectra(filtered_data)[,pixel_count])]
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
814
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
815 mzdiff = mz_max - calibrant
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
816 ppmdiff = mzdiff/calibrant*1000000
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
817
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
818 ### if maximum intensity in m/z range was 0 set ppm diff to NA (not shown in plot)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
819 if (max(spectra(filtered_data)[,pixel_count]) == 0){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
820 ppmdiff = NA}
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
821 ppm_vector[pixel_count] = ppmdiff}
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
822 }else{ppm_vector = rep(NA, ncol(msidata))}
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
823
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
824 ppm_df = cbind(ppm_df, ppm_vector)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
825 count=count+1}
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
826
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
827 if (sum(is.na(ppm_df)) == ncol(ppm_df)*nrow(ppm_df)){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
828 print("plot 19: no peaks in the chosen region, repeat with higher ppm range")
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
829 }else{
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
830
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
831 ### plot ppm differences over pixels (spectra index)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
832
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
833 par(mar=c(4.1, 4.1, 4.1, 7.5))
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
834 plot(0,0,type="n", ylim=c(min(ppm_df, na.rm=TRUE),max(ppm_df, na.rm=TRUE)), xlim = c(1,ncol(filtered_data)),xlab = "Spectra index", ylab = "m/z difference in ppm", main="Difference m/z with max. average intensity vs. theor. m/z\n(per spectrum)")
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
835
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
836 for (each_cal in 1:ncol(ppm_df)){
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
837 lines(ppm_df[,each_cal], col=mycolours[each_cal], type="p")}
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
838 legend("topright", inset=c(-0.25,0), xpd = TRUE, bty="n", legend=inputcalibrantmasses, col=mycolours[1:ncol(ppm_df)],lty=1)
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
839 abline(v=abline_vector, lty = 3)}
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
840
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
841 }else{print("16+17+18+19) The inputcalibrant m/z were not provided or outside the m/z range")}
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
842
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
843 dev.off()
6
5c63fe03ed9e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 06c2b45d8644b1d7fc01622a5c59dcbf8886d0f1
galaxyp
parents: 5
diff changeset
844
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
845 }else{
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
846 print("inputfile has no intensities > 0")
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
847 dev.off()
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
848 }
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
849
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
850 ## tabular output of spectra values
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
851
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
852 #if $pixel_output:
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
853 print("pixel list")
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
854 pixel_df = Reduce(function(...) merge(..., by=c("x", "y"), all=T), spectrum_list)
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
855 write.table(pixel_df, file="$pixel_tabular_output", quote = FALSE, row.names = TRUE, col.names=NA, sep = "\t")
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
856 #end if
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
857
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
858
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
859
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
860 ]]></configfile>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
861 </configfiles>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
862 <inputs>
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
863 <param name="infile" type="data" format="imzml,rdata,analyze75" label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData"
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
864 help="Upload composite datatype imzml (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/>
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
865 <conditional name="processed_cond">
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
866 <param name="processed_file" type="select" label="Is the input file a processed imzML file ">
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
867 <option value="no_processed" selected="True">not a processed imzML</option>
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
868 <option value="processed">processed imzML</option>
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
869 </param>
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
870 <when value="no_processed"/>
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
871 <when value="processed">
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
872 <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"/>
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
873 <param name="units" display="radio" type="select" label="Unit of the mass accuracy" help="either m/z or ppm">
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
874 <option value="mz" >mz</option>
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
875 <option value="ppm" selected="True" >ppm</option>
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
876 </param>
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
877 </when>
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
878 </conditional>
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
879 <param name="filename" type="text" value="" optional="true" label="Title" help="will appear as header in the quality report, if nothing given input dataset name is used"/>
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
880 <param name="calibrant_file" type="data" optional="true" format="tabular"
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
881 label="File with internal calibrants" help="first column: m/z, second column: name (optional), tabular file"/>
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
882 <param name="plusminus_ppm" value="50" type="float" label="ppm range" help="Will be added in both directions to input calibrant m/z"/>
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
883 <repeat name="calibrantratio" title="Plot fold change of two m/z" min="0" max="10">
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
884 <param name="mass1" value="1111" type="float" label="M/z 1" help="First m/z"/>
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
885 <param name="mass2" value="2222" type="float" label="M/z 2" help="Second m/z"/>
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
886 <param name="distance" value="0.25" type="float" label="M/z range" help="Plusminus m/z window added to input m/z. In both m/z ranges the maximum intensity is used to calculate the fold change"/>
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
887 <param name="filenameratioplot" type="text" optional="true" label="Title" help="Optional title for fold change plot."/>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
888 </repeat>
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
889 <param name="pixel_output" type="boolean" display="radio" label="Tabular output with spectra information"/>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
890 </inputs>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
891 <outputs>
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
892 <data format="pdf" name="plots" from_work_dir="qualitycontrol.pdf" label = "$infile.display_name QC_report"/>
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
893 <data format="tabular" name="pixel_tabular_output" label="$infile.display_name spectra information">
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
894 <filter>pixel_output</filter>
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
895 </data>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
896 </outputs>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
897 <tests>
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
898 <test expect_num_outputs="2">
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
899 <param name="infile" value="" ftype="imzml">
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
900 <composite_data value="Example_Processed.imzML"/>
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
901 <composite_data value="Example_Processed.ibd"/>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
902 </param>
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
903 <conditional name="processed_cond">
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
904 <param name="processed_file" value="processed"/>
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
905 <param name="accuracy" value="200"/>
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
906 <param name="units" value="ppm"/>
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
907 </conditional>
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
908 <param name="calibrant_file" value="inputcalibrantfile1.txt"/>
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
909 <param name="plusminus_ppm" value="100"/>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
910 <param name="filename" value="Testfile_imzml"/>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
911 <repeat name="calibrantratio">
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
912 <param name="mass1" value="328.9"/>
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
913 <param name="mass2" value="398.8"/>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
914 <param name="distance" value="0.25"/>
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
915 <param name="filenameratioplot" value = "Ratio of mass1 (328.9) / mass2 (398.8)"/>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
916 </repeat>
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
917 <param name="pixel_output" value="True"/>
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
918 <output name="pixel_tabular_output" file="spectra_info_imzml.txt"/>
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
919 <output name="plots" file="QC_imzml.pdf" compare="sim_size" delta="20000"/>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
920 </test>
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
921 <test expect_num_outputs="1">
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
922 <param name="infile" value="" ftype="analyze75">
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
923 <composite_data value="Analyze75.hdr"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
924 <composite_data value="Analyze75.img"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
925 <composite_data value="Analyze75.t2m"/>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
926 </param>
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
927 <param name="calibrant_file" value="inputcalibrantfile2.txt"/>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
928 <param name="filename" value="Testfile_analyze75"/>
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
929 <output name="plots" file="QC_analyze75.pdf" compare="sim_size" delta="20000"/>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
930 </test>
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
931 <test expect_num_outputs="2">
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
932 <param name="infile" value="123_combined.RData" ftype="rdata"/>
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
933 <param name="filename" value="Testfile_rdata"/>
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
934 <param name="pixel_output" value="True"/>
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
935 <output name="pixel_tabular_output" file="spectra_info_123_combi.txt"/>
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
936 <output name="plots" file="QC_rdata.pdf" compare="sim_size" delta="20000"/>
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
937 </test>
10
3eee933c27cf planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
galaxyp
parents: 9
diff changeset
938 <test expect_num_outputs="1">
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
939 <param name="infile" value="empty_spectra.rdata" ftype="rdata"/>
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
940 <param name="calibrant_file" value="inputcalibrantfile2.txt"/>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
941 <param name="filename" value="Testfile_rdata"/>
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
942 <output name="plots" file="QC_empty_spectra.pdf" compare="sim_size" delta="20000"/>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
943 </test>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
944 </tests>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
945 <help>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
946 <![CDATA[
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
947 Cardinal is an R package that implements statistical & computational tools for analyzing mass spectrometry imaging datasets. `More information on Cardinal <http://cardinalmsi.org//>`_
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
948
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
949 This tool uses Cardinal to read files and create a quality control report with descriptive plots for mass spectrometry imaging data.
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
950
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
951 Input data: 3 types of input data can be used:
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
952
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
953 - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <https://ms-imaging.org/wp/imzml/>`_
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
954 - Analyze7.5 (upload hdr, img and t2m file via the "composite" function)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
955 - Cardinal "MSImageSet" data (with variable name "msidata", saved as .RData)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
956
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
957 Options:
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
958
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
959 - internal calibrants are used for m/z heatmaps (x-y grid), heatmap of number of calibrants per spectrum (x-y grid), zoomed in mass spectra, m/z accuracy
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
960 - optional fold change plot: draws a heatmap (x-y grid) for the fold change of two m/z (log2(intensity ratio))
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
961
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
962 Output:
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
963
9
963c7ec00141 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit a7be47698f53eb4f00961192327d93e8989276a7
galaxyp
parents: 8
diff changeset
964 - quality control report as pdf with key numbers and descriptive plots describing the mass spectrometry imaging data
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
965 - optional spectra information as tabular file with numbers of calibrants (needs valid calibrants), numbers of peaks, TIC and most abundant m/z in each spectrum
8
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
966
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
967 Tip:
52ef77866de8 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
galaxyp
parents: 7
diff changeset
968
11
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
969 - For additional m/z heatmaps use the MSI ion images tool and to plot more mass spectra use the MSI mass spectra tool.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
970
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
971 ----------------------------------------------------------------------------------------------------------------------------------------------------
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
972
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
973 Overview of the QC report plots:
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
974
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
975 - (comb): this plots will only be drawn if several files were combined into one file with the msi_combine tool
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
976 - (cal): this plots will only be drawn if a tabular file with at least one valid calibrant m/z is provided
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
977 - (FC): this plots will only be drawn if the optional fold change image is selected
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
978 - Vertical lines in histograms represent median values. In density scatter plots the colour changes from blue to green, yellow and red the more points are overlayed.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
979
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
980 - Overview of file properties: Numbers and ranges for m/z features and pixels are given. Median and range across all intensity values are provided. Intensities > 0 gives the percentage of m/z-pixel pairs with an intensity above zero. The number of empty spectra (TIC = 0), the median number of peaks (intensities > 0) per spectra as well as the median TIC (total ion chromatogram) are given. The processing status of the file is provided as well as the number of valid calibrants from the provided tabular file.> 0 (Intensities > 0).
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
981
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
982 x-y images (pixel/spectra information):
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
983
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
984 - (comb) Spatial orientation of combined data: All pixels of a combined file have the same colour.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
985 - Pixel order: Shows the order of the pixels in the provided file. Depending on the instrument this can represent the acquisition order.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
986 - (cal) Number of calibrants per pixel: In every spectrum the calibrant m/z window (calibrant m/z plusminus 'ppm range') is searched for peaks (intensity > 0). Calibrants are considered present in a spectrum when they have at least one peak in their m/z window.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
987 - (FC) Control of fold change plot: For both input m/z a zoomed in average spectrum is drawn with the input m/z as blue dashed line, the m/z range as blue dotted lines and the maximum intensity in the m/z window with a red line.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
988 - (FC) Fold change image: For each spectrum the intensities of the two optimal m/z features (red lines in control plots) are divided and log2 transformed to obtain the fold change, which is then plotted as a heatmap.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
989 - (cal) Intensity heatmaps for the m/z value that is closest to the calibrant m/z. The intensities are averaged within the calibrant m/z window (ppm range).
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
990 - Number of peaks per spectrum: For each spectrum the number of m/z values with intensity > 0 is calculated and plotted as heatmap.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
991 - Total ion chromatogram: For each spectrum all intensities are summed up to obtain the TIC which is plotted as heatmap.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
992 - Most abundant m/z in each spectrum: For each spectrum the m/z value with the highest intensity is plotted.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
993 - PCA for two components: Result of a principal component analysis (PCA) for two components is given. The loading plot depicts the contribution of each m/z value and the x-y image represents the differences between the pixels.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
994
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
995 Properties over spectra/pixels:
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
996
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
997 - Number of peaks per spectrum: Scatter plot and histogram showing the number of intensities > 0 for each spectrum. Dotted lines in the scatter plot separate spectra of combined samples.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
998 - (comb) Number of peaks per spectrum and sample: Same histogram as in plot before but with colours to show the contribution of each combined sample.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
999 - TIC per spectrum: Scatter plot and histogram showing the sum of all intensities per spectrum (TIC). Dotted lines in the scatter plot separate spectra of combined samples.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1000 - (comb) TIC per spectrum and sample: Same histogram as in plot before but with colours to show the contribution of each combined sample.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1001
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1002 Properties over m/z features:
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1003
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1004 - Histogram of m/z values: Histogram of all m/z values (complete m/z axis)
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1005 - Number of peaks per m/z: Scatter plot and histogram giving the number of intensities > 0 for each m/z.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1006 - Sum of intensities per m/z: Scatter plot and histogram of the sum of all intensities per m/z.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1007
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1008 Intensity plots:
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1009
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1010 - Median intensity per spectrum: Scatter plot in which each point represents the median intensity for one spectrum. Dotted lines in the scatter plot separate spectra of combined samples.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1011 - Log2-transformed intensities: Histogram of log2-transformed intensities.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1012 - (comb) log2-transformed intensities per sample: Same histogram as before but with colours to show the contribution of each combined sample.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1013 - (comb) Mean intensities per m/z and sample: For all pixels of a sample the mean intensity for each m/z is calculated and shown as boxplot.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1014
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1015 Mass spectra and m/z accuracy:
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1016
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1017 - Mass spectra over the full m/z range: First plot shows the average intensities over all spectra. The other three mass spectra are from single pixels (spectra).
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1018 - (cal) For each calibrant four zoomed in mass spectrum are drawn: The first shows the average intensities over all spectra and the other three are single mass spectra. The theoretical calibrant m/z (taken from the input file) is represented by the dashed blue line. The dotted blue lines show the given ppm range. The green line is the m/z value that is closest to the theoretical calibrant and the red line is the m/z with the highest average intensity in the m/z window.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1019 - (comb) Average spectrum per sample: For each calibrant a zoomed in mass spectrum is plotted this time with the average intensities for each combined sample separately.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1020 - (cal) Difference m/z with max. average intensity vs. theor. calibrant m/z: The difference in ppm between the m/z with the highest average intensity and the theoretical m/z are plotted for each calibrant. This corresponds to the difference between the dashed blue line and the red line in the zoomed in mass spectra.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1021 - (cal) Difference closest measured m/z vs. theor. calibrant m/z: The difference in ppm between the closest m/z value and the theoretical m/z values are plotted for each calibrant. This corresponds to the difference between the dashed blue line and the green line in the zoomed in mass spectra.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1022 - (cal) Difference m/z with max. average intensity vs. theor. m/z (per spectrum): For each spectrum the ppm difference between the m/z with the highest average intensity and the theoretical m/z are plotted. The calibrants have different plotting colours. Dashed lines separate spectra of combined samples.
30d0aabb1b46 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 6d877681b6188999b4f5abb1843b420078b71b92
galaxyp
parents: 10
diff changeset
1023
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
1024
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
1025 ]]>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
1026 </help>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
1027 <citations>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
1028 <citation type="doi">10.1093/bioinformatics/btv146</citation>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
1029 </citations>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
1030 </tool>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
1031