comparison classification.xml @ 3:585ef27873c9 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit 2c4a1a862900b4efbc30824cbcb798f835b168b2
author galaxyp
date Thu, 28 Feb 2019 09:24:53 -0500
parents cbc7e53518ce
children 47fc5b518ffc
comparison
equal deleted inserted replaced
2:cbc7e53518ce 3:585ef27873c9
30 30
31 @READING_MSIDATA_INRAM@ 31 @READING_MSIDATA_INRAM@
32 32
33 ## to make sure that processed files work as well: 33 ## to make sure that processed files work as well:
34 iData(msidata) = iData(msidata)[] 34 iData(msidata) = iData(msidata)[]
35
36 ## remove duplicated coordinates
37 print(paste0(sum(duplicated(coord(msidata))), " duplicated coordinates were removed"))
38 msidata <- msidata[,!duplicated(coord(msidata))]
35 39
36 @DATA_PROPERTIES_INRAM@ 40 @DATA_PROPERTIES_INRAM@
37 41
38 42
39 ######################################## PDF ################################### 43 ######################################## PDF ###################################
229 maximumy = max(coord(msidata)[,2]) 233 maximumy = max(coord(msidata)[,2])
230 print(image(msidata, mz = topLabels(msidata.pls)[1,1], normalize.image = "linear", contrast.enhance = "histogram",ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy), smooth.image="gaussian", main="best m/z heatmap")) 234 print(image(msidata, mz = topLabels(msidata.pls)[1,1], normalize.image = "linear", contrast.enhance = "histogram",ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy), smooth.image="gaussian", main="best m/z heatmap"))
231 235
232 ### m/z and pixel information output 236 ### m/z and pixel information output
233 pls_classes = data.frame(msidata.pls\$classes[[1]]) 237 pls_classes = data.frame(msidata.pls\$classes[[1]])
234 pixel_names = gsub(", y = ", "_", names(pixels(msidata))) 238 ## pixel names and coordinates
235 pixel_names = gsub(" = ", "y_", pixel_names) 239 ## to remove potential sample names and z dimension, split at comma and take only x and y
236 x_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,2] 240 x_coords = unlist(lapply(strsplit(names(pixels(msidata)), ","), `[[`, 1))
237 y_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,3] 241 y_coords = unlist(lapply(strsplit(names(pixels(msidata)), ","), `[[`, 2))
242 x_coordinates = gsub("x = ","",x_coords)
243 y_coordinates = gsub(" y = ","",y_coords)
244 pixel_names = paste0("xy_", x_coordinates, "_", y_coordinates)
238 245
239 ## remove msidata to clean up RAM space 246 ## remove msidata to clean up RAM space
240 rm(msidata) 247 rm(msidata)
241 gc() 248 gc()
242 pls_classes2 = data.frame(pixel_names, x_coordinates, y_coordinates, pls_classes) 249 pls_classes2 = data.frame(pixel_names, x_coordinates, y_coordinates, pls_classes)
371 ### image of the best m/z 378 ### image of the best m/z
372 minimumy = min(coord(msidata)[,2]) 379 minimumy = min(coord(msidata)[,2])
373 maximumy = max(coord(msidata)[,2]) 380 maximumy = max(coord(msidata)[,2])
374 print(image(msidata, mz = topLabels(msidata.opls)[1,1], normalize.image = "linear", contrast.enhance = "histogram",smooth.image="gaussian", ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy), main="best m/z heatmap")) 381 print(image(msidata, mz = topLabels(msidata.opls)[1,1], normalize.image = "linear", contrast.enhance = "histogram",smooth.image="gaussian", ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy), main="best m/z heatmap"))
375 382
376 ## m/z and pixel information output
377 opls_classes = data.frame(msidata.opls\$classes[[1]]) 383 opls_classes = data.frame(msidata.opls\$classes[[1]])
378 pixel_names = gsub(", y = ", "_", names(pixels(msidata))) 384 ## pixel names and coordinates
379 pixel_names = gsub(" = ", "y_", pixel_names) 385 ## to remove potential sample names and z dimension, split at comma and take only x and y
380 x_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,2] 386 x_coords = unlist(lapply(strsplit(names(pixels(msidata)), ","), `[[`, 1))
381 y_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,3] 387 y_coords = unlist(lapply(strsplit(names(pixels(msidata)), ","), `[[`, 2))
388 x_coordinates = gsub("x = ","",x_coords)
389 y_coordinates = gsub(" y = ","",y_coords)
390 pixel_names = paste0("xy_", x_coordinates, "_", y_coordinates)
391
382 opls_classes2 = data.frame(pixel_names, x_coordinates, y_coordinates, opls_classes) 392 opls_classes2 = data.frame(pixel_names, x_coordinates, y_coordinates, opls_classes)
383 colnames(opls_classes2) = c("pixel names", "x", "y","predicted condition") 393 colnames(opls_classes2) = c("pixel names", "x", "y","predicted condition")
384 394
385 ## remove msidata to clean up RAM space 395 ## remove msidata to clean up RAM space
386 rm(msidata) 396 rm(msidata)
518 maximumy = max(coord(msidata)[,2]) 528 maximumy = max(coord(msidata)[,2])
519 print(image(msidata, mz = topLabels(msidata.ssc)[1,1], normalize.image = "linear", contrast.enhance = "histogram",smooth.image="gaussian", ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy), main="best m/z heatmap")) 529 print(image(msidata, mz = topLabels(msidata.ssc)[1,1], normalize.image = "linear", contrast.enhance = "histogram",smooth.image="gaussian", ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy), main="best m/z heatmap"))
520 530
521 ## m/z and pixel information output 531 ## m/z and pixel information output
522 ssc_classes = data.frame(msidata.ssc\$classes[[1]]) 532 ssc_classes = data.frame(msidata.ssc\$classes[[1]])
523 pixel_names = gsub(", y = ", "_", names(pixels(msidata))) 533
524 pixel_names = gsub(" = ", "y_", pixel_names) 534 ## pixel names and coordinates
525 x_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,2] 535 ## to remove potential sample names and z dimension, split at comma and take only x and y
526 y_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,3] 536 x_coords = unlist(lapply(strsplit(names(pixels(msidata)), ","), `[[`, 1))
537 y_coords = unlist(lapply(strsplit(names(pixels(msidata)), ","), `[[`, 2))
538 x_coordinates = gsub("x = ","",x_coords)
539 y_coordinates = gsub(" y = ","",y_coords)
540 pixel_names = paste0("xy_", x_coordinates, "_", y_coordinates)
541
527 542
528 ## remove msidata to clean up RAM space 543 ## remove msidata to clean up RAM space
529 rm(msidata) 544 rm(msidata)
530 gc() 545 gc()
531 546