comparison msi_qualitycontrol.xml @ 10:3eee933c27cf draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
author galaxyp
date Tue, 19 Jun 2018 18:08:15 -0400
parents 963c7ec00141
children 30d0aabb1b46
comparison
equal deleted inserted replaced
9:963c7ec00141 10:3eee933c27cf
1 <tool id="mass_spectrometry_imaging_qc" name="MSI Qualitycontrol" version="1.10.0.1"> 1 <tool id="mass_spectrometry_imaging_qc" name="MSI Qualitycontrol" version="1.10.0.2">
2 <description> 2 <description>
3 mass spectrometry imaging QC 3 mass spectrometry imaging QC
4 </description> 4 </description>
5 <requirements> 5 <requirements>
6 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement> 6 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement>
7 <requirement type="package" version="2.2.1">r-ggplot2</requirement> 7 <requirement type="package" version="2.2.1">r-ggplot2</requirement>
8 <requirement type="package" version="1.1_2">r-rcolorbrewer</requirement> 8 <requirement type="package" version="1.1_2">r-rcolorbrewer</requirement>
9 <requirement type="package" version="2.2.1">r-gridextra</requirement> 9 <requirement type="package" version="2.2.1">r-gridextra</requirement>
10 <requirement type="package" version="2.23_15">r-kernsmooth</requirement> 10 <requirement type="package" version="2.23_15">r-kernsmooth</requirement>
11 <requirement type="package" version="0.5.0">r-scales</requirement>
11 </requirements> 12 </requirements>
12 <command detect_errors="exit_code"> 13 <command detect_errors="exit_code">
13 <![CDATA[ 14 <![CDATA[
14 #if $infile.ext == 'imzml' 15 #if $infile.ext == 'imzml'
15 ln -s '${infile.extra_files_path}/imzml' infile.imzML && 16 ln -s '${infile.extra_files_path}/imzml' infile.imzML &&
33 library(Cardinal) 34 library(Cardinal)
34 library(ggplot2) 35 library(ggplot2)
35 library(RColorBrewer) 36 library(RColorBrewer)
36 library(gridExtra) 37 library(gridExtra)
37 library(KernSmooth) 38 library(KernSmooth)
39 library(scales)
38 40
39 #if $infile.ext == 'imzml' 41 #if $infile.ext == 'imzml'
40 msidata = readImzML('infile') 42 msidata <- readImzML('infile', mass.accuracy=$accuracy, units.accuracy = "$units")
41 #elif $infile.ext == 'analyze75' 43 #elif $infile.ext == 'analyze75'
42 msidata = readAnalyze('infile') 44 msidata = readAnalyze('infile')
43 #else 45 #else
44 load('infile.RData') 46 load('infile.RData')
45 #end if 47 #end if
48
49 ## create full matrix to make processed imzML files compatible with segmentation
50 iData(msidata) <- iData(msidata)[]
46 51
47 ###################################### file properties in numbers ###################### 52 ###################################### file properties in numbers ######################
48 53
49 ## Number of features (m/z) 54 ## Number of features (m/z)
50 maxfeatures = length(features(msidata)) 55 maxfeatures = length(features(msidata))
71 percpeaks = round(npeaks/numpeaks*100, digits=2) 76 percpeaks = round(npeaks/numpeaks*100, digits=2)
72 ## Number of empty TICs 77 ## Number of empty TICs
73 TICs = colSums(spectra(msidata)[]) 78 TICs = colSums(spectra(msidata)[])
74 NumemptyTIC = sum(TICs == 0) 79 NumemptyTIC = sum(TICs == 0)
75 ## Median TIC 80 ## Median TIC
76 medTIC = median(TICs) 81 medTIC = round(median(TICs), digits=2)
77 ## Median peaks per spectrum 82 ## Median peaks per spectrum
78 medpeaks = median(colSums(spectra(msidata)[]>0)) 83 medpeaks = median(colSums(spectra(msidata)[]>0))
79 print(cor(TICs,colSums(spectra(msidata)[]>0), method="pearson")) 84 print(cor(TICs,colSums(spectra(msidata)[]>0), method="pearson"))
80 85
81 ## Processing informations 86 ## Processing informations
107 peakpickinginfo='FALSE' 112 peakpickinginfo='FALSE'
108 } else { 113 } else {
109 peakpickinginfo=processinginfo@peakPicking 114 peakpickinginfo=processinginfo@peakPicking
110 } 115 }
111 116
112
113 ############## Read and filter tabular file with m/z ########################### 117 ############## Read and filter tabular file with m/z ###########################
114 118
115 ### reading peptide file: 119 ### reading peptide file:
116 120
117 #if $peptide_file: 121 #if $peptide_file:
181 185
182 title(main=paste("$filename")) 186 title(main=paste("$filename"))
183 187
184 ################# I) file properties in numbers ################################ 188 ################# I) file properties in numbers ################################
185 ################################################################################ 189 ################################################################################
186 print("properties in numbers") 190 print("properties in numbers")
187 191
188 properties = c("Number of m/z features", 192 properties = c("Number of m/z features",
189 "Range of m/z values [Da]", 193 "Range of m/z values",
190 "Number of pixels", 194 "Number of pixels",
191 "Range of x coordinates", 195 "Range of x coordinates",
192 "Range of y coordinates", 196 "Range of y coordinates",
193 "Range of intensities", 197 "Range of intensities",
194 "Median of intensities", 198 "Median of intensities",
221 paste0(peakpickinginfo), 225 paste0(peakpickinginfo),
222 paste0(centroidedinfo), 226 paste0(centroidedinfo),
223 paste0(number_peptides_valid, " / " , number_peptides_in), 227 paste0(number_peptides_valid, " / " , number_peptides_in),
224 paste0(number_calibrants_valid, " / ", number_calibrants_in)) 228 paste0(number_calibrants_valid, " / ", number_calibrants_in))
225 229
226
227 property_df = data.frame(properties, values) 230 property_df = data.frame(properties, values)
228 231
229 grid.table(property_df, rows= NULL) 232 grid.table(property_df, rows= NULL)
230 233
231 ####################### II) images in x-y grid ############################### 234 ####################### II) images in x-y grid ###############################
232 ############################################################################## 235 ##############################################################################
233 print("x-y images") 236 print("x-y images")
237
234 if (npeaks > 0){ 238 if (npeaks > 0){
235
236 ## function for density plots 239 ## function for density plots
237 plot_colorByDensity = function(x1,x2, 240 plot_colorByDensity = function(x1,x2,
238 ylim=c(min(x2),max(x2)), 241 ylim=c(min(x2),max(x2)),
239 xlim=c(min(x1),max(x1)), 242 xlim=c(min(x1),max(x1)),
240 xlab="",ylab="",main=""){ 243 xlab="",ylab="",main=""){
246 plot(x2~x1, data=df[order(df\$dens),], ylim=ylim,xlim=xlim,pch=20,col=col, 249 plot(x2~x1, data=df[order(df\$dens),], ylim=ylim,xlim=xlim,pch=20,col=col,
247 cex=1,xlab=xlab,ylab=ylab,las=1, main=main)} 250 cex=1,xlab=xlab,ylab=ylab,las=1, main=main)}
248 251
249 abline_vector= -100000 ## will be filled for samples in case data is combined 252 abline_vector= -100000 ## will be filled for samples in case data is combined
250 253
254 ## start list for optional spectrum values output
255 spectrum_list = list()
256 list_count = 1
257
251 ################### 0) overview for combined data ########################### 258 ################### 0) overview for combined data ###########################
252 259
253 ### only for previously combined data, same plot as in combine QC pdf 260 ### only for previously combined data, same plot as in combine QC pdf
261
254 if (!is.null(levels(msidata\$combined_sample))){ 262 if (!is.null(levels(msidata\$combined_sample))){
263 number_combined = length(levels(msidata\$combined_sample))
264
265 ## the more combined_samples a file has the smaller will be the legend
266 if (number_combined<20){
267 legend_size = 10
268 cex_boxplot = 1
269 }else if (number_combined>20 && number_combined<40){
270 legend_size = 9
271 cex_boxplot = 0.8
272 }else if (number_combined>40 && number_combined<60){
273 legend_size = 8
274 cex_boxplot = 0.6
275 }else if (number_combined>60 && number_combined<100){
276 legend_size = 7
277 cex_boxplot = 0.5
278 }else{
279 legend_size = 6
280 cex_boxplot = 0.3
281 }
282
255 position_df = cbind(coord(msidata)[,1:2], msidata\$combined_sample) 283 position_df = cbind(coord(msidata)[,1:2], msidata\$combined_sample)
256 colnames(position_df)[3] = "sample_name" 284 colnames(position_df)[3] = "sample_name"
257 285
258 combine_plot = ggplot(position_df, aes(x=x, y=y, fill=sample_name))+ 286 combine_plot = ggplot(position_df, aes(x=x, y=y, fill=sample_name))+
259 geom_tile() + 287 geom_tile() +
260 coord_fixed()+ 288 coord_fixed()+
261 ggtitle("Spatial orientation of combined data")+ 289 ggtitle("Spatial orientation of combined data")+
262 theme_bw()+ 290 theme_bw()+
263 theme(text=element_text(family="ArialMT", face="bold", size=15))+ 291 theme(plot.title = element_text(hjust = 0.5))+
292 theme(text=element_text(family="ArialMT", face="bold", size=12))+
264 theme(legend.position="bottom",legend.direction="vertical")+ 293 theme(legend.position="bottom",legend.direction="vertical")+
265 guides(fill=guide_legend(ncol=4,byrow=TRUE)) 294 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+
295 guides(fill=guide_legend(ncol=5,byrow=TRUE))
266 coord_labels = aggregate(cbind(x,y)~sample_name, data=position_df, mean) 296 coord_labels = aggregate(cbind(x,y)~sample_name, data=position_df, mean)
267 coord_labels\$file_number = gsub( "_.*$", "", coord_labels\$sample_name) 297 coord_labels\$file_number = gsub( "_.*$", "", coord_labels\$sample_name)
268 for(file_count in 1:nrow(coord_labels)) 298 for(file_count in 1:nrow(coord_labels))
269 {combine_plot = combine_plot + annotate("text",x=coord_labels[file_count,"x"], 299 {combine_plot = combine_plot + annotate("text",x=coord_labels[file_count,"x"],
270 y=coord_labels[file_count,"y"],label=toString(coord_labels[file_count,4]))} 300 y=coord_labels[file_count,"y"],label=toString(coord_labels[file_count,4]))}
301
271 print(combine_plot) 302 print(combine_plot)
272 303
273 ### find max pixelnumber per subsample to later draw ablines 304 ### find max pixelnumber per subsample to later draw ablines
274 pixel_name_df = data.frame(pixels(msidata), msidata\$combined_sample) 305 pixel_name_df = data.frame(pixels(msidata), msidata\$combined_sample)
275 colnames(pixel_name_df) = c("pixel_number", "pixel_name") 306 colnames(pixel_name_df) = c("pixel_number", "pixel_name")
276 last_pixel = aggregate(pixel_number~pixel_name, data = pixel_name_df, max) 307 last_pixel = aggregate(pixel_number~pixel_name, data = pixel_name_df, max)
277 pixel_vector = last_pixel[,2] 308 pixel_vector = last_pixel[,2]
278 abline_vector = pixel_vector[1:length(levels(msidata\$combined_sample))-1] 309 abline_vector = pixel_vector[1:number_combined-1]
279 print(abline_vector) 310 print(abline_vector)
280 } 311 }
281
282 312
283 ################### 1) Pixel order image ################################### 313 ################### 1) Pixel order image ###################################
284 314
285 pixelnumber = 1:pixelcount 315 pixelnumber = 1:pixelcount
286 pixelxyarray=cbind(coord(msidata)[,1:2],pixelnumber) 316 pixelxyarray=cbind(coord(msidata)[,1:2],pixelnumber)
287 317
288 print(ggplot(pixelxyarray, aes(x=x, y=y, fill=pixelnumber)) 318 print(ggplot(pixelxyarray, aes(x=x, y=y, fill=pixelnumber))+
289 + geom_tile() + coord_fixed() 319 geom_tile() + coord_fixed()+
290 + ggtitle("Pixel order") 320 ggtitle("Pixel order") + theme_bw()+
291 +theme_bw() 321 theme(plot.title = element_text(hjust = 0.5))+
292 + scale_fill_gradientn(colours = c("blue", "purple" , "red","orange"), 322 theme(text=element_text(family="ArialMT", face="bold", size=12))+
293 space = "Lab", na.value = "black", name = "Acq")) 323 scale_fill_gradientn(colours = c("blue", "purple" , "red","orange"),
324 space = "Lab", na.value = "black", name = "Pixel number"))
294 325
295 ################ 2) Number of calibrants per spectrum ###################### 326 ################ 2) Number of calibrants per spectrum ######################
296 327
297 pixelmatrix = matrix(ncol=ncol(msidata), nrow=0) 328 pixelmatrix = matrix(ncol=ncol(msidata), nrow=0)
298 inputcalibrantmasses = inputcalibrants[,1] 329 inputcalibrantmasses = inputcalibrants[,1]
319 350
320 countvector= as.factor(colSums(pixelmatrix>0)) 351 countvector= as.factor(colSums(pixelmatrix>0))
321 countdf= cbind(coord(msidata)[,1:2], countvector) 352 countdf= cbind(coord(msidata)[,1:2], countvector)
322 mycolours = c("black","grey", "darkblue", "blue", "green" , "red", "yellow", "magenta", "olivedrab1", "lightseagreen") 353 mycolours = c("black","grey", "darkblue", "blue", "green" , "red", "yellow", "magenta", "olivedrab1", "lightseagreen")
323 354
324 print(ggplot(countdf, aes(x=x, y=y, fill=countvector)) 355 print(ggplot(countdf, aes(x=x, y=y, fill=countvector))+
325 + geom_tile() + coord_fixed() 356 geom_tile() + coord_fixed() +
326 + ggtitle("Number of calibrants per pixel") 357 ggtitle("Number of calibrants per pixel") +
327 + theme_bw() 358 theme_bw() +
328 + theme(text=element_text(family="ArialMT", face="bold", size=12)) 359 theme(plot.title = element_text(hjust = 0.5))+
329 + scale_fill_manual(values = mycolours[1:length(countvector)], 360 theme(text=element_text(family="ArialMT", face="bold", size=12))+
361 scale_fill_manual(values = mycolours[1:length(countvector)],
330 na.value = "black", name = "# calibrants")) 362 na.value = "black", name = "# calibrants"))
363
364 ## append list for optional spectrum values output
365 colnames(countdf)[3] = "Number of Calibrants"
366 spectrum_list[[list_count]] = countdf
367 list_count = list_count+1
368
331 }else{print("2) The inputcalibrant m/z were not provided or outside the m/z range")} 369 }else{print("2) The inputcalibrant m/z were not provided or outside the m/z range")}
332 370
333 ########################## 3) fold change image ########################### 371 ########################## 3) fold change image ###########################
334 372
335 #if $calibrantratio: 373 #if $calibrantratio:
384 mass1vector = spectra(msidata)[features(msidata, mz = maxmass1),] 422 mass1vector = spectra(msidata)[features(msidata, mz = maxmass1),]
385 mass2vector = spectra(msidata)[features(msidata, mz = maxmass2),] 423 mass2vector = spectra(msidata)[features(msidata, mz = maxmass2),]
386 foldchange= log2(mass1vector/mass2vector) 424 foldchange= log2(mass1vector/mass2vector)
387 fcmatrix = cbind(foldchange, coord(msidata)[,1:2]) 425 fcmatrix = cbind(foldchange, coord(msidata)[,1:2])
388 426
389 print(ggplot(fcmatrix, aes(x=x, y=y, fill=foldchange), colour=colo) 427 print(ggplot(fcmatrix, aes(x=x, y=y, fill=foldchange), colour=colo)+
390 + geom_tile() + coord_fixed() 428 geom_tile() + coord_fixed()+
391 + ggtitle("$label") 429 ggtitle("$label")+
392 + theme_bw() 430 theme_bw()+
393 + theme(text=element_text(family="ArialMT", face="bold", size=12)) 431 theme(plot.title = element_text(hjust = 0.5))+
394 + scale_fill_gradientn(colours = c("blue", "purple" , "red","orange") 432 theme(text=element_text(family="ArialMT", face="bold", size=12))+
433 scale_fill_gradientn(colours = c("blue", "purple" , "red","orange")
395 ,space = "Lab", na.value = "black", name ="FC")) 434 ,space = "Lab", na.value = "black", name ="FC"))
396 }else{ 435 }else{
397 plot(0,type='n',axes=FALSE,ann=FALSE) 436 plot(0,type='n',axes=FALSE,ann=FALSE)
398 title(main=paste("At least one m/z range did not contain any intensity value > 0,\n therefore no foldchange plot could be drawn"))} 437 title(main=paste("At least one m/z range did not contain any intensity value > 0,\n therefore no foldchange plot could be drawn"))}
399 438
405 par(mfrow=c(1,1), mar=c(5.1, 4.1, 4.1, 2.1), mgp=c(3, 1, 0), las=0) 444 par(mfrow=c(1,1), mar=c(5.1, 4.1, 4.1, 2.1), mgp=c(3, 1, 0), las=0)
406 if (length(inputmasses) != 0){ 445 if (length(inputmasses) != 0){
407 for (mass in 1:length(inputmasses)){ 446 for (mass in 1:length(inputmasses)){
408 image(msidata, mz=inputmasses[mass], plusminus=$plusminus_dalton, 447 image(msidata, mz=inputmasses[mass], plusminus=$plusminus_dalton,
409 main= paste0(inputnames[mass], " (", round(inputmasses[mass], digits = 2)," ± ", $plusminus_dalton, " Da)"), 448 main= paste0(inputnames[mass], " (", round(inputmasses[mass], digits = 2)," ± ", $plusminus_dalton, " Da)"),
410 contrast.enhance = "histogram") 449 contrast.enhance = "histogram", ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy))
411 } 450 }
412 } else {print("4) The input peptide and calibrant m/z were not provided or outside the m/z range")} 451 } else {print("4) The input peptide and calibrant m/z were not provided or outside the m/z range")}
413 452
414 #################### 5) Number of peaks per pixel - image ################## 453 #################### 5) Number of peaks per pixel - image ##################
415 454
416 ## here every intensity value > 0 counts as pixel 455 ## here every intensity value > 0 counts as pixel
417 peaksperpixel = colSums(spectra(msidata)[]> 0) 456 peaksperpixel = colSums(spectra(msidata)[]> 0)
418 peakscoordarray=cbind(coord(msidata)[,1:2], peaksperpixel) 457 peakscoordarray=cbind(coord(msidata)[,1:2], peaksperpixel)
419 458
420 print(ggplot(peakscoordarray, aes(x=x, y=y, fill=peaksperpixel), colour=colo) 459 print(ggplot(peakscoordarray, aes(x=x, y=y, fill=peaksperpixel), colour=colo)+
421 + geom_tile() + coord_fixed() 460 geom_tile() + coord_fixed() +
422 + ggtitle("Number of peaks per spectrum") 461 ggtitle("Number of peaks per spectrum")+
423 + theme_bw() 462 theme_bw() +
424 + theme(text=element_text(family="ArialMT", face="bold", size=12)) 463 theme(plot.title = element_text(hjust = 0.5))+
425 + scale_fill_gradientn(colours = c("blue", "purple" , "red","orange") 464 theme(text=element_text(family="ArialMT", face="bold", size=12))+
465 scale_fill_gradientn(colours = c("blue", "purple" , "red","orange")
426 ,space = "Lab", na.value = "black", name = "# peaks")) 466 ,space = "Lab", na.value = "black", name = "# peaks"))
467
468 ## append list for optional spectrum values output
469 colnames(peakscoordarray)[3] = "Number of Peaks"
470 spectrum_list[[list_count]] = peakscoordarray
471 list_count = list_count+1
427 472
428 ############################### 6) TIC image ############################### 473 ############################### 6) TIC image ###############################
429 474
430 TICcoordarray=cbind(coord(msidata)[,1:2], TICs) 475 TICcoordarray=cbind(coord(msidata)[,1:2], TICs)
431 colo = colorRampPalette( 476 colo = colorRampPalette(
432 c("blue", "cyan", "green", "yellow","red")) 477 c("blue", "cyan", "green", "yellow","red"))
433 print(ggplot(TICcoordarray, aes(x=x, y=y, fill=TICs), colour=colo) 478 print(ggplot(TICcoordarray, aes(x=x, y=y, fill=TICs), colour=colo)+
434 + geom_tile() + coord_fixed() 479 geom_tile() + coord_fixed() +
435 + ggtitle("Total Ion Chromatogram") 480 ggtitle("Total Ion Chromatogram")+
436 + theme_bw() 481 theme_bw() +
437 + theme(text=element_text(family="ArialMT", face="bold", size=12)) 482 theme(plot.title = element_text(hjust = 0.5))+
438 + scale_fill_gradientn(colours = c("blue", "purple" , "red","orange") 483 theme(text=element_text(family="ArialMT", face="bold", size=12))+
484 scale_fill_gradientn(colours = c("blue", "purple" , "red","orange")
439 ,space = "Lab", na.value = "black", name = "TIC")) 485 ,space = "Lab", na.value = "black", name = "TIC"))
486
487 ## append list for optional spectrum values output
488 colnames(TICcoordarray)[3] = "TIC per spectrum"
489 spectrum_list[[list_count]] = TICcoordarray
490 list_count = list_count+1
440 491
441 ############################### 7) Most abundant m/z image ################# 492 ############################### 7) Most abundant m/z image #################
442 493
443 highestmz = apply(spectra(msidata)[],2,which.max) 494 highestmz = apply(spectra(msidata)[],2,which.max)
444 highestmz_matrix = cbind(coord(msidata)[,1:2],mz(msidata)[highestmz]) 495 highestmz_matrix = cbind(coord(msidata)[,1:2],mz(msidata)[highestmz])
445 colnames(highestmz_matrix)[3] = "highestmzinDa" 496 colnames(highestmz_matrix)[3] = "highestmzinDa"
446 497
447 print(ggplot(highestmz_matrix, aes(x=x, y=y, fill=highestmzinDa)) 498 print(ggplot(highestmz_matrix, aes(x=x, y=y, fill=highestmzinDa))+
448 + geom_tile() + coord_fixed() 499 geom_tile() + coord_fixed() +
449 + ggtitle("Most abundant m/z in each spectrum") 500 ggtitle("Most abundant m/z in each spectrum")+
450 + theme_bw() 501 theme_bw() +
451 + scale_fill_gradientn(colours = c("blue", "purple" , "red","orange"), space = "Lab", na.value = "black", name = "m/z", 502 theme(plot.title = element_text(hjust = 0.5))+
503 scale_fill_gradientn(colours = c("blue", "purple" , "red","orange"), space = "Lab", na.value = "black", name = "m/z",
452 labels = as.character(pretty(highestmz_matrix\$highestmzinDa)[c(1,3,5,7)]), 504 labels = as.character(pretty(highestmz_matrix\$highestmzinDa)[c(1,3,5,7)]),
453 breaks = pretty(highestmz_matrix\$highestmzinDa)[c(1,3,5,7)], limits=c(min(highestmz_matrix\$highestmzinDa), max(highestmz_matrix\$highestmzinDa))) 505 breaks = pretty(highestmz_matrix\$highestmzinDa)[c(1,3,5,7)], limits=c(min(highestmz_matrix\$highestmzinDa), max(highestmz_matrix\$highestmzinDa)))+
454 + theme(text=element_text(family="ArialMT", face="bold", size=12))) 506 theme(text=element_text(family="ArialMT", face="bold", size=12)))
455 507
456 ## which m/z are highest 508 ## which m/z are highest
457 highestmz_peptides = names(sort(table(round(highestmz_matrix\$highestmzinDa, digits=0)), decreasing=TRUE)[1]) 509 highestmz_peptides = names(sort(table(round(highestmz_matrix\$highestmzinDa, digits=0)), decreasing=TRUE)[1])
458 highestmz_pixel = which(round(highestmz_matrix\$highestmzinDa, digits=0) == highestmz_peptides)[1] 510 highestmz_pixel = which(round(highestmz_matrix\$highestmzinDa, digits=0) == highestmz_peptides)[1]
459 511
460 secondhighestmz = names(sort(table(round(highestmz_matrix\$highestmzinDa, digits=0)), decreasing=TRUE)[2]) 512 secondhighestmz = names(sort(table(round(highestmz_matrix\$highestmzinDa, digits=0)), decreasing=TRUE)[2])
461 secondhighestmz_pixel = which(round(highestmz_matrix\$highestmzinDa, digits=0) == secondhighestmz)[1] 513 secondhighestmz_pixel = which(round(highestmz_matrix\$highestmzinDa, digits=0) == secondhighestmz)[1]
462 514
463 print(head(sort(table(round(highestmz_matrix\$highestmzinDa, digits=0)), decreasing=TRUE))) 515 print(head(sort(table(round(highestmz_matrix\$highestmzinDa, digits=0)), decreasing=TRUE)))
464 516
517 ## append list for optional spectrum values output
518 colnames(highestmz_matrix)[3] = "Most abundant m/z"
519 spectrum_list[[list_count]] = highestmz_matrix
520
465 ########################## 8) pca image for two components ################# 521 ########################## 8) pca image for two components #################
466 522
467 pca = PCA(msidata, ncomp=2) 523 pca = PCA(msidata, ncomp=2)
468 par(mfrow = c(2,1)) 524 par(mfrow = c(2,1))
469 plot(pca, col=c("black", "darkgrey"), main="PCA for two components") 525 plot(pca, col=c("black", "darkgrey"), main="PCA for two components")
470 image(pca, col=c("black", "white"), strip=FALSE) 526 image(pca, col=c("black", "white"), strip=FALSE, ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy))
471 527
472 ################## III) properties over spectra index ########## 528 ################## III) properties over spectra index ##########
473 ############################################################################## 529 ##############################################################################
474 print("properties over pixels") 530 print("properties over pixels")
475 par(mfrow = c(2,1), mar=c(5,6,4,2)) 531 par(mfrow = c(2,1), mar=c(5,6,4,2))
496 colnames(df_9) = c("Npeaks", "sample_name") 552 colnames(df_9) = c("Npeaks", "sample_name")
497 553
498 hist_9 = ggplot(df_9, aes(x=Npeaks, fill=sample_name)) + 554 hist_9 = ggplot(df_9, aes(x=Npeaks, fill=sample_name)) +
499 geom_histogram()+ theme_bw()+ 555 geom_histogram()+ theme_bw()+
500 theme(text=element_text(family="ArialMT", face="bold", size=12))+ 556 theme(text=element_text(family="ArialMT", face="bold", size=12))+
557 theme(plot.title = element_text(hjust = 0.5))+
558 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+
559 theme(legend.position="bottom",legend.direction="vertical")+
501 labs(title="Number of peaks per spectrum and sample", x="Number of peaks per spectrum", y = "Frequency = # spectra") + 560 labs(title="Number of peaks per spectrum and sample", x="Number of peaks per spectrum", y = "Frequency = # spectra") +
561 guides(fill=guide_legend(ncol=5,byrow=TRUE))+
502 geom_vline(xintercept = median(peaksperpixel), size = 1, colour = "black",linetype = "dashed") 562 geom_vline(xintercept = median(peaksperpixel), size = 1, colour = "black",linetype = "dashed")
503 print(hist_9)} 563 print(hist_9)}
504 564
505 ########################## 10) TIC per spectrum ########################### 565 ########################## 10) TIC per spectrum ###########################
506 566
524 colnames(df_10) = c("TICs", "sample_name") 584 colnames(df_10) = c("TICs", "sample_name")
525 585
526 hist_10 = ggplot(df_10, aes(x=TICs, fill=sample_name)) + 586 hist_10 = ggplot(df_10, aes(x=TICs, fill=sample_name)) +
527 geom_histogram()+ theme_bw()+ 587 geom_histogram()+ theme_bw()+
528 theme(text=element_text(family="ArialMT", face="bold", size=12))+ 588 theme(text=element_text(family="ArialMT", face="bold", size=12))+
589 theme(plot.title = element_text(hjust = 0.5))+
590 theme(legend.position="bottom",legend.direction="vertical")+
591 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+
529 labs(title="TIC per spectrum and sample", x="log(TIC per spectrum)", y = "Frequency = # spectra") + 592 labs(title="TIC per spectrum and sample", x="log(TIC per spectrum)", y = "Frequency = # spectra") +
593 guides(fill=guide_legend(ncol=5,byrow=TRUE))+
530 geom_vline(xintercept = median(log(TICs[TICs>0])), size = 1, colour = "black",linetype = "dashed") 594 geom_vline(xintercept = median(log(TICs[TICs>0])), size = 1, colour = "black",linetype = "dashed")
531 print(hist_10)} 595 print(hist_10)}
532 596
533 ################################## IV) changes over m/z #################### 597 ################################## IV) changes over m/z ####################
534 ############################################################################ 598 ############################################################################
604 668
605 hist_13 = ggplot(df_13, aes(x=logint, fill=sample_name)) + 669 hist_13 = ggplot(df_13, aes(x=logint, fill=sample_name)) +
606 geom_histogram()+ theme_bw()+ 670 geom_histogram()+ theme_bw()+
607 theme(text=element_text(family="ArialMT", face="bold", size=12))+ 671 theme(text=element_text(family="ArialMT", face="bold", size=12))+
608 labs(title="Log2-transformed intensities per sample", x="log2 intensities", y = "Frequency") + 672 labs(title="Log2-transformed intensities per sample", x="log2 intensities", y = "Frequency") +
673 theme(plot.title = element_text(hjust = 0.5))+
674 theme(legend.position="bottom",legend.direction="vertical")+
675 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+
676 guides(fill=guide_legend(ncol=5,byrow=TRUE))+
609 geom_vline(xintercept = median(log2(spectra(msidata)[(spectra(msidata)>0)])), size = 1, colour = "black",linetype = "dashed") 677 geom_vline(xintercept = median(log2(spectra(msidata)[(spectra(msidata)>0)])), size = 1, colour = "black",linetype = "dashed")
610 print(hist_13) 678 print(hist_13)
611 679
612 ## 13d) boxplots to visualize in a different way the intensity distributions 680 ## 13d) boxplots to visualize in a different way the intensity distributions
613 par(mfrow = c(1,1), cex.axis=1.3, cex.lab=1.3, mar=c(13.1,4.1,5.1,2.1)) 681 par(mfrow = c(1,1), cex.axis=1.3, cex.lab=1.3, mar=c(13.1,4.1,5.1,2.1))
614 682
615 mean_matrix = matrix(,ncol=0, nrow = nrow(msidata)) 683 mean_matrix = matrix(,ncol=0, nrow = nrow(msidata))
616 for (subsample in levels(msidata\$combined_sample)){ 684 for (subsample in levels(msidata\$combined_sample)){
617 mean_mz_sample = colMeans(spectra(msidata)[,msidata\$combined_sample==subsample]) 685 mean_mz_sample = rowMeans(spectra(msidata)[,msidata\$combined_sample==subsample])
618 mean_matrix = cbind(mean_matrix, mean_mz_sample)} 686 mean_matrix = cbind(mean_matrix, mean_mz_sample)}
619 boxplot(mean_matrix, ylab = "mean intensity per m/z", names=levels(msidata\$combined_sample), main="Mean intensities per m/z and sample", las=2) 687
688 boxplot(log2(mean_matrix), ylab = "log2 mean intensity per m/z", main="Mean intensities per m/z and sample", xaxt = "n")
689 (axis(1, at = c(1:number_combined), labels=levels(msidata\$combined_sample), cex.axis=cex_boxplot, las=2))
620 } 690 }
621 691
622 ########################## 14) Histogram on m/z values ##################### 692 ########################## 14) Histogram on m/z values #####################
623 693
624 par(mfrow = c(1, 1), cex.axis=1, cex.lab=1, mar=c(5.1,4.1,4.1,2.1)) 694 par(mfrow = c(1, 1), cex.axis=1, cex.lab=1, mar=c(5.1,4.1,4.1,2.1))
669 ppmdifference2 = mzdifference2/inputcalibrantmasses[mass]*1000000 739 ppmdifference2 = mzdifference2/inputcalibrantmasses[mass]*1000000
670 differencevector2[mass] = round(ppmdifference2, digits=2) 740 differencevector2[mass] = round(ppmdifference2, digits=2)
671 741
672 par(mfrow = c(2, 2), oma=c(0,0,2,0)) 742 par(mfrow = c(2, 2), oma=c(0,0,2,0))
673 plot(msidata[minmasspixel:maxmasspixel,], pixel = 1:length(pixelnumber), main= "average spectrum") 743 plot(msidata[minmasspixel:maxmasspixel,], pixel = 1:length(pixelnumber), main= "average spectrum")
674 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="blue", lty=c(3,6,3)) 744 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="blue", lty=c(3,1,3))
675 abline(v=c(maxvalue), col="red", lty=5) 745 abline(v=c(maxvalue), col="red", lty=2)
676 abline(v=c(mzvalue), col="green2", lty=5) 746 abline(v=c(mzvalue), col="green2", lty=4)
677 plot(msidata[minmasspixel:maxmasspixel,], pixel = pixels_for_plot[1], main=paste0("Spectrum at ", rownames(coord(msidata)[pixels_for_plot[1],1:2]))) 747 plot(msidata[minmasspixel:maxmasspixel,], pixel = pixels_for_plot[1], main=paste0("Spectrum at ", rownames(coord(msidata)[pixels_for_plot[1],1:2])))
678 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="blue", lty=c(3,6,3)) 748 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="blue", lty=c(3,1,3))
679 abline(v=c(maxvalue), col="red", lty=5) 749 abline(v=c(maxvalue), col="red", lty=2)
680 abline(v=c(mzvalue), col="green2", lty=5) 750 abline(v=c(mzvalue), col="green2", lty=4)
681 plot(msidata[minmasspixel:maxmasspixel,], pixel = pixels_for_plot[2], main= paste0("Spectrum at ", rownames(coord(msidata)[pixels_for_plot[2],1:2]))) 751 plot(msidata[minmasspixel:maxmasspixel,], pixel = pixels_for_plot[2], main= paste0("Spectrum at ", rownames(coord(msidata)[pixels_for_plot[2],1:2])))
682 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="blue", lty=c(3,6,3)) 752 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="blue", lty=c(3,1,3))
683 abline(v=c(maxvalue), col="red", lty=5) 753 abline(v=c(maxvalue), col="red", lty=2)
684 abline(v=c(mzvalue), col="green2", lty=5) 754 abline(v=c(mzvalue), col="green2", lty=4)
685 plot(msidata[minmasspixel:maxmasspixel,], pixel = pixels_for_plot[3], main= paste0("Spectrum at ", rownames(coord(msidata)[pixels_for_plot[3],1:2]))) 755 plot(msidata[minmasspixel:maxmasspixel,], pixel = pixels_for_plot[3], main= paste0("Spectrum at ", rownames(coord(msidata)[pixels_for_plot[3],1:2])))
686 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="blue", lty=c(3,6,3)) 756 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="blue", lty=c(3,1,3))
687 abline(v=c(maxvalue), col="red", lty=5) 757 abline(v=c(maxvalue), col="red", lty=2)
688 abline(v=c(mzvalue), col="green2", lty=5) 758 abline(v=c(mzvalue), col="green2", lty=4)
689 title(paste0("theor. m/z: ", inputcalibrants[count,1]), col.main="blue", outer=TRUE, line=0, adj=0.074) 759 title(paste0("theor. m/z: ", inputcalibrants[count,1]), col.main="blue", outer=TRUE, line=0, adj=0.074)
690 title(paste0("most abundant m/z: ", round(maxvalue, digits=4)), col.main="red", outer=TRUE, line=0, adj=0.49) 760 title(paste0("most abundant m/z: ", round(maxvalue, digits=4)), col.main="red", outer=TRUE, line=0, adj=0.49)
691 title(paste0("closest m/z: ", round(mzvalue, digits=4)), col.main="green2", outer=TRUE, line=0, adj=0.93) 761 title(paste0("closest m/z: ", round(mzvalue, digits=4)), col.main="green2", outer=TRUE, line=0, adj=0.93)
762
763 ### 16b) one large extra plot with different colours for different samples (for combined_sample only)
764
765 if (!is.null(levels(msidata\$combined_sample))){
766 if (number_combined < 10){
767 key_zoomed = TRUE
768 }else{key_zoomed = FALSE}
769 par(mfrow = c(1, 1))
770 plot(msidata[minmasspixel:maxmasspixel,], pixel=1:ncol(msidata),main="average spectrum per sample",
771 pixel.groups=msidata\$combined_sample, key=key_zoomed, col=hue_pal()(number_combined),superpose=TRUE)
772 abline(v=c(inputcalibrantmasses[mass] -plusminusvalues[count], inputcalibrantmasses[mass] ,inputcalibrantmasses[mass] +plusminusvalues[count]), col="black", lty=c(3,1,3))
692 count=count+1 773 count=count+1
774 }
693 } 775 }
694 776
695 ######### 17) ppm difference input calibrant m/z and m/z with max intensity in given m/z range######### 777 ######### 17) ppm difference input calibrant m/z and m/z with max intensity in given m/z range#########
696 778
697 par(mfrow = c(1, 1)) 779 par(mfrow = c(1, 1))
704 if (sum(is.na(diff_df[,1])) == nrow(diff_df)){ 786 if (sum(is.na(diff_df[,1])) == nrow(diff_df)){
705 print("plot 17: no peaks in the chosen region, repeat with higher ppm range") 787 print("plot 17: no peaks in the chosen region, repeat with higher ppm range")
706 }else{ 788 }else{
707 789
708 diff_plot=ggplot(data=diff_df, aes(x=calibrant_names, y=differencevector)) + geom_bar(stat="identity", fill = "darkgray") + theme_minimal() + 790 diff_plot=ggplot(data=diff_df, aes(x=calibrant_names, y=differencevector)) + geom_bar(stat="identity", fill = "darkgray") + theme_minimal() +
709 labs(title="Difference m/z with max. average intensity vs. theoretical calibrant m/z", x="calibrants", y = "Difference in ppm")+ 791 labs(title="Difference m/z with max. average intensity vs. theor. calibrant m/z", x="calibrants", y = "Difference in ppm")+
792 theme(plot.title = element_text(hjust = 0.5))+theme(text=element_text(family="ArialMT", face="bold", size=12))+
710 geom_text(aes(label=differencevector), vjust=-0.3, size=3.5, col="blue") 793 geom_text(aes(label=differencevector), vjust=-0.3, size=3.5, col="blue")
711 794
712 print(diff_plot)} 795 print(diff_plot)}
713 796
714 ######### 18) ppm difference input calibrant m/z and closest m/z ########### 797 ######### 18) ppm difference input calibrant m/z and closest m/z ###########
718 differencevector2 = round(differencevector2, digits=2) 801 differencevector2 = round(differencevector2, digits=2)
719 calibrant_names = as.character(inputcalibrants[,2]) 802 calibrant_names = as.character(inputcalibrants[,2])
720 diff_df = data.frame(differencevector2, calibrant_names) 803 diff_df = data.frame(differencevector2, calibrant_names)
721 804
722 diff_plot=ggplot(data=diff_df, aes(x=calibrant_names, y=differencevector2)) + geom_bar(stat="identity", fill = "darkgray") + theme_minimal() + 805 diff_plot=ggplot(data=diff_df, aes(x=calibrant_names, y=differencevector2)) + geom_bar(stat="identity", fill = "darkgray") + theme_minimal() +
723 labs(title="Difference closest measured m/z vs. theoretical calibrant m/z", x="calibrants", y = "Difference in ppm")+ 806 labs(title="Difference closest measured m/z vs. theor. calibrant m/z", x="calibrants", y = "Difference in ppm")+
807 theme(plot.title = element_text(hjust = 0.5))+theme(text=element_text(family="ArialMT", face="bold", size=12))+
724 geom_text(aes(label=differencevector2), vjust=-0.3, size=3.5, col="blue") 808 geom_text(aes(label=differencevector2), vjust=-0.3, size=3.5, col="blue")
725 809
726 print(diff_plot) 810 print(diff_plot)
727 811
728 #################### 19) ppm difference over pixels ##################### 812 #################### 19) ppm difference over pixels #####################
757 }else{ 841 }else{
758 842
759 ### plot ppm differences over pixels (spectra index) 843 ### plot ppm differences over pixels (spectra index)
760 844
761 par(mar=c(4.1, 4.1, 4.1, 7.5)) 845 par(mar=c(4.1, 4.1, 4.1, 7.5))
762 plot(0,0,type="n", ylim=c(min(ppm_df, na.rm=TRUE),max(ppm_df, na.rm=TRUE)), xlim = c(1,ncol(filtered_data)),xlab = "Spectra index", ylab = "m/z difference in ppm", main="Difference m/z with max. average intensity vs. theoretical m/z\n(per spectrum)") 846 plot(0,0,type="n", ylim=c(min(ppm_df, na.rm=TRUE),max(ppm_df, na.rm=TRUE)), xlim = c(1,ncol(filtered_data)),xlab = "Spectra index", ylab = "m/z difference in ppm", main="Difference m/z with max. average intensity vs. theor. m/z\n(per spectrum)")
763 847
764 for (each_cal in 1:ncol(ppm_df)){ 848 for (each_cal in 1:ncol(ppm_df)){
765 lines(ppm_df[,each_cal], col=mycolours[each_cal], type="p")} 849 lines(ppm_df[,each_cal], col=mycolours[each_cal], type="p")}
766 legend("topright", inset=c(-0.25,0), xpd = TRUE, bty="n", legend=inputcalibrantmasses, col=mycolours[1:ncol(ppm_df)],lty=1) 850 legend("topright", inset=c(-0.25,0), xpd = TRUE, bty="n", legend=inputcalibrantmasses, col=mycolours[1:ncol(ppm_df)],lty=1)
767 abline(v=abline_vector, lty = 3)} 851 abline(v=abline_vector, lty = 3)}
769 }else{print("16+17+18+19) The inputcalibrant m/z were not provided or outside the m/z range")} 853 }else{print("16+17+18+19) The inputcalibrant m/z were not provided or outside the m/z range")}
770 854
771 dev.off() 855 dev.off()
772 856
773 }else{ 857 }else{
774 print("inputfile has no intensities > 0") 858 print("inputfile has no intensities > 0")
775 dev.off() 859 dev.off()
776 } 860 }
861
862 ## tabular output of spectra values
863
864 #if $pixel_output:
865 print("pixel list")
866 pixel_df = Reduce(function(...) merge(..., by=c("x", "y"), all=T), spectrum_list)
867 write.table(pixel_df, file="$pixel_tabular_output", quote = FALSE, row.names = TRUE, col.names=NA, sep = "\t")
868 #end if
869
870
777 871
778 ]]></configfile> 872 ]]></configfile>
779 </configfiles> 873 </configfiles>
780 <inputs> 874 <inputs>
781 <param name="infile" type="data" format="imzml,rdata,analyze75" label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData" 875 <param name="infile" type="data" format="imzml,rdata,analyze75" label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData"
782 help="Upload composite datatype imzml (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/> 876 help="Upload composite datatype imzml (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/>
877 <param name="accuracy" type="float" value="50" label="Only for processed imzML files: enter mass accuracy to which the m/z values will be binned" help="This should be set to the native accuracy of the mass spectrometer, if known"/>
878 <param name="units" display="radio" type="select" label="Only for processed imzML files: unit of the mass accuracy" help="either m/z or ppm">
879 <option value="mz" >mz</option>
880 <option value="ppm" selected="True" >ppm</option>
881 </param>
783 <param name="filename" type="text" value="" optional="true" label="Title" help="will appear as header in the quality report, if nothing given input dataset name is used"/> 882 <param name="filename" type="text" value="" optional="true" label="Title" help="will appear as header in the quality report, if nothing given input dataset name is used"/>
784 <param name="calibrant_file" type="data" optional="true" format="tabular" 883 <param name="calibrant_file" type="data" optional="true" format="tabular"
785 label="File with internal calibrants" help="first column: m/z, second column: name (optional), tabular file"/> 884 label="File with internal calibrants" help="first column: m/z, second column: name (optional), tabular file"/>
786 <param name="peptide_file" type="data" optional="true" format="tabular" label="File with m/z of interest" 885 <param name="peptide_file" type="data" optional="true" format="tabular" label="File with m/z of interest"
787 help="first column: m/z, second column: name (optional), tabular file"/> 886 help="first column: m/z, second column: name (optional), tabular file"/>
791 <param name="mass1" value="1111" type="float" label="M/z 1" help="First m/z"/> 890 <param name="mass1" value="1111" type="float" label="M/z 1" help="First m/z"/>
792 <param name="mass2" value="2222" type="float" label="M/z 2" help="Second m/z"/> 891 <param name="mass2" value="2222" type="float" label="M/z 2" help="Second m/z"/>
793 <param name="distance" value="0.25" type="float" label="M/z range" help="Plusminus m/z window added to input m/z. In both m/z ranges the maximum intensity is used to calculate the fold change"/> 892 <param name="distance" value="0.25" type="float" label="M/z range" help="Plusminus m/z window added to input m/z. In both m/z ranges the maximum intensity is used to calculate the fold change"/>
794 <param name="filenameratioplot" type="text" optional="true" label="Title" help="Optional title for fold change plot."/> 893 <param name="filenameratioplot" type="text" optional="true" label="Title" help="Optional title for fold change plot."/>
795 </repeat> 894 </repeat>
895 <param name="pixel_output" type="boolean" display="radio" label="Tabular with spectra information" help="Values for each spectrum (pixel) in x-y grid images"/>
796 </inputs> 896 </inputs>
797 <outputs> 897 <outputs>
798 <data format="pdf" name="plots" from_work_dir="qualitycontrol.pdf" label = "$infile.display_name QC_report"/> 898 <data format="pdf" name="plots" from_work_dir="qualitycontrol.pdf" label = "$infile.display_name QC_report"/>
899 <data format="tabular" name="pixel_tabular_output" label="$infile.display_name spectra information">
900 <filter>pixel_output</filter>
901 </data>
799 </outputs> 902 </outputs>
800 <tests> 903 <tests>
801 <test> 904 <test expect_num_outputs="2">
802 <param name="infile" value="" ftype="imzml"> 905 <param name="infile" value="" ftype="imzml">
803 <composite_data value="Example_Continuous.imzML" /> 906 <composite_data value="Example_Processed.imzML"/>
804 <composite_data value="Example_Continuous.ibd" /> 907 <composite_data value="Example_Processed.ibd"/>
805 </param> 908 </param>
909 <param name="accuracy" value="200"/>
910 <param name="units" value="ppm"/>
806 <param name="peptide_file" value="inputpeptides.txt"/> 911 <param name="peptide_file" value="inputpeptides.txt"/>
807 <param name="calibrant_file" value="inputcalibrantfile1.txt"/> 912 <param name="calibrant_file" value="inputcalibrantfile1.txt"/>
808 <param name="plusminus_dalton" value="0.25"/> 913 <param name="plusminus_dalton" value="0.25"/>
809 <param name="plusminus_ppm" value="100"/> 914 <param name="plusminus_ppm" value="100"/>
810 <param name="filename" value="Testfile_imzml"/> 915 <param name="filename" value="Testfile_imzml"/>
812 <param name="mass1" value="328.9"/> 917 <param name="mass1" value="328.9"/>
813 <param name="mass2" value="398.8"/> 918 <param name="mass2" value="398.8"/>
814 <param name="distance" value="0.25"/> 919 <param name="distance" value="0.25"/>
815 <param name="filenameratioplot" value = "Ratio of mass1 (328.9) / mass2 (398.8)"/> 920 <param name="filenameratioplot" value = "Ratio of mass1 (328.9) / mass2 (398.8)"/>
816 </repeat> 921 </repeat>
922 <param name="pixel_output" value="True"/>
923 <output name="pixel_tabular_output" file="spectra_info_imzml.txt"/>
817 <output name="plots" file="QC_imzml.pdf" compare="sim_size" delta="20000"/> 924 <output name="plots" file="QC_imzml.pdf" compare="sim_size" delta="20000"/>
818 </test> 925 </test>
819 <test> 926 <test expect_num_outputs="1">
820 <param name="infile" value="" ftype="analyze75"> 927 <param name="infile" value="" ftype="analyze75">
821 <composite_data value="Analyze75.hdr"/> 928 <composite_data value="Analyze75.hdr"/>
822 <composite_data value="Analyze75.img"/> 929 <composite_data value="Analyze75.img"/>
823 <composite_data value="Analyze75.t2m"/> 930 <composite_data value="Analyze75.t2m"/>
824 </param> 931 </param>
826 <param name="calibrant_file" value="inputcalibrantfile2.txt"/> 933 <param name="calibrant_file" value="inputcalibrantfile2.txt"/>
827 <param name="plusminus_dalton" value="0.5"/> 934 <param name="plusminus_dalton" value="0.5"/>
828 <param name="filename" value="Testfile_analyze75"/> 935 <param name="filename" value="Testfile_analyze75"/>
829 <output name="plots" file="QC_analyze75.pdf" compare="sim_size" delta="20000"/> 936 <output name="plots" file="QC_analyze75.pdf" compare="sim_size" delta="20000"/>
830 </test> 937 </test>
831 <test> 938 <test expect_num_outputs="2">
832 <param name="infile" value="123_combined.RData" ftype="rdata"/> 939 <param name="infile" value="123_combined.RData" ftype="rdata"/>
833 <param name="plusminus_dalton" value="0.2"/> 940 <param name="plusminus_dalton" value="0.2"/>
834 <param name="filename" value="Testfile_rdata"/> 941 <param name="filename" value="Testfile_rdata"/>
942 <param name="pixel_output" value="True"/>
943 <output name="pixel_tabular_output" file="spectra_info_123_combi.txt"/>
835 <output name="plots" file="QC_rdata.pdf" compare="sim_size" delta="20000"/> 944 <output name="plots" file="QC_rdata.pdf" compare="sim_size" delta="20000"/>
836 </test> 945 </test>
837 <test> 946 <test expect_num_outputs="1">
838 <param name="infile" value="empty_spectra.rdata" ftype="rdata"/> 947 <param name="infile" value="empty_spectra.rdata" ftype="rdata"/>
839 <param name="peptide_file" value="inputpeptides.txt"/> 948 <param name="peptide_file" value="inputpeptides.txt"/>
840 <param name="calibrant_file" value="inputcalibrantfile2.txt"/> 949 <param name="calibrant_file" value="inputcalibrantfile2.txt"/>
841 <param name="plusminus_dalton" value="0.1"/> 950 <param name="plusminus_dalton" value="0.1"/>
842 <param name="filename" value="Testfile_rdata"/> 951 <param name="filename" value="Testfile_rdata"/>
862 - optional fold change plot: draws a heatmap (x-y grid) for the fold change of two m/z (log2(intensity ratio)) 971 - optional fold change plot: draws a heatmap (x-y grid) for the fold change of two m/z (log2(intensity ratio))
863 972
864 Output: 973 Output:
865 974
866 - quality control report as pdf with key numbers and descriptive plots describing the mass spectrometry imaging data 975 - quality control report as pdf with key numbers and descriptive plots describing the mass spectrometry imaging data
976 - optional spectra information as tabular file with numbers of calibrants (needs input calibrant file), numbers of peaks, TIC and most abundant m/z in each spectrum
867 977
868 Tip: 978 Tip:
869 979
870 - For additional m/z heatmaps use the MSI ion images tool and to plot more mass spectra use the MSI massspectra tool. 980 - For additional m/z heatmaps use the MSI ion images tool and to plot more mass spectra use the MSI massspectra tool.
871 981