annotate msi_qualitycontrol.xml @ 3:f6aa0cff777c draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
author galaxyp
date Sat, 24 Feb 2018 12:48:28 -0500
parents 1ccbda92b76b
children fef8bd551236
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
1 <tool id="mass_spectrometry_imaging_qc" name="MSI Qualitycontrol" version="1.7.0.2">
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>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
6 <requirement type="package" version="1.7.0">bioconductor-cardinal</requirement>
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>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
11 </requirements>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
12 <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
13 <![CDATA[
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
14 #if $infile.ext == 'imzml'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
15 cp '${infile.extra_files_path}/imzml' infile.imzML &&
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
16 cp '${infile.extra_files_path}/ibd' infile.ibd &&
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
17 #elif $infile.ext == 'analyze75'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
18 cp '${infile.extra_files_path}/hdr' infile.hdr &&
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
19 cp '${infile.extra_files_path}/img' infile.img &&
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
20 cp '${infile.extra_files_path}/t2m' infile.t2m &&
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
21 #else
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
22 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
23 #end if
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
24 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
25 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
26 ]]>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
27 </command>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
28 <configfiles>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
29 <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
30
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
31 library(Cardinal)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
32 library(ggplot2)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
33 library(RColorBrewer)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
34 library(gridExtra)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
35 library(KernSmooth)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
36
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
37 ## Read MALDI Imagind dataset
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
38
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
39 #if $infile.ext == 'imzml'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
40 msidata <- readMSIData('infile.imzML')
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
41 #elif $infile.ext == 'analyze75'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
42 msidata <- readMSIData('infile.hdr')
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
43
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
44 #else
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
45 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
46 #end if
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
47
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
48 #if $inputpeptidefile:
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
49 ### Read tabular file with peptide masses for plots and heatmap images:
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
50 input_list = read.delim("$inputpeptidefile", header = FALSE, na.strings=c("","NA", "#NUM!", "#ZAHL!"), stringsAsFactors = FALSE)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
51 if (ncol(input_list) == 1)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
52 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
53 input_list = cbind(input_list, input_list)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
54 }
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
55 #else
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
56 input_list = data.frame(0, 0)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
57 #end if
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
58 colnames(input_list)[1:2] = c("mz", "name")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
59
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
60 #if $inputcalibrants:
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
61 ### Read tabular file with calibrant masses:
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
62 calibrant_list = read.delim("$inputcalibrants", header = FALSE, na.strings=c("","NA", "#NUM!", "#ZAHL!"), stringsAsFactors = FALSE)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
63 if (ncol(calibrant_list) == 1)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
64 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
65 calibrant_list = cbind(calibrant_list, calibrant_list)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
66 }
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
67 #else
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
68 calibrant_list = data.frame(0,0)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
69 #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
70
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
71 colnames(calibrant_list)[1:2] = c("mz", "name")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
72
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
73
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
74 ###################################### 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
75
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
76 ## Number of features (mz)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
77 maxfeatures = length(features(msidata))
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
78 ## Range mz
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
79 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
80 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
81 ## 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
82 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
83 ## 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
84 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
85 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
86 ## 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
87 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
88 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
89 ## 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
90 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
91 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
92 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
93 ## 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
94 npeaks= sum(spectra(msidata)[]>0)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
95 ## Spectra multiplied with mz (potential number of peaks)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
96 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
97 ## 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
98 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
99 ## 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
100 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
101 NumemptyTIC = sum(TICs == 0)
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 ## Processing informations
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
104 processinginfo = processingData(msidata)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
105 centroidedinfo = processinginfo@centroided # TRUE or FALSE
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
106
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
107 ## if TRUE write processinginfo if no write FALSE
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 ## normalization
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@normalization) == 0) {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
111 normalizationinfo='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 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
114 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
115 ## smoothing
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@smoothing) == 0) {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
117 smoothinginfo='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 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
120 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
121 ## baseline
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
122 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
123 baselinereductioninfo='FALSE'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
124 } else {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
125 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
126 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
127 ## peak picking
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
128 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
129 peakpickinginfo='FALSE'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
130 } else {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
131 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
132 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
133
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
134 ### calculate how many input peptide masses are valid:
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
135 inputpeptides = input_list[input_list[,1]>minmz & input_list[,1]<maxmz,]
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
136
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
137 ### calculate how many input calibrant masses are valid:
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
138 inputcalibrants = calibrant_list[calibrant_list[,1]>minmz & calibrant_list[,1]<maxmz,]
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
139
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
140 ### bind inputcalibrants and inputpeptides together, to make heatmap on both lists
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
141
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
142 inputs_all = rbind(inputcalibrants[,1:2], inputpeptides[,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
143 inputmasses = inputs_all[,1]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
144 inputnames = inputs_all[,2]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
145
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
146
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
147 properties = c("Number of mz features",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
148 "Range of mz values [Da]",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
149 "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
150 "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
151 "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
152 "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
153 "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
154 "Intensities > 0",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
155 "Number of zero TICs",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
156 "Preprocessing",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
157 "Normalization",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
158 "Smoothing",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
159 "Baseline reduction",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
160 "Peak picking",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
161 "Centroided",
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
162 paste0("# valid masses in ", "$filename"))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
163
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
164 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
165 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
166 paste0(pixelcount),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
167 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
168 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
169 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
170 paste0(medint),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
171 paste0(percpeaks, " %"),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
172 paste0(NumemptyTIC),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
173 paste0(" "),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
174 paste0(normalizationinfo),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
175 paste0(smoothinginfo),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
176 paste0(baselinereductioninfo),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
177 paste0(peakpickinginfo),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
178 paste0(centroidedinfo),
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
179 paste0(length(inputmasses), "/", length(calibrant_list[,1])+length(input_list[,1])))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
180
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
181
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
182 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
183
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
184 ######################################## PDF #############################################
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
185 ##########################################################################################
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
186 ##########################################################################################
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 pdf("qualitycontrol.pdf", fonts = "Times", pointsize = 12)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
189 plot(0,type='n',axes=FALSE,ann=FALSE)
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
190 #if not $filename:
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
191 #set $filename = $infile.display_name
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
192 #end if
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
193 title(main=paste("Quality control of MSI data\n\n", "Filename:", "$filename"))
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
194
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
195 ############################# I) numbers ####################################
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
196 #############################################################################
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
197 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
198
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
199 if (npeaks > 0)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
200 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
201 ############################# II) ion images #################################
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
202 ##############################################################################
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
203
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
204 ## function without xaxt for plots with automatic x axis
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
205 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
206 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
207 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
208 xlab="",ylab="",main=""){
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
209
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
210 df <- data.frame(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
211 x <- densCols(x1,x2, colramp=colorRampPalette(c("black", "white")))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
212 df\$dens <- col2rgb(x)[1,] + 1L
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
213 cols <- colorRampPalette(c("#000099", "#00FEFF", "#45FE4F","#FCFF00", "#FF9400", "#FF3100"))(256)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
214 df\$col <- cols[df\$dens]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
215 plot(x2~x1, data=df[order(df\$dens),],
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
216 ylim=ylim,xlim=xlim,pch=20,col=col,
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
217 cex=1,xlab=xlab,ylab=ylab,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
218 main=main)
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
219 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
220
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
221 ## Variables for plots
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
222 xrange = 1
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
223 yrange = 1
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
224 maxx = max(coord(msidata)[,1])+xrange
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
225 minx = min(coord(msidata)[,1])-xrange
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
226 maxy = max(coord(msidata)[,2])+yrange
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
227 miny = min(coord(msidata)[,2])-yrange
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
228
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
229 ############################################################################
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
230
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
231 ## 1) Acquisition image
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
232
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
233 pixelnumber = 1:pixelcount
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
234 pixelxyarray=cbind(coord(msidata),pixelnumber)
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
235
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
236 print(ggplot(pixelxyarray, aes(x=x, y=y, fill=pixelnumber))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
237 + geom_tile() + coord_fixed()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
238 + ggtitle("1) Order of Acquisition")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
239 +theme_bw()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
240 + scale_fill_gradientn(colours = c("blue", "purple" , "red","orange"),
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
241 space = "Lab", na.value = "black", name = "Acq"))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
242
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
243 ## 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
244
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
245 pixelmatrix = matrix(ncol=ncol(msidata), nrow=0)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
246 inputcalibrantmasses = inputcalibrants[,1]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
247
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
248 if (length(inputcalibrantmasses) != 0)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
249 { for (calibrantnr in 1:length(inputcalibrantmasses))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
250 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
251 calibrantmz = inputcalibrantmasses[calibrantnr]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
252 calibrantfeaturemin = features(msidata, mz=calibrantmz-$plusminusinDalton)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
253 calibrantfeaturemax = features(msidata, mz=calibrantmz+$plusminusinDalton)
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
254
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
255 if (calibrantfeaturemin == calibrantfeaturemax)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
256 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
257
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
258 calibrantintensity = spectra(msidata)[calibrantfeaturemin,]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
259
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
260 }else{
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
261
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
262 calibrantintensity = colSums(spectra(msidata)[calibrantfeaturemin:calibrantfeaturemax,] )
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
263
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
264 }
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
265 pixelmatrix = rbind(pixelmatrix, calibrantintensity)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
266 }
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
267
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
268 countvector= as.factor(colSums(pixelmatrix>0))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
269 countdf= cbind(coord(msidata), countvector)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
270 mycolours = c("black","grey", "darkblue", "blue", "green" , "red", "yellow", "magenta", "olivedrap1", "lightseagreen")
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
271
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
272 print(ggplot(countdf, aes(x=x, y=y, fill=countvector))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
273 + geom_tile() + coord_fixed()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
274 + ggtitle("2) Number of calibrants per pixel")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
275 + theme_bw()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
276 + theme(text=element_text(family="ArialMT", face="bold", size=12))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
277 + scale_fill_manual(values = mycolours[1:length(countvector)],
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
278 na.value = "black", name = "# calibrants"))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
279 }else{print("2) The inputcalibrant masses were outside the mass range")}
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
280
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
281
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
282 ############# new 2b) image of foldchanges (log2 intensity ratios) between two masses in the same spectrum
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
283
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
284 #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
285 #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
286 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
287 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
288 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
289
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
290 #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
291 #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
292 #else:
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
293 #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
294 #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
295
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
296 ### find rows which contain masses:
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
297
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
298 mzrowdown1 = features(msidata, mz = mass1-distance)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
299 mzrowup1 = features(msidata, mz = mass1+distance)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
300 mzrowdown2 = features(msidata, mz = mass2-distance)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
301 mzrowup2 = features(msidata, mz = mass2+distance)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
302
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
303 ### lower and upperlimit for the plot
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
304 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
305 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
306 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
307 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
308
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
309 ### plot the part which was chosen, with chosen value in blue, distance in blue, maxmass in red, xlim fixed to 5 Da window
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
310
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
311 if (mzrowdown1 == mzrowup1)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
312 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
313 maxmassrow1 = spectra(msidata)[mzrowup1,]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
314 maxmass1 = mz(msidata)[mzrowup1][which.max(maxmassrow1)]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
315 }else{
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
316 maxmassrow1 = rowMeans(spectra(msidata)[mzrowdown1:mzrowup1,])
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
317 maxmass1 = mz(msidata)[mzrowdown1:mzrowup1][which.max(maxmassrow1)]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
318 }
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
319 if (mzrowdown2 == mzrowup2)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
320 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
321 maxmassrow2 = spectra(msidata)[mzrowup2,]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
322 maxmass2 = mz(msidata)[mzrowup2][which.max(maxmassrow2)]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
323 }else{
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
324 maxmassrow2 = rowMeans(spectra(msidata)[mzrowdown2:mzrowup2,])
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
325 maxmass2 = mz(msidata)[mzrowdown2:mzrowup2][which.max(maxmassrow2)]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
326 }
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
327
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
328 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
329 plot(msidata[mzdown1:mzup1,], pixel = 1:pixelcount, main=paste0("average spectrum ", mass1, " Da"))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
330 abline(v=c(mass1-distance, mass1, mass1+distance), col="blue",lty=c(3,5,3))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
331 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
332
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
333 plot(msidata[mzdown2:mzup2,], pixel = 1:pixelcount, main= paste0("average spectrum ", mass2, " Da"))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
334 abline(v=c(mass2-distance, mass2, mass2+distance), col="blue", lty=c(3,5,3))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
335 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
336 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
337
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
338 ### filter spectra for maxmass to have two vectors, which can be divided
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
339
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
340 mass1vector = spectra(msidata)[features(msidata, mz = maxmass1),]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
341 mass2vector = spectra(msidata)[features(msidata, mz = maxmass2),]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
342
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
343 foldchange = log2(mass1vector/mass2vector)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
344
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
345 ratiomatrix = cbind(foldchange, coord(msidata))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
346
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
347 print(ggplot(ratiomatrix, aes(x=x, y=y, fill=foldchange), colour=colo)
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
348 + geom_tile() + coord_fixed()
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
349 + ggtitle("$label")
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
350 + theme_bw()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
351 + theme(text=element_text(family="ArialMT", face="bold", size=12))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
352 + scale_fill_gradientn(colours = c("blue", "purple" , "red","orange")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
353 ,space = "Lab", na.value = "black", name ="FC"))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
354 #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
355 #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
356
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
357 ## 3) Calibrant images:
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
358
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
359 par(mfrow=c(1,1), mar=c(5.1, 4.1, 4.1, 2.1), mgp=c(3, 1, 0), las=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
360 if (length(inputmasses) != 0)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
361 { for (mass in 1:length(inputmasses))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
362 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
363 image(msidata, mz=inputmasses[mass], plusminus=$plusminusinDalton,
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
364 main= paste0("3", LETTERS[mass], ") ", inputnames[mass], " (", round(inputmasses[mass], digits = 2)," ± ", $plusminusinDalton, " Da)"),
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
365 contrast.enhance = "histogram", ylim=c(maxy+1, 0))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
366 }
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
367 } else {print("3) The inputpeptide masses were outside the mass range")}
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
368
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
369 ## 4) Number of peaks per pixel - image
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
370
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
371 peaksperpixel = colSums(spectra(msidata)[]> 0)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
372 peakscoordarray=cbind(coord(msidata), peaksperpixel)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
373
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
374 print(ggplot(peakscoordarray, aes(x=x, y=y, fill=peaksperpixel), colour=colo)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
375 + geom_tile() + coord_fixed()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
376 + ggtitle("4) Number of peaks per pixel")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
377 + theme_bw()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
378 + theme(text=element_text(family="ArialMT", face="bold", size=12))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
379 + scale_fill_gradientn(colours = c("blue", "purple" , "red","orange")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
380 ,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
381
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
382 ## 5) TIC image
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
383 TICcoordarray=cbind(coord(msidata), TICs)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
384 colo <- colorRampPalette(
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
385 c("blue", "cyan", "green", "yellow","red"))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
386 print(ggplot(TICcoordarray, aes(x=x, y=y, fill=TICs), colour=colo)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
387 + geom_tile() + coord_fixed()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
388 + ggtitle("5) Total Ion Chromatogram")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
389 + theme_bw()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
390 + theme(text=element_text(family="ArialMT", face="bold", size=12))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
391 + scale_fill_gradientn(colours = c("blue", "purple" , "red","orange")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
392 ,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
393
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
394 ## 6) Most abundant mass image
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
395
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
396 highestmz = apply(spectra(msidata)[],2,which.max)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
397 highestmz_matrix = cbind(coord(msidata),mz(msidata)[highestmz])
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
398 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
399
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
400 print(ggplot(highestmz_matrix, aes(x=x, y=y, fill=highestmzinDa))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
401 + geom_tile() + coord_fixed()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
402 + ggtitle("6) Most abundant m/z in each pixel")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
403 + theme_bw()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
404 + scale_fill_gradientn(colours = c("blue", "purple" , "red","orange"), space = "Lab", na.value = "black", name = "m/z",
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
405 labels = as.character(pretty(highestmz_matrix\$highestmzinDa)[c(1,3,5,7)]),
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
406 breaks = pretty(highestmz_matrix\$highestmzinDa)[c(1,3,5,7)], limits=c(min(highestmz_matrix\$highestmzinDa), max(highestmz_matrix\$highestmzinDa)))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
407 + theme(text=element_text(family="ArialMT", face="bold", size=12)))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
408
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
409 ## which mz are highest
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
410 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
411 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
412
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
413 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
414 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
415
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
416 ## 7) pca image for two components
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
417 pca <- PCA(msidata, ncomp=2)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
418 par(mfrow = c(2,1))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
419 plot(pca, col=c("black", "darkgrey"), main="7) PCA for two components")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
420 image(pca, col=c("black", "white"),ylim=c(maxy+1, 0))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
421
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
422
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
423 ############################# III) properties over acquisition (spectra index)##########
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
424 ##############################################################################
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
425
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
426 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
427
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
428 ## 8a) number of peaks per spectrum - scatterplot
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
429 plot_colorByDensity(pixels(msidata), peaksperpixel, ylab = "", xlab = "", main="8a) Number of peaks per spectrum")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
430 title(xlab="Spectra index \n (= Acquisition time)", line=3)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
431 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
432
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
433 ## 8b) number of peaks per spectrum - histogram
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
434 hist(peaksperpixel, main="", las=1, xlab = "Number of peaks per spectrum", ylab="")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
435 title(main="8b) Number of peaks per spectrum", line=2)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
436 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
437 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
438
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 ## 9a) TIC per spectrum - density scatterplot
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
440 zero=0
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
441 par(mfrow = c(2,1), mar=c(5,6,4,2))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
442 plot_colorByDensity(pixels(msidata), TICs, ylab = "", xlab = "", main="9a) TIC per pixel")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
443 title(xlab="Spectra index \n (= Acquisition time)", line=3)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
444 title(ylab = "Total ion chromatogram intensity", 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
445
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
446 ## 9b) TIC per spectrum - histogram
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
447 hist(log(TICs), main="", las=1, xlab = "log(TIC per spectrum)", ylab="")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
448 title(main= "9b) TIC per spectrum", line=2)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
449 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
450 abline(v=median(log(TICs[TICs>0])), col="blue")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
451
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
452
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
453 ## 10) intensity of chosen peptides over acquisition (pixel index)
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
454
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
455 if (length(inputcalibrants[,1]) != 0)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
456 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
457 par(mfrow = c(3, 2), 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
458 intensityvector = vector()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
459 for (mzvalue in 1:length(inputcalibrants[,1]))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
460 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
461 mznumber = features(msidata, mz = inputcalibrants[,1][mzvalue])
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
462 intensityvector = spectra(msidata)[][mznumber,]
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
463 plot(intensityvector, main=inputnames[mzvalue], xlab="Spectra index \n (= Acquisition time)")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
464 }
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
465 title("10) intensity of calibrants over acquisition", 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
466 }else{print("10) The inputcalibrant masses were outside the mass range")}
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
467
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
468 ################################## IV) changes over mz ############################
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
469 ###################################################################################
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
470
2
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) Number of peaks per mz
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
472 ## Number of peaks per mz - number across all pixel
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
473 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
474
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
475 par(mfrow = c(2,1), mar=c(5,6,4,4.5))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
476 ## 11a) Number of peaks per mz - scatterplot
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
477 plot_colorByDensity(mz(msidata),peakspermz, main= "11a) Number of peaks for each mz", ylab ="")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
478 title(xlab="mz in Dalton", line=2.5)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
479 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
480 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
481 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
482
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
483 # make plot smaller to fit axis and labels, add second y axis with %
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
484 ## 11b) Number of peaks per mz - histogram
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
485 hist(peakspermz, main="", las=1, ylab="")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
486 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
487 title(main="11b) Number of peaks per mz", xlab = "Number of peaks per mz", line=2)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
488 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
489
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
490
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
491 ## 12) Sum of intensities per mz
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
492
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
493 ## Sum of all intensities for each mz (like TIC, but for mz instead of pixel)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
494 mzTIC = rowSums(spectra(msidata)[]) # calculate intensity sum for each mz
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
495
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
496 par(mfrow = c(2,1), mar=c(5,6,4,2))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
497 # 12a) sum of intensities per mz - scatterplot
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
498 plot_colorByDensity(mz(msidata),mzTIC, main= "12a) Sum of all peak intensities for each mz", ylab ="")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
499 title(xlab="mz in Dalton", line=2.5)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
500 title(ylab="Intensity sum", 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
501 # 12b) sum of intensities per mz - histogram
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
502 hist(log(mzTIC), main="", xlab = "", las=1, ylab="")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
503 title(main="12b) Sum of intensities per mz", line=2, ylab="")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
504 title(xlab = "log (sum of intensities per mz)")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
505 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
506 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
507
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
508 ################################## V) general plots ############################
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
509 ###################################################################################
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
510
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
511 ## 13) Intensity distribution
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
512
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
513 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
514
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
515 ## 13a) Intensity histogram:
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
516 hist(log2(spectra(msidata)[]), main="", xlab = "", ylab="", 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
517 title(main="13a) Log2-transformed intensities", line=2)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
518 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
519 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
520 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
521
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 ## 13b) Median intensity over spectra
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
523 medianint_spectra = apply(spectra(msidata), 2, median)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
524 plot(medianint_spectra, main="13b) Median intensity per spectrum",las=1, xlab="Spectra index \n (= Acquisition time)", ylab="")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
525 title(ylab="Median spectrum intensity", 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
526
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
527 ## 14) 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
528
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
529 par(mfrow = c(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
530 plot(msidata, pixel = 1:length(pixelnumber), main= "Average spectrum")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
531 plot(msidata, pixel =round(length(pixelnumber)/2, digits=0), main="Spectrum in middle of acquisition")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
532 plot(msidata, pixel = highestmz_pixel, main= paste0("Spectrum at ", rownames(coord(msidata)[highestmz_pixel,])))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
533 plot(msidata, pixel = secondhighestmz_pixel, main= paste0("Spectrum at ", rownames(coord(msidata)[secondhighestmz_pixel,])))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
534
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
535 ## 15) Zoomed in mass spectra for calibrants
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
536 plusminusvalue = $plusminusinDalton
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
537 x = 1
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
538 if (length(inputcalibrantmasses) != 0)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
539 {
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
540
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
541 for (calibrant in inputcalibrantmasses)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
542 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
543 minmasspixel = features(msidata, mz=calibrant-1)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
544 maxmasspixel = features(msidata, mz=calibrant+3)
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
545 par(mfrow = c(2, 2), 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
546 plot(msidata[minmasspixel:maxmasspixel,], pixel = 1:length(pixelnumber), main= "average spectrum")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
547 abline(v=c(calibrant-plusminusvalue, calibrant,calibrant+plusminusvalue), col="blue", lty=c(3,5,3))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
548 plot(msidata[minmasspixel:maxmasspixel,], pixel =round(pixelnumber/2, digits=0), main="pixel in middle of acquisition")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
549 abline(v=c(calibrant-plusminusvalue, calibrant,calibrant+plusminusvalue), col="blue", lty=c(3,5,3))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
550 plot(msidata[minmasspixel:maxmasspixel,], pixel = highestmz_pixel,main= paste0("Spectrum at ", rownames(coord(msidata)[highestmz_pixel,])))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
551 abline(v=c(calibrant-plusminusvalue, calibrant,calibrant+plusminusvalue), col="blue", lty=c(3,5,3))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
552 plot(msidata[minmasspixel:maxmasspixel,], pixel = secondhighestmz_pixel, main= paste0("Spectrum at ", rownames(coord(msidata)[secondhighestmz_pixel,])))
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
553 abline(v=c(calibrant-plusminusvalue, calibrant,calibrant+plusminusvalue), col="blue", lty=c(3,5,3))
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(paste0(inputcalibrants[x,1]), 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
555 x=x+1
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
556 }
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
557
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 }else{print("15) The inputcalibrant masses were outside the mass range")}
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
559
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
560 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
561 }else{
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
562 print("inputfile has no intensities > 0")
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
563 dev.off()
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
564 }
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
565
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
566 ]]></configfile>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
567 </configfiles>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
568 <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
569 <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
570 help="Upload composite datatype imzml (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
571 <param name="filename" type="text" value="" optional="true" label="Title" help="will appear in the quality report. If nothing given it will take the dataset name."/>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
572 <param name="inputpeptidefile" type="data" optional="true" format="txt, csv" label="Text file with peptidemasses and names"
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
573 help="first column peptide m/z, second column peptide name, tab separated file"/>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
574 <param name="inputcalibrants" type="data" optional="true" format="txt,csv"
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
575 label="Internal calibrants"
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
576 help="Used for plot number of calibrant per spectrum and for zoomed in 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
577 <param name="plusminusinDalton" value="0.25" type="text" label="Mass range" help="plusminus mass window in Dalton"/>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
578 <repeat name="calibrantratio" title="Plot fold change of two masses for each spectrum" min="0" max="10">
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
579 <param name="mass1" value="1111" type="float" label="Mass 1" help="First mass in Dalton"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
580 <param name="mass2" value="2222" type="float" label="Mass 2" help="Second mass in Dalton"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
581 <param name="distance" value="0.25" type="float" label="Distance in Dalton" help="Distance in Da used to find peak maximum from input masses in both directions"/>
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
582 <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
583 </repeat>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
584 </inputs>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
585 <outputs>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
586 <data format="pdf" name="plots" from_work_dir="qualitycontrol.pdf" label = "${tool.name} on $infile.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
587 </outputs>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
588
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
589 <tests>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
590 <test>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
591 <param name="infile" value="" ftype="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
592 <composite_data value="Example_Continuous.imzML" />
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
593 <composite_data value="Example_Continuous.ibd" />
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
594 </param>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
595 <param name="inputpeptidefile" value="inputpeptides.csv" ftype="csv"/>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
596 <param name="inputcalibrants" ftype="txt" value="inputcalibrantfile1.txt"/>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
597 <param name="plusminusinDalton" value="0.25"/>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
598 <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
599 <repeat name="calibrantratio">
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
600 <param name="mass1" value="111"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
601 <param name="mass2" value="222"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
602 <param name="distance" value="0.25"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
603 </repeat>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
604 <output name="plots" file="Testfile_qualitycontrol_imzml.pdf" compare="sim_size" delta="20000"/>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
605 </test>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
606
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
607 <test>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
608 <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
609 <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
610 <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
611 <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
612 </param>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
613 <param name="inputpeptidefile" value="inputpeptides.txt" ftype="txt"/>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
614 <param name="inputcalibrants" ftype="txt" 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
615 <param name="plusminusinDalton" value="0.5"/>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
616 <param name="filename" value="Testfile_analyze75"/>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
617 <output name="plots" file="Testfile_qualitycontrol_analyze75.pdf" compare="sim_size" delta="20000"/>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
618 </test>
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
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
620 <test>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
621 <param name="infile" value="preprocessing_results1.RData" ftype="rdata"/>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
622 <param name="inputpeptidefile" value="inputpeptides.csv" ftype="txt"/>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
623 <param name="inputcalibrants" ftype="txt" value="inputcalibrantfile1.txt"/>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
624 <param name="plusminusinDalton" value="0.1"/>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
625 <param name="filename" value="Testfile_rdata"/>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
626 <output name="plots" file="Testfile_qualitycontrol_rdata.pdf" compare="sim_size" delta="20000"/>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
627 </test>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
628 <test>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
629 <param name="infile" value="LM8_file16.rdata" ftype="rdata"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
630 <param name="inputpeptidefile" value="inputpeptides.txt" ftype="txt"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
631 <param name="inputcalibrants" ftype="txt" value="inputcalibrantfile2.txt"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
632 <param name="plusminusinDalton" value="0.1"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
633 <param name="filename" value="Testfile_rdata"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
634 <output name="plots" file="LM8_file16output.pdf" compare="sim_size" delta="20000"/>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
635 </test>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
636 </tests>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
637 <help>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
638 <![CDATA[
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 Quality control for maldi imaging mass spectrometry data.
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
640
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
641
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
642 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
643
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
644 - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <http://ms-imaging.org/wp/introduction/>`_
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
645 - 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
646 - 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
647
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
648 The output of this tool contains key values and plots of the imaging data as pdf.
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
649
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
650 ]]>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
651 </help>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
652 <citations>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
653 <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
654 </citations>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
655 </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
656