annotate msi_qualitycontrol.xml @ 5:ac786240ef07 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
author galaxyp
date Sun, 11 Mar 2018 10:38:43 -0400
parents fef8bd551236
children 5c63fe03ed9e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
1 <tool id="mass_spectrometry_imaging_qc" name="MSI Qualitycontrol" version="1.7.0.4">
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
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
37 ## Read MALDI Imaging dataset
0
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'
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
40 msidata = readMSIData('infile.imzML')
0
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'
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
42 msidata = readMSIData('infile.hdr')
0
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
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
48
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
49
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
50 ###################################### 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
51
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
52 ## 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
53 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
54 ## Range mz
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
55 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
56 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
57 ## 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
58 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
59 ## 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
60 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
61 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
62 ## 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
63 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
64 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
65 ## 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
66 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
67 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
68 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
69 ## 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
70 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
71 ## 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
72 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
73 ## 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
74 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
75 ## 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
76 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
77 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
78
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
79 ## Processing informations
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
80 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
81 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
82
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
83 ## 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
84
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
85 ## normalization
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
86 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
87 normalizationinfo='FALSE'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
88 } else {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
89 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
90 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
91 ## smoothing
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
92 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
93 smoothinginfo='FALSE'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
94 } else {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
95 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
96 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
97 ## baseline
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
98 if (length(processinginfo@baselineReduction) == 0) {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
99 baselinereductioninfo='FALSE'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
100 } else {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
101 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
102 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
103 ## peak picking
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
104 if (length(processinginfo@peakPicking) == 0) {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
105 peakpickinginfo='FALSE'
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
106 } else {
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
107 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
108 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
109
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
110 ### Read tabular file with peptide masses for plots and heatmap images:
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
111
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
112 #if $peptide_file:
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
113
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
114 input_list = read.delim("$peptide_file", header = FALSE, na.strings=c("","NA"), stringsAsFactors = FALSE)
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
115 if (ncol(input_list) == 1)
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
116 {
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
117 input_list = cbind(input_list, input_list)
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
118 }
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
119
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
120 ### calculate how many input peptide masses are valid:
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
121 inputpeptides = input_list[input_list[,1]>minmz & input_list[,1]<maxmz,]
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
122 number_peptides_in = length(input_list[,1])
5
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
123 number_peptides_valid = length(inputpeptides[,1])
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
124
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
125 #else
5
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
126 ###inputpeptides = data.frame(0,0)
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
127 inputpeptides = as.data.frame(matrix(, nrow = 0, ncol = 2))
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
128 number_peptides_in = 0
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
129 number_peptides_valid = 0
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
130 #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
131
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
132 colnames(inputpeptides) = c("mz", "name")
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
133
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
134 #if $calibrant_file:
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
135 ### Read tabular file with calibrant masses:
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
136 calibrant_list = read.delim("$calibrant_file", header = FALSE, na.strings=c("","NA"), stringsAsFactors = FALSE)
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
137 if (ncol(calibrant_list) == 1)
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
138 {
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
139 calibrant_list = cbind(calibrant_list, calibrant_list)
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
140 }
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
141 ### calculate how many input calibrant masses are valid:
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
142 inputcalibrants = calibrant_list[calibrant_list[,1]>minmz & calibrant_list[,1]<maxmz,]
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
143 number_calibrants_in = length(calibrant_list[,1])
5
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
144 number_calibrants_valid = length(inputcalibrants[,1])
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
145 #else
5
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
146 ###inputcalibrants = data.frame(0,0)
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
147
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
148 inputcalibrants = as.data.frame(matrix(, nrow = 0, ncol = 2))
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
149
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
150 number_calibrants_in = 0
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
151 number_calibrants_valid = 0
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
152 #end if
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
153
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
154 colnames(inputcalibrants) = c("mz", "name")
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
155
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
156 ### 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
157
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
158 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
159 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
160 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
161
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
162
5
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
163
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
164 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
165 "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
166 "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
167 "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
168 "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
169 "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
170 "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
171 "Intensities > 0",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
172 "Number of zero TICs",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
173 "Preprocessing",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
174 "Normalization",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
175 "Smoothing",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
176 "Baseline reduction",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
177 "Peak picking",
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
178 "Centroided",
5
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
179 paste0("# peptides in \n", "$peptide_file.display_name"),
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
180 paste0("# calibrants in \n", "$calibrant_file.display_name"))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
181
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
182 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
183 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
184 paste0(pixelcount),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
185 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
186 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
187 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
188 paste0(medint),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
189 paste0(percpeaks, " %"),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
190 paste0(NumemptyTIC),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
191 paste0(" "),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
192 paste0(normalizationinfo),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
193 paste0(smoothinginfo),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
194 paste0(baselinereductioninfo),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
195 paste0(peakpickinginfo),
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
196 paste0(centroidedinfo),
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
197 paste0(number_peptides_valid, " / " , number_peptides_in),
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
198 paste0(number_calibrants_valid, " / ", number_calibrants_in))
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
199
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
200
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
201 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
202
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
203 ######################################## PDF #############################################
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
204 ##########################################################################################
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
205 ##########################################################################################
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
206
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
207 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
208 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
209 #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
210 #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
211 #end if
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
212 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
213
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
214 ############################# I) numbers ####################################
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
215 #############################################################################
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
216 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
217
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
218 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
219 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
220 ############################# 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
221 ##############################################################################
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
222
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
223 ## 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
224 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
225 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
226 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
227 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
228
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
229 df = data.frame(x1,x2)
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
230 x = densCols(x1,x2, colramp=colorRampPalette(c("black", "white")))
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
231 df\$dens = col2rgb(x)[1,] + 1L
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
232 cols = colorRampPalette(c("#000099", "#00FEFF", "#45FE4F","#FCFF00", "#FF9400", "#FF3100"))(256)
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
233 df\$col = cols[df\$dens]
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
234 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
235 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
236 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
237 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
238 }
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
239
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
240
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
241 ############################################################################
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 ## 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
244
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
245 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
246 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
247
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
248 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
249 + 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
250 + 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
251 +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
252 + 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
253 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
254
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
255 ## 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
256
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
257 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
258 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
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 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
261 { 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
262 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
263 calibrantmz = inputcalibrantmasses[calibrantnr]
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
264 calibrantfeaturemin = features(msidata, mz=calibrantmz-$plusminus_dalton)
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
265 calibrantfeaturemax = features(msidata, mz=calibrantmz+$plusminus_dalton)
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
266
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
267 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
268 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
269
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
270 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
271
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
272 }else{
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
273
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
274 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
275
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
276 }
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
277 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
278 }
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
279
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
280 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
281 countdf= cbind(coord(msidata), countvector)
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
282 mycolours = c("black","grey", "darkblue", "blue", "green" , "red", "yellow", "magenta", "olivedrab1", "lightseagreen")
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
283
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
284 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
285 + 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
286 + 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
287 + 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
288 + 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
289 + 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
290 na.value = "black", name = "# calibrants"))
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
291 }else{print("2) The inputcalibrant masses were not provided or 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
292
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
293
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
294 ############# 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
295
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
296 #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
297 #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
298 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
299 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
300 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
301
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
302 #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
303 #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
304 #else:
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
305 #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
306 #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
307
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
308 ### 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
309
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
310 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
311 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
312 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
313 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
314
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
315 ### 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
316 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
317 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
318 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
319 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
320
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
321 ### find mass in the given range with the highest intensity (will be plotted in red)
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
322
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
323 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
324 {
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
325 maxmass1 = mz(msidata)[ mzrowdown1]
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
326 }else{ ### for all masses in the massrange calculate mean intensity over all pixels and take mass which has highest mean
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
327 maxmassrow1 = rowMeans(spectra(msidata)[mzrowdown1:mzrowup1,])
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
328 maxmass1 = mz(msidata)[mzrowdown1:mzrowup1][which.max(maxmassrow1)]
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
329 }
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
330 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
331 {
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
332 maxmass2 = mz(msidata)[mzrowup2]
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
333 }else{
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
334 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
335 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
336 }
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
337
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
338 ### plot the part which was chosen, with chosen value in blue, distance in blue, maxmass in red, xlim fixed to 5 Da window
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
339 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
340 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
341 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
342 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
343
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
344 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
345 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
346 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
347 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
348
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
349 ### 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
350
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
351 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
352 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
353 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
354
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
355 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
356
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
357 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
358 + 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
359 + 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
360 + 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
361 + 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
362 + 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
363 ,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
364 #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
365 #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
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 ## 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
368
3
f6aa0cff777c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
galaxyp
parents: 2
diff changeset
369 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
370 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
371 { 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
372 {
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
373 image(msidata, mz=inputmasses[mass], plusminus=$plusminus_dalton,
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
374 main= paste0("3", LETTERS[mass], ") ", inputnames[mass], " (", round(inputmasses[mass], digits = 2)," ± ", $plusminus_dalton, " Da)"),
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
375 contrast.enhance = "histogram", ylim=c(maximumy+2, 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
376 }
5
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
377 } else {print("3) The inputpeptide masses were not provided or outside the mass range")}
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
378
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
379
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
380 ## 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
381
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
382 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
383 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
384
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
385 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
386 + 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
387 + 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
388 + 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
389 + 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
390 + 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
391 ,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
392
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
393 ## 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
394 TICcoordarray=cbind(coord(msidata), TICs)
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
395 colo = colorRampPalette(
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
396 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
397 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
398 + 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
399 + 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
400 + 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
401 + 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
402 + 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
403 ,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
404
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
405 ## 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
406
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
407 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
408 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
409 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
410
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
411 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
412 + 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
413 + 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
414 + 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
415 + 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
416 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
417 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
418 + 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
419
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
420 ## 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
421 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
422 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
423
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
424 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
425 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
426
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
427 ## 7) pca image for two components
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
428 pca = PCA(msidata, ncomp=2)
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
429 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
430 plot(pca, col=c("black", "darkgrey"), main="7) PCA for two components")
5
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
431 image(pca, col=c("black", "white"),ylim=c(maximumy+2, 0), strip=FALSE)
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
432
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
433
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
434 ############################# 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
435 ##############################################################################
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
436
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
437 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
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 ## 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
440 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
441 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
442 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
443
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
444 ## 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
445 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
446 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
447 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
448 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
449
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
450 ## 9a) TIC per spectrum - density scatterplot
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
451 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
452 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
453 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
454 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
455 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
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 ## 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
458 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
459 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
460 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
461 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
462
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
463
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
464 ################################## 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
465 ###################################################################################
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
466
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
467 ## 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
468 ## 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
469 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
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 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
472 ## 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
473 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
474 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
475 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
476 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
477 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
478
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
479 # 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
480 ## 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
481 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
482 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
483 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
484 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
485
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
486
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
487 ## 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
488
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
489 ## 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
490 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
491
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
492 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
493 # 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
494 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
495 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
496 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
497 # 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
498 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
499 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
500 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
501 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
502 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
503
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
504 ################################## 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
505 ###################################################################################
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
506
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
507 ## 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
508
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
509 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
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 ## 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
512 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
513 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
514 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
515 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
516 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
517
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 ## 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
519 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
520 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
521 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
522
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
523 ## 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
524
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
525 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
526 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
527 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
528 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
529 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
530
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
531 ## 15) Zoomed in mass spectra for calibrants
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
532 plusminusvalue = $plusminus_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
533 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
534 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
535 {
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
536
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
537 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
538 {
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
539 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
540 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
541 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
542 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
543 abline(v=c(calibrant-plusminusvalue, calibrant,calibrant+plusminusvalue), col="blue", lty=c(3,5,3))
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
544 plot(msidata[minmasspixel:maxmasspixel,], pixel =round(length(pixelnumber)/2, digits=0), main="pixel in middle of acquisition")
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
545 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
546 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
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 = 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
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 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
551 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
552 }
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
553
5
ac786240ef07 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
galaxyp
parents: 4
diff changeset
554 }else{print("15) The inputcalibrant masses were not provided or 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
555
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
556 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
557 }else{
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
558 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
559 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
560 }
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
561
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
562 ]]></configfile>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
563 </configfiles>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
564 <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
565 <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
566 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
567 <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."/>
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
568 <param name="peptide_file" type="data" optional="true" format="tabular" label="Text file with peptidemasses and names"
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
569 help="first column peptide m/z, second column peptide name, tab separated file"/>
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
570 <param name="calibrant_file" type="data" optional="true" format="tabular"
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
571 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
572 help="Used for plot number of calibrant per spectrum and for zoomed in mass spectra"/>
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
573 <param name="plusminus_dalton" 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
574 <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
575 <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
576 <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
577 <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
578 <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
579 </repeat>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
580 </inputs>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
581 <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
582 <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
583 </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
584
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
585 <tests>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
586 <test>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
587 <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
588 <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
589 <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
590 </param>
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
591 <param name="peptide_file" value="inputpeptides.csv" ftype="csv"/>
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
592 <param name="calibrant_file" ftype="txt" value="inputcalibrantfile1.txt"/>
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
593 <param name="plusminus_dalton" value="0.25"/>
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 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
595 <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
596 <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
597 <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
598 <param name="distance" value="0.25"/>
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
599 <param name="filenameratioplot" value = "Ratio of mass1 (111) / mass2 (222)"/>
2
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
600 </repeat>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
601 <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
602 </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
603
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
604 <test>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
605 <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
606 <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
607 <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
608 <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
609 </param>
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
610 <param name="peptide_file" value="inputpeptides.txt" ftype="txt"/>
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
611 <param name="calibrant_file" ftype="txt" value="inputcalibrantfile2.txt"/>
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
612 <param name="plusminus_dalton" value="0.5"/>
0
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="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
614 <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
615 </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
616
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
617 <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
618 <param name="infile" value="preprocessing_results1.RData" ftype="rdata"/>
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
619 <param name="plusminus_dalton" value="0.1"/>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
620 <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
621 <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
622 </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
623 <test>
1ccbda92b76b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
galaxyp
parents: 1
diff changeset
624 <param name="infile" value="LM8_file16.rdata" ftype="rdata"/>
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
625 <param name="peptide_file" value="inputpeptides.txt" ftype="txt"/>
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
626 <param name="calibrant_file" ftype="txt" value="inputcalibrantfile2.txt"/>
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
627 <param name="plusminus_dalton" value="0.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
628 <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
629 <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
630 </test>
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
631 </tests>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
632 <help>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
633 <![CDATA[
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
634 Quality control for maldi imaging mass spectrometry data. The output of this tool contains key values and plots of the imaging data as pdf.
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
635 For additional beautiful heatmap images use the MSI ion images tool and to plot more mass spectra use the MSI massspectra tool.
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
636
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
637 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
638
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
639 - 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
640 - 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
641 - 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
642
4
fef8bd551236 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
galaxyp
parents: 3
diff changeset
643
0
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
644
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
645 ]]>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
646 </help>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
647 <citations>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
648 <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
649 </citations>
845073d506a8 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit fa798afa023eea1cb183c14d0242721b2c696c21
galaxyp
parents:
diff changeset
650 </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
651