diff macros.xml @ 8:bb9500286fe4 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:11:44 -0400
parents 74b61bf5bc4b
children 0d4d4f16d455
line wrap: on
line diff
--- a/macros.xml	Wed Mar 25 06:02:50 2020 -0400
+++ b/macros.xml	Thu Apr 23 08:11:44 2020 -0400
@@ -1,10 +1,10 @@
 <macros>
-    <token name="@VERSION@">1.12.1</token>
+    <token name="@VERSION@">2.4.0</token>
 
     <xml name="requirements">
         <requirements>
             <requirement type="package" version="@VERSION@">bioconductor-cardinal</requirement>
-            <requirement type="package" version="3.5.1">r-base</requirement>
+            <requirement type="package" version="3.6.1">r-base</requirement>
             <yield/>
         </requirements>
     </xml>
@@ -32,15 +32,10 @@
     <token name="@READING_MSIDATA@"><![CDATA[
         ## importing MSI data files
 
-        ## function to read RData files independent of filename
-        loadRData <- function(fileName){
-        load(fileName)
-        get(ls()[ls() != "fileName"])
-        }
-
         #if $infile.ext == 'imzml'
             #if str($processed_cond.processed_file) == "processed":
-                msidata <- readImzML('infile', mass.accuracy=$processed_cond.accuracy, units.accuracy = "$processed_cond.units", attach.only=TRUE)
+                msidata <- readImzML('infile', resolution=$processed_cond.accuracy, attach.only=TRUE, units = "$processed_cond.units")
+                msidata = collect(msidata, as.matrix=TRUE) ##coercion to continuous
                 centroided(msidata) = $centroids
             #else
                 msidata <- readImzML('infile', attach.only=TRUE)
@@ -50,6 +45,11 @@
             msidata = readAnalyze('infile', attach.only=TRUE)
             centroided(msidata) = $centroids
         #else
+            ## function to read RData files independent of filename
+            loadRData <- function(fileName){
+            load(fileName)
+            get(ls()[ls() != "fileName"])
+            }
             msidata = loadRData('infile.RData')
         #end if
 
@@ -86,34 +86,34 @@
         property_df = data.frame(properties, values)
     ]]></token>
 
-    <token name="@READING_MSIDATA_INRAM@"><![CDATA[
+    <token name="@READING_MSIDATA_FULLY_COMPATIBLE@"><![CDATA[
         ## importing MSI data files
 
-        ## function to read RData files independent of filename
-        loadRData <- function(fileName){
-        load(fileName)
-        get(ls()[ls() != "fileName"])
-        }
-
         #if $infile.ext == 'imzml'
             #if str($processed_cond.processed_file) == "processed":
-                msidata <- readImzML('infile', mass.accuracy=$processed_cond.accuracy, units.accuracy = "$processed_cond.units")
+                msidata <- readImzML('infile', resolution=$processed_cond.accuracy, units = "$processed_cond.units", attach.only=TRUE)
                 centroided(msidata) = $centroids
-                iData(msidata) = iData(msidata)[]
             #else
-                msidata <- readImzML('infile')
+                msidata <- readImzML('infile', attach.only=TRUE)
                 centroided(msidata) = $centroids
             #end if
         #elif $infile.ext == 'analyze75'
-            msidata = readAnalyze('infile')
+            msidata = readAnalyze('infile', attach.only=TRUE)
             centroided(msidata) = $centroids
         #else
+            ## function to read RData files independent of filename
+            loadRData <- function(fileName){
+            load(fileName)
+            get(ls()[ls() != "fileName"])
+            }
             msidata = loadRData('infile.RData')
+            msidata = as(msidata, "MSImagingExperiment")
+            run(msidata) = "infile"
         #end if
 
     ]]></token>
 
-    <token name="@DATA_PROPERTIES_INRAM@"><![CDATA[
+    <token name="@DATA_PROPERTIES_INRAM@"><![CDATA[ 
 ########################### QC numbers ########################
 ## including intensity calculations which need data in RAM
         ## Number of features (mz)
@@ -130,17 +130,16 @@
         minimumy = min(coord(msidata)[,2])
         maximumy = max(coord(msidata)[,2])
         ## Range of intensities
-        minint = round(min(spectra(msidata), na.rm=TRUE), digits=2)
-        maxint = round(max(spectra(msidata), na.rm=TRUE), digits=2)
+        minint = round(min(as.matrix(spectra(msidata)), na.rm=TRUE), digits=2)
+        maxint = round(max(as.matrix(spectra(msidata)), na.rm=TRUE), digits=2)
         ## Number of intensities > 0, for if conditions
-        npeaks= sum(spectra(msidata)>0, na.rm=TRUE)
+        npeaks= sum(as.matrix(spectra(msidata))>0, na.rm=TRUE)
         ## Number of NA in spectra matrix
         NAcount = sum(is.na(spectra(msidata)))
         ## Number of NA in spectra matrix
-        infcount = sum(is.infinite(spectra(msidata)))
+        infcount = sum(is.infinite(as.matrix(spectra(msidata))))
         ## Number of duplicated coordinates
         dupl_coord = sum(duplicated(coord(msidata)))
-
         properties = c("Number of m/z features",
                        "Range of m/z values",
                        "Number of pixels", 
@@ -298,6 +297,7 @@
     <xml name="citations">
         <citations>
             <citation type="doi">10.1093/bioinformatics/btv146</citation>
+            <citation type="doi">10.1093/gigascience/giz143</citation>
         </citations>
     </xml>
     <xml name="infile_analyze75">