diff macros.xml @ 9:e0bbaf9f7da0 draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit e499c9124d3fd85a7fc47b95c206ce91a5e3678c-dirty"
author galaxyp
date Tue, 03 Nov 2020 22:41:21 +0000
parents 413a1b74f496
children aa479a0cfb43
line wrap: on
line diff
--- a/macros.xml	Wed May 13 17:56:03 2020 +0000
+++ b/macros.xml	Tue Nov 03 22:41:21 2020 +0000
@@ -1,10 +1,10 @@
 <macros>
-    <token name="@VERSION@">2.4.0</token>
+    <token name="@VERSION@">2.6.0</token>
 
     <xml name="requirements">
         <requirements>
             <requirement type="package" version="@VERSION@">bioconductor-cardinal</requirement>
-            <requirement type="package" version="3.6.1">r-base</requirement>
+            <!--requirement type="package" version="3.6.1">r-base</requirement-->
             <yield/>
         </requirements>
     </xml>
@@ -117,6 +117,13 @@
     <token name="@DATA_PROPERTIES_INRAM@"><![CDATA[ 
 ########################### QC numbers ########################
 ## including intensity calculations which need data in RAM
+
+	int_matrix = as.matrix(spectra(msidata)) ## only load once into RAM, then re-use
+	## Number of NA in spectra matrix
+        NAcount = sum(is.na(int_matrix))
+	## replace NA with zero to calculate data properties based on intensity matrix, no change in msidata
+	int_matrix[is.na(int_matrix)] <- 0
+	
         ## Number of features (mz)
         maxfeatures = length(features(msidata))
         ## Range mz
@@ -131,14 +138,12 @@
         minimumy = min(coord(msidata)[,2])
         maximumy = max(coord(msidata)[,2])
         ## Range of intensities
-        minint = round(min(as.matrix(spectra(msidata)), na.rm=TRUE), digits=2)
-        maxint = round(max(as.matrix(spectra(msidata)), na.rm=TRUE), digits=2)
+        minint = round(min(int_matrix), digits=2)
+        maxint = round(max(int_matrix), digits=2)
         ## Number of intensities > 0, for if conditions
-        npeaks= sum(as.matrix(spectra(msidata))>0, na.rm=TRUE)
+        npeaks= sum(int_matrix>0)
         ## Number of NA in spectra matrix
-        NAcount = sum(is.na(spectra(msidata)))
-        ## Number of NA in spectra matrix
-        infcount = sum(is.infinite(as.matrix(spectra(msidata))))
+        infcount = sum(is.infinite(int_matrix))
         ## Number of duplicated coordinates
         dupl_coord = sum(duplicated(coord(msidata)))
         properties = c("Number of m/z features",
@@ -175,7 +180,7 @@
 
             - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <https://ms-imaging.org/wp/imzml/>`_
             - Analyze7.5 (upload hdr, img and t2m file via the "composite" function)
-            - Cardinal "MSImageSet" data saved as .RData
+            - Cardinal "MSImageSet" or "MSImagingExperiment" saved as .RData
     ]]></token>
     <token name="@MZ_TABULAR_INPUT_DESCRIPTION@"><![CDATA[
         - Optional tabular file with m/z values: 
@@ -243,7 +248,7 @@
             </param>
             <when value="no_processed"/>
             <when value="processed">
-                <param name="accuracy" type="float" value="50" label="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"/>
+                <param name="accuracy" type="float" value="50" label="Mass accuracy to which the m/z values will be binned"/>
                 <param name="units" display="radio" type="select" label="Unit of the mass accuracy" help="either m/z or ppm">
                     <option value="mz" >mz</option>
                     <option value="ppm" selected="True" >ppm</option>