changeset 6:8431b33e6989 draft default tip

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/MALDIquant commit 8c5cd26641af4b6206662ee525c1e7bd4205d96e"
author galaxyp
date Thu, 16 Apr 2020 21:48:53 +0000
parents af766257766e
children
files maldi_quant_peakdetection.xml
diffstat 1 files changed, 37 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/maldi_quant_peakdetection.xml	Thu Mar 19 22:06:54 2020 +0000
+++ b/maldi_quant_peakdetection.xml	Thu Apr 16 21:48:53 2020 +0000
@@ -1,4 +1,4 @@
-<tool id="maldi_quant_peak_detection" name="MALDIquant peak detection" version="@VERSION@.5">
+<tool id="maldi_quant_peak_detection" name="MALDIquant peak detection" version="@VERSION@.6">
     <description>
         Peak detection, binning and filtering for mass-spectrometry imaging data
     </description>
@@ -379,6 +379,7 @@
                     #end if
 
                     peaks = removeEmptyMassObjects(peaks)
+                    pixelnames = paste("xy", coordinates(peaks)[,1],coordinates(peaks)[,2], sep="_")
             }
         #end if
 
@@ -387,15 +388,15 @@
 
         for (random_sample in random_spectra){
 
-
-        tryCatch(
-                {
-                    plot(peaks[[random_sample]], sub="", main=paste0("spectrum ", pixelnames[random_sample]))},
-                error=function(cond) {
-                    plot(NULL, xlim=c(0,0), ylim=c(0,0), ylab="intensity", xlab="m/z")
-                }
-            )
-}
+            tryCatch(
+                        {
+                            plot(peaks[[random_sample]], sub="", main=paste0("spectrum ", pixelnames[random_sample]))
+                        },error=function(cond) 
+                        {
+                            plot(NULL, xlim=c(0,0), ylim=c(0,0), ylab="intensity", xlab="m/z")
+                        }
+                    )
+        }
 
         title("Aligned spectra", outer=TRUE, line=0)
         minmz = round(min(unlist(lapply(peaks,mass))), digits=4)
@@ -415,12 +416,14 @@
                     featureMatrix <- intensityMatrix(peaks, maldi_data)
                 #end if
             #end if
+
             featureMatrix2 =cbind(pixelnames, featureMatrix)
             colnames(featureMatrix2)[1] = c("mz")
             featureMatrix2 = t(featureMatrix2)
             write.table(featureMatrix2, file="$intensity_matrix", quote = FALSE, row.names = TRUE, col.names=FALSE, sep = "\t")
         }else{print("There are no spectra with peaks left")}
 
+
     #elif str( $method.methods_conditional.method ) == 'Binning':
 
         print('binning')
@@ -430,8 +433,19 @@
 
         ## QC plot and numbers
         par(mfrow = c(2, 2), oma=c(0,0,2,0))
+
         for (random_sample in random_spectra){
-            plot(peaks[[random_sample]], sub="", main=paste0("spectrum ", pixelnames[random_sample]))}
+
+            tryCatch(
+                        {
+                            plot(peaks[[random_sample]], sub="", main=paste0("spectrum ", pixelnames[random_sample]))
+                        },error=function(cond) 
+                        {
+                            plot(NULL, xlim=c(0,0), ylim=c(0,0), ylab="intensity", xlab="m/z")
+                        }
+                    )
+        }
+
         title("Binned spectra", outer=TRUE, line=0)
         minmz = round(min(unlist(lapply(peaks,mass))), digits=4)
         maxmz = round(max(unlist(lapply(peaks,mass))), digits=4)
@@ -481,8 +495,19 @@
 
         ##QC plot and numbers
         par(mfrow = c(2, 2), oma=c(0,0,2,0))
+
         for (random_sample in random_spectra){
-            plot(peaks[[random_sample]], sub="", main=paste0("spectrum ", pixelnames[random_sample]))}
+
+            tryCatch(
+                        {
+                            plot(peaks[[random_sample]], sub="", main=paste0("spectrum ", pixelnames[random_sample]))
+                        },error=function(cond)
+                        {
+                            plot(NULL, xlim=c(0,0), ylim=c(0,0), ylab="intensity", xlab="m/z")
+                        }
+                    )
+        }
+
         title("Filtered spectra", outer=TRUE, line=0)
         minmz = round(min(unlist(lapply(peaks,mass))), digits=4)
         maxmz = round(max(unlist(lapply(peaks,mass))), digits=4)