diff combine.xml @ 7:392b2dfd261d 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:04:25 -0400
parents bb1ac6b47a6c
children 525f201b86c1
line wrap: on
line diff
--- a/combine.xml	Wed Mar 25 07:02:41 2020 -0400
+++ b/combine.xml	Thu Apr 23 08:04:25 2020 -0400
@@ -1,17 +1,15 @@
-<tool id="cardinal_combine" name="MSI combine" version="2.2.6.1">
+<tool id="cardinal_combine" name="MSI combine" version="@VERSION@.0">
     <description>
         combine several mass spectrometry imaging datasets into one
     </description>
     <macros>
         <import>macros.xml</import>
     </macros>
-    <requirements>
-        <requirement type="package" version="2.2.6">bioconductor-cardinal</requirement>
-        <requirement type="package" version="3.6.1">r-base</requirement>
+    <expand macro="requirements">
         <requirement type="package" version="3.2.1">r-ggplot2</requirement>
         <requirement type="package" version="0.12">r-maldiquantforeign</requirement>
         <requirement type="package" version="1.19.3">r-maldiquant</requirement>
-    </requirements>
+    </expand>
     <command detect_errors="exit_code">
     <![CDATA[
         #for $i, $infile in enumerate($infiles):
@@ -54,6 +52,7 @@
 library(MALDIquantForeign)
 library(MALDIquant)
 
+
 ## read tabular file for xy_shift option
 #if str( $combine_conditional.combine_method ) == 'xy_shifts':
     input_list = read.delim("$combine_conditional.coordinates_file", header = $combine_conditional.xy_header, 
@@ -85,18 +84,24 @@
 
     ## read and manipulate MSI data
 
-    #if $infile.ext == 'imzml'
-        #if str($processed_cond.processed_file) == "processed":
-            msidata_$i <- readImzML('infile_${i}', resolution=$processed_cond.accuracy, units = "$processed_cond.units", attach.only=TRUE, as = c("MSImageSet"))
+        #if $infile.ext == 'imzml'
+            #if str($processed_cond.processed_file) == "processed":
+                msidata_$i <- readImzML('infile_${i}', resolution=$processed_cond.accuracy, units = "$processed_cond.units", attach.only=TRUE, as="MSImageSet")
+                ##msidata_$i = collect(msidata_$i, as.matrix=TRUE) ##coercion to continuous
+                centroided(msidata_$i) = $centroids
+            #else
+                msidata_$i <- readImzML('infile_${i}', attach.only=TRUE, as="MSImageSet")
+                centroided(msidata_$i) = $centroids
+            #end if
+        #elif $infile.ext == 'analyze75'
+            msidata_$i = readAnalyze('infile_${i}', attach.only=TRUE, as="MSImageSet")
             centroided(msidata_$i) = $centroids
         #else
-            msidata_$i <- readImzML('infile_${i}', attach.only=TRUE, as = c("MSImageSet"))
-            centroided(msidata_$i) = $centroids
-        #end if
-    #elif $infile.ext == 'analyze75'
-            msidata_$i <- readAnalyze('infile_${i}', attach.only=TRUE, as = c("MSImageSet"))
-            centroided(msidata_$i) = $centroids
-    #else
+            ## function to read RData files independent of filename
+            loadRData <- function(fileName){
+            load(fileName)
+            get(ls()[ls() != "fileName"])
+            }
             msidata_$i = loadRData('infile_${i}.RData')
             ## keep compatibility with old .RData files:
             msidata_$i\$column1 = NULL
@@ -105,8 +110,7 @@
             msidata_$i\$column4 = NULL
             msidata_$i\$column5 = NULL
             msidata_$i\$combined_sample = NULL
-
-    #end if
+        #end if
 
     ## remove duplicated coordinates, otherwise combine will fail
     print(paste0(sum(duplicated(coord(msidata_$i))), " duplicated coordinates were removed from input file"))
@@ -563,5 +567,6 @@
         <citations>
             <citation type="doi">10.1093/bioinformatics/btv146</citation>
             <citation type="doi">10.1007/978-3-319-45809-0_6</citation>
+            <citation type="doi">10.1093/gigascience/giz143</citation>
         </citations>
 </tool>