diff combine.xml @ 9:7e18fcb92a6a draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit 6e8b69ee3aff3c93f745a5de11cc9169130f2e5e"
author galaxyp
date Thu, 24 Sep 2020 11:38:29 +0000
parents 525f201b86c1
children 5f066029763e
line wrap: on
line diff
--- a/combine.xml	Wed May 13 14:08:25 2020 -0400
+++ b/combine.xml	Thu Sep 24 11:38:29 2020 +0000
@@ -1,4 +1,4 @@
-<tool id="cardinal_combine" name="MSI combine" version="@VERSION@.1">
+<tool id="cardinal_combine" name="MSI combine" version="@VERSION@.0">
     <description>
         combine several mass spectrometry imaging datasets into one
     </description>
@@ -6,7 +6,7 @@
         <import>macros.xml</import>
     </macros>
     <expand macro="requirements">
-        <requirement type="package" version="3.2.1">r-ggplot2</requirement>
+        <requirement type="package" version="3.3.2">r-ggplot2</requirement>
         <requirement type="package" version="0.12">r-maldiquantforeign</requirement>
         <requirement type="package" version="1.19.3">r-maldiquant</requirement>
     </expand>
@@ -110,17 +110,15 @@
             msidata_$i\$column4 = NULL
             msidata_$i\$column5 = NULL
             msidata_$i\$combined_sample = NULL
+            msidata_$i <- as(msidata_$i, "MSImagingExperiment")
         #end if
 
-    ## coercion into MSImageSet
-    msidata_$i = as(msidata_$i, "MSImageSet")
-
     ## remove duplicated coordinates, otherwise combine will fail
     print(paste0(sum(duplicated(coord(msidata_$i))), " duplicated coordinates were removed from input file"))
     msidata_${i} <- msidata_${i}[,!duplicated(coord(msidata_${i}))]
 
     ## same name for MSI data files necessary to combine data into one single coordinate system
-    sampleNames(msidata_$i) = "msidata"
+    run(msidata_$i) = "msidata"
 
 ############ 3) Read and process annotation tabular files ######################
 
@@ -252,7 +250,7 @@
        ## combine only valid datasets
 
         valid_data =  list(#echo ','.join($msidata)#)[valid_dataset]
-        msidata = do.call(combine, valid_data)
+        msidata = do.call(cbind, valid_data)
         print("Valid datasets in order of input bottom to top:")
         print(valid_dataset)
         writeImzML(msidata, "out")
@@ -280,13 +278,13 @@
         datasetlist = list()
         count = 1
         for (usable_dataset in list(#echo ','.join($msidata)#)){
-            pixelsofinterest = pixels(usable_dataset)[names(pixels(usable_dataset)) %in% rownames(coordinates_combined)]
+        
+            pixelsofinterest = paste(coord(usable_dataset)\$x, coord(usable_dataset)\$y, sep="_") %in% paste(coordinates_combined\$x, coordinates_combined\$y, sep="_")           
             filtered_dataset = usable_dataset[,pixelsofinterest]
             if (ncol(filtered_dataset) > 0 ){
                 datasetlist[[count]] = filtered_dataset}
             count = count +1}
-
-        msidata = do.call(combine, datasetlist)
+        msidata = do.call(cbind, datasetlist)
         writeImzML(msidata, "out")
 
     #else
@@ -362,7 +360,7 @@
     <inputs>
         <param name="infiles" type="data" multiple="true" format="imzml,rdata,analyze75"
             label="MSI data"
-            help="Input file as imzML (composite upload), Analyze7.5 (composite upload) or Cardinal MSImageSet saved as RData (regular upload)"/>
+            help="Input file as imzML (composite upload), Analyze7.5 (composite upload) or Cardinal 'MSImageSet'  or 'MSImagingExperiment' saved as RData (regular upload)"/>
         <param name="centroids" type="boolean" label="Centroided input" help="Choose Yes if peak detection has already been done." truevalue="TRUE" falsevalue="FALSE"/>
         <conditional name="processed_cond">
             <param name="processed_file" type="select" label="Processed imzML file" help="Choose no if your input is an Analyze7.5 or continuous imzML file">