diff classification.xml @ 7:6f4c34f8d5ba draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit f986c51abe33c7f622d429a3c4a79ee24b33c1f3"
author galaxyp
date Thu, 23 Apr 2020 08:03:28 -0400
parents 47fc5b518ffc
children 277dc652246e
line wrap: on
line diff
--- a/classification.xml	Wed Mar 25 08:04:22 2020 -0400
+++ b/classification.xml	Thu Apr 23 08:03:28 2020 -0400
@@ -1,12 +1,11 @@
-<tool id="cardinal_classification" name="MSI classification" version="@VERSION@.3">
+<tool id="cardinal_classification" name="MSI classification" version="@VERSION@.0">
     <description>spatial classification of mass spectrometry imaging data</description>
     <macros>
         <import>macros.xml</import>
     </macros>
     <expand macro="requirements">
-        <requirement type="package" version="3.0">r-ggplot2</requirement>
         <requirement type="package" version="2.3">r-gridextra</requirement>
-        <requirement type="package" version="0.20_35">r-lattice</requirement>
+        <requirement type="package" version="3.2.1">r-ggplot2</requirement>
     </expand>
     <command detect_errors="exit_code">
     <![CDATA[
@@ -25,10 +24,12 @@
 
 library(Cardinal)
 library(gridExtra)
-library(lattice)
 library(ggplot2)
 
-@READING_MSIDATA_INRAM@
+
+@READING_MSIDATA@
+
+   msidata = as(msidata, "MSImageSet") ##coercion to MSImageSet
 
 
 ## remove duplicated coordinates
@@ -245,7 +246,7 @@
                 ### image of the best m/z
                 minimumy = min(coord(msidata)[,2])
                 maximumy = max(coord(msidata)[,2])
-                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"))
+                print(image(msidata, mz = topFeatures(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"))
 
                 ### m/z and pixel information output
                 pls_classes = data.frame(msidata.pls\$classes[[1]])
@@ -262,7 +263,7 @@
                 gc()
                 pls_classes2 = data.frame(pixel_names, x_coordinates, y_coordinates, pls_classes)
                 colnames(pls_classes2) = c("pixel names", "x", "y","predicted condition")
-                pls_toplabels = topLabels(msidata.pls, n=Inf)
+                pls_toplabels = topFeatures(msidata.pls, n=Inf)
                 pls_toplabels[,4:6] <-round(pls_toplabels[,4:6],6)
                 write.table(pls_toplabels, file="$mzfeatures", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
                 write.table(pls_classes2, file="$pixeloutput", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
@@ -411,7 +412,7 @@
                 ### image of the best m/z
                 minimumy = min(coord(msidata)[,2])
                 maximumy = max(coord(msidata)[,2])
-                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"))
+                print(image(msidata, mz = topFeatures(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"))
 
                 opls_classes = data.frame(msidata.opls\$classes[[1]])
                 ## pixel names and coordinates
@@ -429,7 +430,7 @@
                 rm(msidata)
                 gc()
 
-                opls_toplabels = topLabels(msidata.opls, n=Inf)
+                opls_toplabels = topFeatures(msidata.opls, n=Inf)
                 opls_toplabels[,4:6] <-round(opls_toplabels[,4:6],6)
                 write.table(opls_toplabels, file="$mzfeatures", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
                 write.table(opls_classes2, file="$pixeloutput", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
@@ -577,7 +578,7 @@
                 ### image of the best m/z
                 minimumy = min(coord(msidata)[,2])
                 maximumy = max(coord(msidata)[,2])
-                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"))
+                print(image(msidata, mz = topFeatures(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"))
 
                 ## m/z and pixel information output
                 ssc_classes = data.frame(msidata.ssc\$classes[[1]])
@@ -597,7 +598,7 @@
 
                 ssc_classes2 = data.frame(pixel_names, x_coordinates, y_coordinates, ssc_classes)
                 colnames(ssc_classes2) = c("pixel names", "x", "y","predicted condition")
-                ssc_toplabels = topLabels(msidata.ssc, n=Inf)
+                ssc_toplabels = topFeatures(msidata.ssc, n=Inf)
                 ssc_toplabels[,6:9] <-round(ssc_toplabels[,6:9],6)
                 write.table(ssc_toplabels, file="$mzfeatures", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
                 write.table(ssc_classes2, file="$pixeloutput", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
@@ -664,7 +665,7 @@
         y_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,3]
         predicted_classes2 = data.frame(pixel_names, x_coordinates, y_coordinates, predicted_classes)
         colnames(predicted_classes2) = c("pixel names", "x", "y","predicted condition")
-        predicted_toplabels = topLabels(prediction, n=Inf)
+        predicted_toplabels = topFeatures(prediction, n=Inf)
         if (colnames(predicted_toplabels)[4] == "coefficients"){
             predicted_toplabels[,4:6] <-round(predicted_toplabels[,4:6],5)
 
@@ -1000,7 +1001,7 @@
             <output name="mzfeatures" file="features_test6.tabular"/>
             <output name="pixeloutput" file="pixels_test6.tabular"/>
             <output name="classification_images" file="test6.pdf" compare="sim_size"/>
-            <output name="classification_rdata" file="test6.rdata" compare="sim_size" />
+            <output name="classification_rdata" file="test6.rdata" compare="sim_size" delta="15000"/>
         </test>
 
         <test expect_num_outputs="4">
@@ -1090,3 +1091,4 @@
     </help>
     <expand macro="citations"/>
 </tool>
+